DIY Remote Control XBee controller for Robotics

That compiler error says you ran out of room. When I run into that I end up having to turn some debug stuff on and other things off. Other times I can fix things by changing messages. For example if you have turned on the debug for Enter/Leave messages, you can turn them off. Or if they still read something like: “Entering: XBeeReceivePacket” you can change them to: “E:XRP”. For every character you remove from a quoted string going to something like a serout, you save 4 bytes as they are pushed a 4 byte values…

Good Luck
Kurt

I wasn’t sure what it was looking for. Thanks

Kurt,
I just got back, my wife padded me down for electronics before we left. Even took the cell phone. I found the case I ordered when I got home. I’m taking it down to the local plastics place to see if he can cut it down. I retried the code and it found all my modules. :smiley: I was trying to complie the xbee brat code but got some errors. I must have done something.

Thanks again for the update

Phil

hi kurt,
I have a few questions i was hoping you could answer.

When selecting “Current MY:” It doesn’t display the current XBee that is selected. It seems to display the one that was manually saved previously. It doesnt update the “Current MY:” when a different XBee is selected using the “Current DL” or using select by name options
I’m i missing something here?

Cal Joysticks: No matter what I try i get *** ERROR *** is this functional?

Thanks
Phil

Hi Phil,

I have not played much with changing MY. It would not change this value if you choose a different DL either by direct input or by select by name. These two different things change the destination (DL). The My value is the logical number for the xbee within the transmitter. This value is sent as part of the packet to the other robots and they use that to know who to talk to.

As for the Cal joysticks, I have not tried this in awhile. It will give you this error, if it does not think you moved the joysticks to all of the Min/Max values. Ie, you are supposed to move both of the joysticks, all the way to the right, left, top, bottom. You can do this by going tot he diagonals, I usually did this by going up straight down/up/left/right as I wanted my values to have the full ranges from these locations and not depend on wiggling toward corners to get max or min values. I don’t remember off hand but I then think it wants you to leave the joysticks in the neutral location at the end to find the center points… Let me know if you want a description of what is going on here…

Kurt

Kurt,
So the “Current MY” is the one from the XBee attached to the DIY Transmitter? Not the one from the robot I’m connecting to.
Just what to make sure i got this right.

As for using the Cal joysticks, I have moved both sticks to the max extremes. what might be my problem is the one joystick
dosent auto center. could this be the cause?

Thanks
Phil

Yes: My is for the transmitter, not for the robot you are talking to.

Calibrate:
I forgot to mention you need to move the two sliders their full range as well…

Kurt

Kurt,
moving the sliders did the trick
Thanks
Phil

Kurt,
I think my DIY Transmitter is working. I’m not sure if Im really communicating with my board.
I loaded the ARC32-Phoenix on my arc32 but I’m not sure it’s talking
When I open the terminal i only get

but no response to any selection

As from the DIY I get

As normal I must of missed something. I have both XBee’s using 62500 Baud rate and i see the lights blinking

If you see the lights blinking on both xbees try hitting the 0 key on the keypad - It is the key that the phoenix code is looking for to do something…

The terminal monitor allows you to setup things. For example the T command allows you to decide how much debug information to see. For example if you hit return and it displays that prompt again, then type something like: T7
It will set the normal debug, plus verbose plus control. Now depending on which #define DEBUG… statements you can get lots of information. Things like what packets it is receiving or the like. Also information about how the gaits are being calculated…

Kurt

I tried selecting the ZERO key on the keypad. But then again, I’m not sure what i should see

Tell me about the blinking on the XBEES. Is it real slow like maybe once every few seconds, or is it faster than that. If you move the joysticks, does it start flashing fast? That would show that they are communicating…

Do you have a speaker plugged into the arc32 of your phoenix? I used a cheap un-amplified one from Radio shack(273-0092). If you have do and you have it plugged into IO pin P19 ( or whatever you change the value of cSound to in the _cfg.bas file… When you hit the 0 key it will play three notes going up it is turning on the robot or going down if it is turning off the robot.

All of the servos should go to the starting location of the gait, the height determined by left joystick (up /down). Then when you move the joysticks, it should try to walk or rotate… Of course all of this depends on if you have power supplied to your servos. That is the Arc32 has three sets of power connectors, do you have power going to all three? Do you have a separate switch to turn on/off the servo power? If so is it turned on. Running on the same battery as the logic? If so what is it…

Kurt

on the ARC32 only the DOUT once every few seconds
on the DIY DOUT and DIN once every few seconds
And no changes when moving any of the DIY controls

No i dont have a speaker connected I’ll pick one up on my way home
I had a few servos to the arc32 (PO4,5,8,9)6.0V power on S1 with 5V power to Logic battery on the arc32

If it is blinking only every second or so, than they are having some difficulty talking to each other.

I will have to take a closer look at how you have configured. Try on the DIY to set the MY to 0 by the keypad stuff. Sometimes to get communications to work, I have to turn on Phoenix, turn on DIY and sometimes then I have to turn phoenix off and then back on…

On the phoenix try turning on a bunch of debug tracing and set the trace to 7 as I mentioned and see what gets displayed.

Got to run.
Kurt

Hi kurt,
I placed a speaker on P19 I get a constant sound might be three notes but its always on
Tried using the T7 option. nothing happened. Question, Would using P36 (TXD2) P38 (RXD2) for the XBee have
and thing to do with some of the issues?

As first for sound, make sure you got a speaker and not a buzzer (I made that mistake earlier).

I use TXD2/RXD2 for my xbee on arc32s (or bap40s as well). The first thing I would check is that they are connected to right wires and not reversed.

I thought I would rebuild mine again and check out what is displayed, but it does not build right now on the IDE that AcidTech(Nathan) released yesterday. The compiler is complaining about an HSEROUT2 command. Not sure yet but maybe he changed the syntax of HSEROUT/HSEROUT2 like Dale of BM mentioned in a posting talking about the manual…

Need to investigate… reported on BM forum. Will try a couple of things and see… Like:
HSerout …] => HSerout 1, …]
HSerout 2…] -> HSerout 2, …]

Please note I am happy with these changes as it would imply that I could do something like:

#ifdef BASICATOMPRO28 HSB_XBEE con 1 #else HSB_XBEE con 2 #endif ... HSerout HSB_XBEE, "Goes to the right one"]

When I am not sure how well my XBEE is communicating with my board I usually do things like add some debug stuff, just to see, if I can get the easy things working… I have some basic building blocks in the code that would make it easy. I would try things like: in the function InitXBee (phoenix_control_diy-xbee.bas) I would add some code at the end of the function that maybe looked something like:

#ifdef DEBUG_XBEE
gosub APISetXBeeHexVal"D","L", wNewDL]
hserout "MY: ", hex wNewDL]
gosub APISetXBeeHexVal"D","L", wNewDL]
gosub APIGetXBeeStringVal"N","I", @_bNI, 20], _cbRead ; 
gosub APIGetXBeeHexVal"S","L",0x0], _lSNL		; get the serial low, don't enter or leave
gosub APIGetXBeeHexVal"S","H",0x2], _lSNH		; get the serial high, 
hserout "DL: ", hex wNewDL, "X._NI:  ", hex _lSNH, " ", hex _lSNL, "(", str _bNI\21\13,")", dec _cbRead, 13]
#endif

Note: I cut and pasted most of this code out of the area that handled a specific command, so some of these variables may not be defined now. You could easily change it to read each of the hex values into the same variable wNewDL and then output it before trying the next one. By doing this type of debug code, if the serial outputs look OK for the MY and the serial numbers and string (DL maybe 0 at this point), then you know that at least the XBEE and the Arc32 are communicating correctly.

Good Luck
Kurt

Kurt,
I just noticed that I’m not using the RTS wire. Do i need to connect it on the Phoniex_ARC32.
Your probably correct about using a buzzer I thought it was a speaker. looked just like the one
on the BOTII board. I’ll use the spearker i picked up that you mentioned

Phil

Nope, the RTS line was needed at times to make sure that we don’t screw up the bit bang serial being sent out to the SSC-32. But with the Arc32 we are not using an SSC-32 so it is not needed.

Kurt

kurt
just to make sure, I connected the speaker to P19 red to signal and black to ground and still had a constant chime :confused:
I think im connecting it correctly

I will try adding one again to my other Arc32 and make sure it works. It is hard to check my wiring on the phoenix as there is not much room…

Kurt