DIY Remote Control XBee controller for Robotics... - RobotShop Forum

Putting robotics at your service™

Free shipping on orders over $75

DIY Remote Control XBee controller for Robotics...

Print view Share :
Previous topicNext topic

Page 5 of 35 [ 511 posts ]

1, 2, 3, 4, 5, 6, 7, 8 ... 35
User avatar
Guru ( offline )
Posts: 2969
Posted: 2009-10-18 17:26 
kurte wrote:
As for code running on Series 2 (2.5) chips, I believe that I need to make some changes, to make it work. May try later as I do have two of the Series 2 Pros sitting here.

I just got two of the Series 2.5 2mW XBee modules. Once I got them talking, I didn't need to do anything else since they are now just a wireless serial cable replacement. I've got one set up to be a Coordinator, and the other is setup to be a Router/End Device. I don't yet know if they will work if I reset the Coordinator to be a Router/End Device, so will have to check into that. The Pro XBees shouldn't need any more special setup than the regular modules, but we will have to find out for sure.

I have an idea for my own wireless robot controller using XBees. :)

8-Dale

_________________
I can usually handle complexity. It's the [b][i]simple[/i][/b] things that always confound me..
Check out my [url=http://www.hybotics.me]blog[/url] now!
Open your mind, Read, Learn, Think, Apply..


User avatar
Guru ( offline )
Posts: 9256
Posted: 2009-10-19 10:52 
zenta wrote:
Btw, did I see some robot feet (rubber end caps) on your joysticks? :o


We depleted all of Hitecs spare Laser 4 joystick assemblies. They sent me a couple with parts missing for the stick. We just added the rubber pieces to get one more DIY radio assembled. We used to install them onto our in house radios to ease the wear on the thumbs. lol

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


New ( offline )
Posts: 5
Posted: 2009-10-21 09:08 
Hi All,

Forgot to mention I was off to the Himalayas for a month (really). Nepal is surprisingly warm this time of year....but no robots...

I had some pretty basic code working at 9600 before i left, but its not very clever compared to kurte's and was just based on simple timed shots. Well done to kurte and all for the continued work.

The sparkfun carrier boards work just fine for those still thinking about it.

I ordered the parts for a display for my controller so will integrate that into the hardware. I dont like small displays so went for a OSD-232+ text overlay driver board by Intuitive Curcuits LLC (http://www.icircuits.com/store/index.html) running on a standard 7" TFT LCD automotive-type headrest screen. Entire setup about $150US. Havent fired it up yet, but if it is as good as i think it is, it will rock. Lets me overlay text and graphics on my video feed from the bot.

Will post some pics soon for those interested.


User avatar
Guru ( offline )
Posts: 9256
Posted: 2009-10-21 09:53 
rotorman wrote:
Will post some pics soon for those interested.


Sounds incredible. You might want to start your own thread for the project. I'm sure many will have lots of questions about it. Thanks for sharing!

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


User avatar
Guru ( offline )
Posts: 2133
Posted: 2009-10-23 11:41 
Hi Kurt,

I've got all my new robot parts now :P
I ended up ordering the XBEE's from Trossen. They was pretty easy to setup with X-CTU for setting baud, CH, DL, MY and ID.

But I'm wondering, did you try the XBEE together with Xan's v1.3 code? Or does the hserial mess up things. I've little exp with this part (interupts and communication). I'm just hoping to get a XBEE solution for my hexapods.

oh.. I've to get my kids to bed.. I'll try to study you code more before asking more Q's.

Thanks.

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
Zenta's YouTube channel
http://www.youtube.com/ZentaOlbaid
-----------------------------------------


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-23 12:30 
Hi Zenta,

I have not tried it yet with Xans code, but it is on my TODO list. However my first attempt may be with the Bap40 as I currently have it connected that way. :)

Yes HSERIAL can cause problems with other serial output functions, like serout. I wrote a timer assisted serout function that appears to work pretty well, but you can only pass it a buffer to output as I don't know how to integrate in all of the variable parameter lists. That function is currently in the transmitter file I posted up on this thread. I will need to verify that the TimerVs on both the 28 and 40 are compatible and need to factor in that the 40 is 25% faster... Such a problem :lol:

Likewise on the BAP40 there are two hardware serial ports, HSERIAL2 is on the same pins as HSERIAL is on BAP28 and HSERIAL on the 40 is on SIN/SOUT. So I could maybe make a simple cable to plug the serial port of the BAP into the SSC-32... But I will try other approaches first!

On my Bap40 version I modified the timer code to make sure that we do not output a new command to the SSC-32 until the previous command had a chance to complete, such that it no longer needed interrupts. That is you can use timerA with clock/8192 with overflow bit for 9th bit, which if I calculated properly is a little over 1/4th of a second, which I believe is plenty for the code we are timing.

Kurt


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-29 12:35 
It is hard to decide if to post here or on my other active thread Bap28 to Bap40, but ...

As I mentioned in the other thread, I have Xans 1.3 code compiling for both Bap28 and Bap40 for either PS2 or XBee: viewtopic.php?f=4&t=5542&start=22

As I ran into some issues with the Bap40 and HSERIN, I decided to try out the Bap28 on my Hex with XBee control. So far it looks like my hex code is working on the XBEE. I don't have all of the fancy stuff merged in from the PS2 code yet, like the stuff when you are holding the L1 or L2 button down, but I have it walking, rotating, one slider selecting the body height, selecting gaits and balance mode.

The code for this is up on the other thread. I don't think I have made any real changes to it since then. The code is using my own timer assisted serout functions to talk to the SSC-32, as we were concerned at serout being corrupted by the HSERIAL interrupt processing. Appears to work great at 38400 and works reasonably well at the 115200 baud rate although I notice a leg twitching from time to time, so I may need to do some tweaking.

I also have the E key on the remote go into the only send data when it changes mode which appears to work as well. It has the code in it to use the timer such that if the robot does not receive a notification of anything new in about a second it does a query anyway to make sure the remote is still there.

Will play more with this over the next few days, integrating the rest of the PS2 code into the XBee code, maybe playing with bidirectional stuff, like maybe pressing the "B" button on the remote, will display the battery level(s) on the robot on the DIY remotes display...

Kurt


Guru ( offline )
Posts: 4282
Posted: 2009-10-29 15:36 
Good progress Kurt! I'm going to have to get busy and get your Phoenix example running on my hexapod!

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


User avatar
Guru ( offline )
Posts: 2133
Posted: 2009-10-30 05:18 
kurte wrote:
It is hard to decide if to post here or on my other active thread Bap28 to Bap40, but ...

:lol: We just have to follow them both then! And thats fine for me.

kurte wrote:
The code is using my own timer assisted serout functions to talk to the SSC-32, as we were concerned at serout being corrupted by the HSERIAL interrupt processing. Appears to work great at 38400 and works reasonably well at the 115200 baud rate although I notice a leg twitching from time to time, so I may need to do some tweaking.

Sounds very promising! I hope you'll get rid of the twitching.

kurte wrote:
Will play more with this over the next few days, integrating the rest of the PS2 code into the XBee code, maybe playing with bidirectional stuff, like maybe pressing the "B" button on the remote, will display the battery level(s) on the robot on the DIY remotes display...


For all users of LiPo batteries that would be very useful! In addition there should be a sort of alarm on both the robot and DIY when the voltage are close to critical. A flashing screen on the DIY + alarm :twisted:

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
Zenta's YouTube channel
http://www.youtube.com/ZentaOlbaid
-----------------------------------------


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-11-04 02:08 
I have been doing some more playing around with the code and integrating it into newer version of phoenix code. Also having some fun.

I now have most of the functionality Integrated in to the phoenix (actually CHR-3) and it is working reasonably well, but it still needs some tweaking.

Today I played some more with the bidirectional communications. I added in the support of having the robot send strings back to the remote to be displayed. So now when I press the A key on the Remote, it ends up displaying "Walking" On the second line, likewise when you press the B key it displays "Body Translate", like when you press some of the other keys it Displays the newly selected Gate name on the Remote. For example when you press the "1" key it displays "Ripple 6", likewise the "2" key displays "Ripple 12" ... Tomorrow I may display which leg is being manipulated...

Over the next day or so, will work on smoothing over my integration on the Hex and then migrate all of the changes back over to my Brats. Also will work on the timer version of serout. May have it buffer up the outputs instead of having the interrupt code and main code so in lock step with each other. May may generate a Timer Serin... Then I will try kicking up the SSC-32 again to full speed.

That is all for now


User avatar
Guru ( offline )
Posts: 9256
Posted: 2009-11-04 10:32 
Gulp! :shock: Whoa!

Very nice!

Let me know what changes to the faceplate you would like. I will make you a new one. Good job!

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-11-04 12:29 
I know most won't find this interesting :oops: but I thought I would mention a few things that bit me yesterday coding wise yesterday, in case it might help out others not run into the same problems that I did.

I wanted a quick and dirty function that would simply take a pointer to the string to pass back to the DIY receiver. For most of these I make the strings using BYTETABLES. Also to make it easy to modify the strings later and not forget to update the count of bytes, I decided to put the byte count at the beginning of the string instead of a second parameter. So for example when I wanted to pass the "Walking" to the other side the code looked like:

Code:
_WALKMODE   bytetable   7,  "Walking"
...
gosub ControlOutputString[@_WALKMODE]


The control function grabbed the first byte from the pointer as the count and then incremented the pointer and then processed the string, by computing a checksum and sending the packet to the DIY.

Well next I wanted to do the different gaits. So first I defined the strings like above, but then I had an index number in the range 0-7

The strings looked like:
Code:
_GATENAME0         bytetable   8,    "Ripple 6"
_GATENAME1         bytetable   9,    "Ripple 12"
_GATENAME2         bytetable   12,   "Quadripple 9"
_GATENAME3         bytetable   8,    "Tripod 4"
_GATENAME4         bytetable   8,    "Tripod 6"
_GATENAME5         bytetable   8,    "Tripod 8"
_GATENAME6         bytetable   7,    "Wave 12"
_GATENAME7         bytetable   7,    "Wave 18"

I could have coded it with a bunch of if Gaittype= 0 then ... Output _GateName0, but I don't like that code. So next I tried to create some type of pointer table.
I was trying to do something like:
Code:
_GATENAMES POINTERTABLE @_GATENAME0, @_GATENAME1...

But Pointertable is not defined. I also tried LONGTABLE, but it complained about the @ was not a constant, although the generated address should be. I might be able to setup the table in assembly. May play with this later. Also I will ask Nathan (AcidTech) about this.

So I tried a different approach. That is set the pointer to the address of the first string, and then walk my way down the strings until I get the address of the one I want. That is if I want the address of the _GATENAME1, I grabbed the first byte that pointer is pointing to which was the count, then I added the count + 1 to the pointer and that should get me to the next string (I thought). It did not work so I converted to assembly language, which still does not work. After debugging this, I found out that, the above BYTETABLE entries does not generate the same bytes as:
Code:
_GATENAMES         bytetable   8,    "Ripple 6",|
                        9,    "Ripple 12",|
                        12,   "Quadripple 9",|
                        8,    "Tripod 4",|
                        8,    "Tripod 6",|
                        8,    "Tripod 8",|
                        7,    "Wave 12",|
                        7,    "Wave 18"

It turns out that the BYTETABLE may add an extra byte with a value of 0 to align things. So once my strings were converted into one bytetable it worked!

Again excuse this boring post :)
Kurt


Guru ( offline )
Posts: 4282
Posted: 2009-11-04 14:47 
There's your problem, BASIC!

Although I've ran into byte/word alignment problems in C as well. No

Code:
#Pragma align (0)
?

Glad you got it figured out.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Guru ( offline )
Posts: 2158
Posted: 2009-11-04 16:41 
Does it always add a 0 to the end or just sometimes? Is it possible it is just using a ASCIIZ format to represent the strings (like C does)?


Guru ( offline )
Posts: 2158
Posted: 2009-11-04 16:42 
Ah speaking of which, are you doing both ends (controller and robot) in BASIC?


1, 2, 3, 4, 5, 6, 7, 8 ... 35

cron
All times are UTC - 5 hours [ DST ]. It is currently 2018-04-26 21:08