Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kaf

Pages: [1]
1
Programming using the Ultra Hal Brain Editor / ER1 and Hal
« on: November 08, 2004, 09:49:26 am »
Update: 8th November 2004
Ok folks, here is the latest update on HAL & the ER1.
There hasn't been a lot going on with this project due to free time. My ER1 currently runs on a Mini-ITX M10000 (1Ghz CPU). It's trying to run HAL, Dragon Speech & the ER1 RCC software. As you can imagine, the CPU is at 100% just running the RCC software alone. I'm waiting for the release of the new ITX board in the UK to turbo charge this project. Here is the link for Commell.
http://http://www.commell.com.tw/News/News/News_20040813_LV-672.htm
 The new board will have 800mhz FSB which means i can slap a P4 3.6 with Hyper threading onto it. The robots 18A per hour power pack should last about 2 hours with this power hungry chip. But hey! better to have 2 hours of fun than 4 hours of frustration.
 The bot had a mic mounted on its head that required the user to talk within 2 feet before the dragon speech software recognized the commands. This was annoying because I had to get off my couch to talk to it? This bought on an idea!
A Belkin Bluetooth USB adapter was fitted for £15 ($28). This allowed my mobile phone's hands free ear piece/mic to connect to the robot motherboard. The software allows configuration of the earpiece to use only the Microphone and still allow the sound to come through the robot speakers. This now allows me voice access to HAL on the robot within 10 metres. Pity my fridge is further!
 I have read on the forum about the switching On/Off of the mic on the HAL program. Fortunately dragon speech does not require you to use this facility, the speech package inputs the text into the Input box as if you had typed it. I had tried using the mic switch on the HAL program but this gave a wierd conflict with the dragon speech.
For those of you who are frustrated with the mic picking up Hal's responses in a continuose loop, the <Hal name>, <command> is the only way I stopped this. Look on the link on the previous messages to impliment this.
I'll keep you all posted with this on going project.

Kaf

2
Programming using the Ultra Hal Brain Editor / ER1 and Hal
« on: September 07, 2004, 10:51:54 pm »
Hi again folks,
Ok, here is the big one! How to interface HAL to the ER1 robot...
This would be done with the RCC software running on the robot and connecting via the Telnet API. It's ideal for those of you who want the object recognition part of the software available to HAL.
e.g. On recognizing an object (apple), the EVENT call should reply with a text "object apple new (23%) (117,16,19.876 Inches)" This format is object <"name"> <features matched><total features> <x> <y> <distance>.
Now the bad news, unfortunately to achieve this you'll need an ActiveX object to perform the Telnet comms for you. You can re-invent the wheel or grit your teeth and buy one. I managed to find one at http://http://www.activexperts.com/activsocket/ It costs $149 dollars. That's about 100 uk pounds and they only sell a 10 license pack. You can download a 30day trial.
Using the trial ActiveSocket, here is an example script for you. Sorry, if it's a bit messy but my VBScript isn't that brilliant. Maybe the experts amongst us can tell us whether we can create some kind of an event in script to constantly send an EVENTS call to the Remote Control Centre software to read the responses.
This script can be run standalone and I've tested it on my ER1. It only needs integrating into HAL's main brain script.
Another good feature of using HAL with the ER1 is like me having a low powered 1Ghz CPU on the robot, all the processing power is eaten away by the RCC software. Using the Telnet connection via wireless network, we can have HAL & the Voice recognition program running on the desktop. HAL's speech and movement responses can still be relayed across to the robot to be acted on.  
Another object of the ActiveSocket is TCP/IP connections. I havent tried this out yet, but hopefully this weekend. If it works on Strabo Pathfinder, then this would complete the requirements for the ER1...Auto mapping via Strabo, Speech via HAL, Sight/Movement by the RCC software, Unlimted I/O connectability via Mitsubishi! I can now get rid of the Mrs!
Happy Scripting

Kaf

Download Attachment: rob2.zip
2.08 KB

3
Programming using the Ultra Hal Brain Editor / ER1 and Hal
« on: August 31, 2004, 09:26:16 pm »
Hi all
I also have the ER1 robot along with HAL. Unfortunately I was one of the unlucky ones who purchased the robot after they stopped giving out the Software Development Kit for early buyers. This would have allowed integration to their software a bit easier. What IS given to new buyers of the ER1 kit is an API interface (which can be tested using windows Telnet program) or via the Python language.
I've tried using the python language but its just too slow running on the EPIA Mini ITX. (I might have to upgrade to a P4 board instead). I've played about a bit with HAL to see how it can be integrated to the ER1 or to the outside world even.
The 1st is voice recognition. We all need to talk to our ER1's. Unfortunately, the standard windows voice recognition is not good enough. (Too many errors) I had to use dragon speech for HAL to recieve what I was trying to say. The problems I encountered can be seen on this board.
http://http://www.zabaware.com/forum/topic.asp?TOPIC_ID=1221&SearchTerms=ER1
The final solution was to always say the name of your HAL before the command. This also stopped the mic picking up un-intentional sounds.
The next was to add script to the main brain to act on command responses. eg. (using the Hal_Brain_Editor>Tools>Main_Knowledge_Database_>Main_keyword_&_priority_brain editor) we teach it to recognize the text MOVE, then additional text FORWARD. Under random response1, we put in "ER1:N100:I will now move forward".
Now back to the scripting. We create some code to recognize the first 4 characters with "ER1:" in a response. This can will tell further scripting the proceeding text is a valid action command followed by reply text.

The next issue I seem to read about is external interfacing of HAL to the big wide world. My job is a control systems engineer designing control systems. Our company uses only Mitsubishi kit so I can only tell you how to interface HAL via this route. Any Mitsubishi hardware can be used from PLC's (Programmable Logic Controllers, Speed Inverters, Servo Drives, SCADA systems, CCLink, Profibus, ASI networks, ect..).
The best way is by example. Suppose we want to control our house electrical appliances using HAL. The key item is a a program from Mitsubishi called MXComponent. This is basically an ActiveX interfacing program allowing easy interfacing to the hardware.
We will use a FX series PLC with 8 digital inputs & 8 relay outputs.
A serial lead with a RS232 to RS422 converter connects the PC to PLC programming port. Thats it! The relay outputs on the PLC is good for about 5Amps. Anything bigger will need a larger slave relay.
The stripped down MXComponet code written to the HAL script would look something like this.

Function plcwrite(Devicenumber, Devicevalue)
'  The ActEasyIF object is made.
Set ActCtrl = CreateObject("ActMulti.ActMLEasyIF")
'  The value of a LogicalStationNumber is set in the property.
ActCtrl.ActLogicalStationNumber = 0
'  The Open method is executed.
oret = ActCtrl.Open()
'  Write to PLC Data register
wret = ActCtrl.WriteDeviceBlock(Devicenumber, 1, Devicevalue)
'  Close the device
cret = ActCtrl.Close()
End Function

Now, if we wanted to write the value of 1 to data register D300, we simple call the function: plcwrite("D300",1) in our script.

In the PLC end, we can simple program up in ladder logic (very simple in ladder logic).

[= D300 k1]-------------------------------(X1)

This will switch on output1 when D300 contains the value of 1.
The possiblities is now only restricted to your imagination. eg. An off delay for the toilet extraction fan to switch off. Toggle switches, Dimmers, ect.
Additional functional modules such as extra I/O's, Analogue I/O's, PID controllers... the list is endless. (Blimey! I'm sounding like a salesman!)

Hope this is useful info for anyone wanting to use external controls.
(especially when mains voltages and heavy currents are concerned).

Kaf

Oh, here is some piccies of my ER1.




Download Attachment: rob.zip
110.02 KB

4
Ultra Hal 7.0 / How can i stop Hal talking to itself
« on: March 20, 2004, 08:36:19 pm »
Thanks for the help =Vonsmith=.
I wasn't sure how the UserSentence was formatted and didn't want to alter the format.
I noticed you Trim(UserSentence) to remove the space at both ends.
Can I still use Hal's name as firstword of the sentence and then strip out the name and then add the spaces back? Is the space at either end critical for the rest of the program to process correctly?
What I wanted was the Hal program to recognise a voice recognition sentence was directed at it but then to continue processing as normal but minus the Hal name at the start.

e.g.

If InStr(1, Trim(UserSentence), ComputerName, vbTextCompare) = 1 Then
   UserSentence = Right(UserSentence,(Len(UserSentence)-(Len(ComputerName)+1)))+" "
Else
   Exit Function
End If

Thanks again

Kaf

5
Ultra Hal 7.0 / How can i stop Hal talking to itself
« on: March 19, 2004, 06:46:32 pm »
Thanks for all your feedback folks. I have been looking at ways to stop the microphone picking up Hal's response from the speakers. Even as far as some kind of mic with auto on/off based on level of sound being picked up.
The solution was so obvious. Thanks Crichton for pointing it out!. Because Hal would be used on a robot, the robot should only respond when its name is called first. Even in Star Trek, the captn always communicates to the computer by saying "COMPUTER, EARL GREY TEA. MEDIUM HOT". The same applies here.
Here is a few lines of code to be placed into the Brain. Use the 'Hal Brain Editor' to add this script. Place it under the Function GetResponse(Byval Usersentence, Byval UserName, ect....).
This is at the top near line 0139.

Rsentence = UCase(UserSentence) 'Convert user sentence to Uppercase
Robotname = UCase(ComputerName) 'Convert HAL name to uppercase
robwords = (Split(Rsentence)) 'Split the words into array
If robwords(1) <> Robotname Then Exit Function
'If 1st word of user sentence is not HAL's name then the function exits.

The HAL program doesn't seem to mind if its name is always the first word of the sentence... but if it did, then we can simply strip out the first word of the sentence before processing the response.

Now that the speech recognition is sorted, I'll continue with interfacing HAL's response to control the ER1's API. If anyone is interested in this, I can post it on this forum.



Download Attachment: script.txt
1.13 KB

6
Ultra Hal 7.0 / How can i stop Hal talking to itself
« on: February 29, 2004, 07:45:25 pm »
Hello all
I've just activated Hal's speech and the voice recognition part of the program. I am using a desktop mic & speakers. After saying 'Hello' down the microphone, Hal responds with its witty reply. The mic also picks this up and Hal starts responding to itself.
This continues in an endless loop. Is there any way to stop this or adding a delay to the mic response? I know the easiest option is to use a headphone/mic but the idea was to eventually integrate Hal onto the ER1 robot and interact with it via the onboard mic.

Any info is much appreciated.
Kaf

Pages: [1]