Help - Search - Members - Calendar
Full Version: Robotics And The Gp2x, Is It Possible?
GP32X.com - GP32 GP2X Pandora The Wiz - open source entertainment > GP2X > General talk [GP2X]
gsx82
Hello all, I picked up a gp2x about 2 weeks ago and this thing is bloody sweet, I'm very impressed with this system all around. I and building a robo-one clone with on-chip artificial inteligence via a BX-24 microcontroller and various sensors . It is not yet complete, about 50% done but slowly it is coming together. What I want to do is read and write data from the gp2x to my robot via a serial connection. I have written a program in C and compiled it on my linux box to read serial data(real time senror readings) from the robot's microcontroller and it works great. Now, I wonder if I can just cross-compile that program to run on the ARM architecture and run it on the gp2x? I would also need a direct serial connection from the gp2x to my robot, is there a premade one that I can buy online? Right now my program only reads data from the robot to gather sensor positioning but in the future I will have two way communication to fully control the robot from the gp2x. I should be able to do things like view sensor logs,real-time acceleration and tilt reading, movement commands, pattern scripting and maybe remote control the robot from the joystick and buttons, but that would be alot more complex as I would have to deal with writting code to grab the input from the gp2x buttons and joystick. Anyway, if anyone has any tips that would make this quicker and less painful that would be awesome.

Here is a link to some pictures of my robot
The picture quality sucks and it's going to be slow, the pictures are hosted on my web server and I don't have a super-high speed internet connection.

Thanks
wipeout2000
Very impressive work. I think what you might be thinking of is the J-tag cable, but I'm not sure. You might want to look it up.
gsx82
Well, I looked up the j-tag cable and it seems that it is not the interface I need. I need a direct serial cable from the gp2x to my robots microcontroller which is a standard rs-232 interface. I see that Toyz4Boyz did sell what I am looking for but no longer sell these cables, that sucks. I also found this link which shows how to build a serial cable, so it looks like that is what I will be doing. It looks like the gp2x serial output vlotage is 3.3v, I will check the documentation on my microcontroller and see if it will work with 3.3v and not standard 12v, then maybe I don't need to use the MAX3232 chip to change the voltage.

I looked up the specs on my microcontrollers serial port and this is what it says:

A high speed 5 volt serial port is provided for connection to modems, PC's, terminals, or other controllers. A hex inverter(tc7wh04) inverts the serial signals coming to and from the processors serial port. The hex inverter is also used to isloate the processors 5v serial port from the higher voltage levels (tyipically +-12v) present on standard PC serial ports.

By the looks of this I think I might be able to directly link the gp2x to my robot without any extra circuitry but I can't be sure until I test it out.

Feeg
Perhaps you want something like a USB to Serial converter?

Google found me this:
http://www.mrgadget.com.au/catalog/targus-...able-p-477.html

But I guess then you'll need to adjust your code to work with USB output intead of a serial port. Haven't done any of that sort of programming before, so I'm not sure how complicated it is.

Awesome robot, by the way. Please keep us posted with your progress. smile.gif
Squidge
Every microcontroller I've used is either 3.3V or 5V for the RS232 connection, and so can be used almost interchangably without any need for a max232.

www.artaylor.co.uk used to sell serial cables, but ever since he moved house, he's stopped selling them too.

All I think you need really though is a ext connector and a bit of cable - where your going to source a single connector from is another story however.
Dzz
QUOTE(gsx82 @ Jun 7 2006, 02:22 PM) *

Well, I looked up the j-tag cable and it seems that it is not the interface I need. I need a direct serial cable from the gp2x to my robots microcontroller which is a standard rs-232 interface. I see that Toyz4Boyz did sell what I am looking for but no longer sell these cables, that sucks. I also found this link which shows how to build a serial cable, so it looks like that is what I will be doing. It looks like the gp2x serial output vlotage is 3.3v, I will check the documentation on my microcontroller and see if it will work with 3.3v and not standard 12v, then maybe I don't need to use the MAX3232 chip to change the voltage.

This cable works well as a starting point:

http://cgi.ebay.com/OEM-Samsung-e720-e810-...1QQcmdZViewItem
gsx82
Squidge I think you are right about serial signals on the microcontoller and being able to directly connect without any additional circuitry and IC's. The problem like you said is finding an ext connector for the gp2x, so I think my best choice is going with the samsung cable that Dzz seggested. That way I can use it on my PC for debugging gp2x apps and for my robot project aswell. Sweet, thanks alot guys.

Update:

I just installed the devkit on my linux box and compiled a test program and it worked perfect. I don't think I will have a problem porting my robot controller program over to the gp2x. I think I will use the gp2x CPU to do some AI work while it is connected, to take some stress off the BX-24 microcontroller CPU and to save much needed RAM . The gp2x cpu is a hell of alot faster than the BX-24 CPU and I will not be limited to the 400 bytes of RAM the BX-24 has. This way I can write sloppy code and get away with it.
whiskthecat
I sure hope you have a digicam to post up some pics of this thing tongue.gif .
gsx82
QUOTE(whiskthecat @ Jun 7 2006, 11:37 PM) *

I sure hope you have a digicam to post up some pics of this thing tongue.gif .


I do have a digital camera but it sucks, it takes really crummy pictures, I posted some of the pics on my website here but you probably already saw those. I will get my girlfrieds nikon camera and I will take some good pics. Eventually I will put together a small webpage with lots of pics and go through how I built it. The robot still needs alot of work and I still need to build legs for it and do alot of coding to get it walking. I am also having problems getting it to run off batteries, but I should have that worked out soon. Pictures don't do this thing justice you need to see it in motion, I will make some short videos of it in motion being controlled by the gp2x when I get that up and running.
nubie
You are welcome for my sweet Samsung cable Idea smile.gif.

I like the bot so far (not the head, personal preference), Are you just using PC Blanking plates for mounting the servos?

Not a bad Idea smile.gif.

What are you going for exactly? Will the GP2X fit inside/on the back?
linoleum13
Woah...i dont know if we should help this guyor soon we might all be saying:
"I for one welcome our new GP2X controlled robot overlords"
wipeout2000
Yea that thing looks way too much like the Terminator robots...
gsx82
Yea, I was kinda going for the Terminator look, the head is a chrome shift knob from an auto shop. nubie, that samsug cable hack is very cool and it seems like its the the best option for me. I did use pc case slot covers to make the brackets for the servos. I didn't think of mounting the gp2x on the robot but now you sparked my intrest. I am going to use the gp2x to read sensor logs, send and recieve commads. I will also write a program on the gp2x to take the sensor reading and create a virutal map of the area, so it can learn its surroundings. I have a sharp distance sensor mounted on the front of the bot so it will know if objects are in front of it and at what exact distance. I also have an accelerometer connected to the bot to get acceleration and tilt readings. I want all that sensor data displayed on the gp2x screen real time, I thought it would be cool. In the future I would like to add voice recognition hardware and write a really detailed program with a 3d wireframe model of my robot running on the gp2x that would show the robots movements realtime. Thats all a long way off from where I'm at right now, but I can wish.

I can't seem to find a samsung serial cable on ebay that will ship to Canada. Oh well, I will keep looking.. Thanks guys.
DaveC
I always though it would be cool to have kind of an environmental capability to a robot. Sensors for temperature, humidity, barometric pressure compared to light level and time via real time clock could actually be used by the bot to tell you the weather or if a storm is approaching (by changes in pressure, temp etc) . It could just rattle out data via voice synth too. Just another means that the robot could be "aware" of the real world.


I have been looking for a viable robot platform for awhile. If I had the right "brains" I would cad up a body and have the frame lasercut for a real high tech bot. I would really like something with voice rec, and speech synth but that gets kind out of the range of a homebrew bot. It would have to be low power so that it could remain on "standby" awaiting a command for days before a re-charge. I haven't found anything good yet so I gave up on the idea awhile ago.
cbox
google the model number and samsung + usb cable and i'm sure you'll find a canadian store, last time I did that a few showed up in the results
gsx82
I would like to build a really pro robot too, with nice brackets instead of my hacked body out of old computer parts. They sell professional servo brackets but they are like $15us each and when you have like 15 to 20 servos that gets expensive. You can get hardware audio chips that can store pre-recorded audio fairly cheap these days that would be perfect for a talking robot. You can also get voice recognition chips cheap that are desined to integrate with a microcontroller. I think the only other sensor to go on my robot will be a sensor to detect light levels so my bot knows when to turn on its light. As far as getting the bot to run in standby that is definalty possible as long as all the servos are powered down, and the BX-24 has a low power cpu sleep function. With my robot it will come out of sleep mode when motion is detected within 80cm via the proximity sensor but if I decide to go with voice recognition I could get it to wake up on voice command too, which I think would be a little cooler.

What do you guys think I should do with this robot? Build legs and get it walking or start on voice recognition and speech because the cost would be about the same either way.

I know this is getting off topic and not about the gp2x so let me know if this is frowned upon.
hitbyambulance
well, it is related to the capabilities of the GP2x in this field, which hasn't been touched upon yet... so it would be more than OK, i think. i'd like to get more into robotics myself... (tho i did nearly flunk out of the PIC assembly language class i took... : /
saboteur
I think your robot should be able to play on a GP2X smile.gif

I've gat a GP2X serial cable lying around somewhere - if I can find it do u want it ??

Cheers
ste_167
Too right it's possible, here's my prototype:

IPB Image
Robster
Hi gsx82,

Nice job on the robot! It looks really impressive.

You can't just connect the BX-24 serial port to the GP2X serial port, because the BX-24 is 5V and the GP2X is 3.3V. You may well damage the GP2X by connecting them directly.

Unfortunately, level shifting 5V - 3.3V is a pain! You either need to clamp the 5V signal (see my GP32 JTAG page for an example) or else you need a level-shifting buffer. The 74LVC family is pretty good for this, as it runs on 3.3V but has 5V-tolerant inputs and outputs. I've used the 74LVC541 buffer, it works well.

Also good to hear that you've got some code working on the GP2X. From all you've written, you sound pretty capable so I'm sure you'll get a good result! Please do come back and tell us how you got on biggrin.gif
DaveC
QUOTE(gsx82 @ Jun 8 2006, 06:02 AM) *

I would like to build a really pro robot too, with nice brackets instead of my hacked body out of old computer parts. They sell professional servo brackets but they are like $15us each and when you have like 15 to 20 servos that gets expensive. You can get hardware audio chips that can store pre-recorded audio fairly cheap these days that would be perfect for a talking robot. You can also get voice recognition chips cheap that are desined to integrate with a microcontroller. I think the only other sensor to go on my robot will be a sensor to detect light levels so my bot knows when to turn on its light. As far as getting the bot to run in standby that is definalty possible as long as all the servos are powered down, and the BX-24 has a low power cpu sleep function. With my robot it will come out of sleep mode when motion is detected within 80cm via the proximity sensor but if I decide to go with voice recognition I could get it to wake up on voice command too, which I think would be a little cooler.

What do you guys think I should do with this robot? Build legs and get it walking or start on voice recognition and speech because the cost would be about the same either way.

I know this is getting off topic and not about the gp2x so let me know if this is frowned upon.


Walking is *very* hard to do, very power hungry and not too good at moving over different surfaces unless done with alot of sensors, gyros etc.

It is much more cost effective, power efficient, less CPU intensive, and simpler to just use wheels or treads for movement.
nubie
QUOTE(Robster @ Jun 8 2006, 07:09 AM) *

You can't just connect the BX-24 serial port to the GP2X serial port, because the BX-24 is 5V and the GP2X is 3.3V. You may well damage the GP2X by connecting them directly.

Unfortunately, level shifting 5V - 3.3V is a pain! You either need to clamp the 5V signal (see my GP32 JTAG page for an example) or else you need a level-shifting buffer. The 74LVC family is pretty good for this, as it runs on 3.3V but has 5V-tolerant inputs and outputs. I've used the 74LVC541 buffer, it works well.


If he gets ahold of the Samsung e810 cable won't that level-shifter do?

It is working fine for the 12volt to 3 volt level-shifting now. It also happens to be one of the cheapest sources for a EXT connector with all the pins biggrin.gif.

@gsx82, for speech won't the thing that reads you text files in the archive work fine?

Also, since we are using the GP2X, and it is all set for audio input, couldn't you just hack the software and see if you could make the EXT or Headphone jack a Mic input??

Look at it the same way as the 6-channel sound cards where the input and output are switchable, like mic-in becomes Rear-out in software.

I haven't investigated what audio chip they are using, but even if it is incompatible a simple hardware hack might allow a mic, it would be nice if GPH had put a mic in, or at least if the option to use the EXT or Headphone audio as an input is a workable idea.

@DaveC, just CAD up the bot, and have it display on the screen, CAD your desk too, then just use a 3D engine to display the bot, from a programming aspect it is entirely the same, just inputs and outputs, if they wind up rendered on the GP2X in 3d is no concern to your program.

The cost would be time and not money that way, and the speech and recognition features you desire might be possible.

Or to simplify it starting out it could be an animated smiley face to talk to you (or the MCP face from Tron, watch the extra features on how they animated the talking on the 20th anniversary DVD, it would be awesom to have an MCP talking face on the screen!!)

@gsx82, it might be really cool to use the GP2X as the head, it should be really light if you take the batteries out and power it off the robot battery pack smile.gif.

An Idea for walking and a battery pack might be to steal the legs from that lame robosapien that dances around.

Get a broken one on ebay and investigate the legs, pare them down until they are unrecognizable (just remove the ugly plastic to suit), or design your own around the idea, the batteries are in the soles of the feet.

Even new at $80-$100 it isn't such a bad price for legs with a power supply.

For brackets, once your design is finalized have your own brackets made from CNC bent and laser-cut stock, if they are all pretty much the same design and there are 20 of them the price will be quite low, something like $70 set-up fee and then a low price apiece for a high-yield if it is as simple as 1 bend the price would be like $10 apiece(including set-up) when you build it, or you could set-up a group buy and get the prices even lower.

see http://www.protocase.com/, they even throw in a free CAD program to design and calculate the price of what you want, and they could laser cut a neat logo into each one to personalize your bot smile.gif.
DaveC
QUOTE(nubie @ Jun 8 2006, 05:25 PM) *

[
@gsx82, for speech won't the thing that reads you text files in the archive work fine?

@DaveC, just CAD up the bot, and have it display on the screen, CAD your desk too, then just use a 3D engine to display the bot, from a programming aspect it is entirely the same, just inputs and outputs, if they wind up rendered on the GP2X in 3d is no concern to your program.

An Idea for walking and a battery pack might be to steal the legs from that lame robosapien that dances around.




There are many text-to speech programs/chips out there, I would bet it wouldn't be too hard to interface with the GP2X.

Not sure what you mean by CAD up the bot, desk, 3D engine etc. I was talking about CADing out the robot frame itself where components mount to etc. It would be entirely different that the one in the pics. I envision more of an R2D2, or HERO 2000 with arm type form factor.

Have you seen the robosapiens walk? It basically just shuffles around. Not very good and wouldn't be very mobile unless on a perfectly flat surface . Wheels/treads for the win. Legs are ok for toys but not practical. It depends what you are going for I guess. If you are going for the cool factor ok, but not as practical.

There are robot kits available based on PC architecture but are not practical due to power requirements. A bot running off of a pentium PC with windows and spinning HDDs etc are just too piggy and power hungry. Those can't run even in sleep mode for more than a 3-4 hours.

A bot based off of a GP2X with everything solid state (SD cards) is much more practiacal. Kounch already has a power saver sleep mode utility for the GP2X so that is already done.

Voice rec can be done well if you don't try too much. Don't expect it to understand long casual english sentences and act on it. Something more tree based is practical. For example:

You would say "robot" to activate. Robot says "yes" (indicating ready for input)

Then you would say "guard" (robot could be set to confirm "did you say guard?" you would give yes/no answer) Robot would go into the guard routeens etc. Then you could say "stop" robot would then abandon current routeen and go back to root.

Using simple one-word commands and tree structure to filter out word possibilities you could get real good performance without alot of CPU power. By the way this type of voice rec technique was used on a robot in the 80's that ran off of an 8-bit Z80 and it worked very well.






Robster
Hi nubie,

No, the Samsung E810 level shifter won't do, because it's also an inverter. Logic-level serial comms has +5V (or +3.3V) for "1" and 0V for "0". RS-232 as used by the PC has -12V for "1" and +12V for "0" (actually, in general anything above +2V is taken as "0" and anything below about 1V is taken as "1"). As you can see, it's all screwed up smile.gif
gsx82
saboteur - Sure I will take the cable from you, just let me know what you want for it and what shipping to Canada would be, is it the samsung cable?

I am quite positive that the samsung cable hack that nubie created will work perfect for my project. Correct me if I'm wrong but what the samsung cable does is convert the serial 3.3v from the gp2x to standard RS-232 12v that can be connected to any PC. If thats the case, the BX-24 has a hex inverter that will isolate the BX-24's 5v serial levels from the 12v levels present on standard PC's. I have the BX-24 connected to my PC(+-12volt) right now and it communicates just fine.

DaveC - Check out this site, this is what I am going for but of course my bot will have a brain and not just do preprogrammed movements. I hear what you are saying about using wheels or treads, but legs are so cool. Using the gp2x as the main brain of my bot probebaly will not happen due to its size. It would be cool if I built a bigger bot and used the gp2x as the bots face like Cain off Robocop 2. That would also make a much smarter bot due to the power of the gp2x cuz I could have a much larger program, the BX-24 has only 400 bytes of RAM and the CPU runs @ 50MHZ. I would also be able to use C instead of the crippled version of basic that runs on the BX-24. I could use the BX-24 for low level motor movements and sensor reading and use the gp2x to do all the AI. Wow I just love this little handheld, the possibilities are limitless.

Yea, I think that the text to speech program for the gp2x would work well for a bot, I tried the program once but it only read back the filename to me.
nubie
QUOTE(Robster @ Jun 8 2006, 12:53 PM) *

Hi nubie,

No, the Samsung E810 level shifter won't do, because it's also an inverter. Logic-level serial comms has +5V (or +3.3V) for "1" and 0V for "0". RS-232 as used by the PC has -12V for "1" and +12V for "0" (actually, in general anything above +2V is taken as "0" and anything below about 1V is taken as "1"). As you can see, it's all screwed up smile.gif


Oh, how odd.

What does the GP2X put out? I am going to assume +3 and -3 volts, what is the Logic-level serial for?

And is it possible the chip will understand it and work anyway? I.E. all it knows is high and low, low is translated to correct voltage and vice versa with high voltage, or does it only trigger when crossing 0 volts?

I guess I am a little foggy in this whole area, I have never had the money to build a bot myself sad.gif, or play with electronics much.
BradN
Just use two of the inverters in a chain. You don't need one for the output from the GP2X, just the input. 5V UARTs usually accept 3.3V fine.
DaveC
QUOTE(gsx82 @ Jun 9 2006, 01:49 AM) *


DaveC - Check out this site, this is what I am going for but of course my bot will have a brain and not just do preprogrammed movements. I hear what you are saying about using wheels or treads, but legs are so cool. Using the gp2x as the main brain of my bot probebaly will not happen due to its size. It would be cool if I built a bigger bot and used the gp2x as the bots face like Cain off Robocop 2. That would also make a much smarter bot due to the power of the gp2x cuz I could have a much larger program, the BX-24 has only 400 bytes of RAM and the CPU runs @ 50MHZ. I would also be able to use C instead of the crippled version of basic that runs on the BX-24. I could use the BX-24 for low level motor movements and sensor reading and use the gp2x to do all the AI. Wow I just love this little handheld, the possibilities are limitless.

Yea, I think that the text to speech program for the gp2x would work well for a bot, I tried the program once but it only read back the filename to me.



Well yeah the Gp2X would be a bit large for a bot with legs because of the weights. I guess we have different visions for a bot that we would want. You seem to want a buffed up Robosapiens with the kewl factor, I seem to be going toward a more practical appliance with actual uses like these http://www.whiteboxrobotics.com/ . The only problem with those is they use power sucking inefficient windows PC architecture giving them abysmal battery life. With my model you could use the GP2X as with treads etc it would be larger and more power efficient. Maybe eventually you could make two types. One a more toylike humanoid type, the other a practical "utility droid" I would do it but since I can't program a byte, I am out..
gsx82
I'm new to the whole homebrew handheld scene so I hope I am not asking lame questions. Does the GP32 run linux too or a custom os from gph? I looked it up and I guess it does not run linux from the factory but it can run linux. Has anyone here tried linux on the gp32 and does anyone know if it can run a bash shell? The gp32 is probably less expensive than the gp2x and would be perfect for modding into a robot if it can run linux at a decent speed on it. There must also be a serial port on the gp32 as well right?

It looks like I am getting a samsung cable from saboteur, thanks alot dude.
TheMinder
If you are using the gp2x to do the controlling why not use it to do the speaking as well ? A dirty fudge would be to just use the headphone socket of the 2x as you are already connected to the robot by wire

One of the projects in my head (that may never get realised now seeing as the screen of my 2x is shattered) was a speech program to help people with aphasia/dyspraxia etc

Basically you could set up a simple menu system with nouns/verbs etc and use them to construct sentences etc

you don't even need to record them yourselves as you can use eg http://public.research.att.com/~ttsweb/tts/demo.php to do the words for you

Just a thought
Peter R
QUOTE(gsx82 @ Jun 9 2006, 08:45 AM) *

I'm new to the whole homebrew handheld scene so I hope I am not asking lame questions. Does the GP32 run linux too or a custom os from gph? I looked it up and I guess it does not run linux from the factory but it can run linux. Has anyone here tried linux on the gp32 and does anyone know if it can run a bash shell? The gp32 is probably less expensive than the gp2x and would be perfect for modding into a robot if it can run linux at a decent speed on it. There must also be a serial port on the gp32 as well right?

It looks like I am getting a samsung cable from saboteur, thanks alot dude.

GP32 Linux was incomplete and horribly slow. I dont know if this still works.
ste_167
Yes, you do! You checked, saw that the site had gone but still linked! Come on.. tell the truth! tongue.gif
Peter R
Nope, I checked after I linked actually!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.