Xbee Prop help.
VbGuru
Posts: 35
I have a homemade remote and a rover that I am trying to get to work with the Xbee modules. I have the code working that controls the motors using the code at the object exchange. I also have the servos working with some code from there as well for my pan/tilt. I cannot seem to get the Xbee modules to pass data between them though. Currently I want to send four variables to the rover. Nothing fancy. When I have everything hooked up nothing is ever received by the rover Xbee. I have the serial terminal running and it shows that the variables Im sending out are not empty. I have attached my code.
R-Code = Rover Code
R-Controller = Rover Controller
Any thoughts?
R-Code = Rover Code
R-Controller = Rover Controller
Any thoughts?
Comments
--have you gotten the XBee demos to work?
--which type of XBees are you using (802.15.4 or zigbee)?
--any special configuration settings in XCTU or elsewhere?
In your receiver program one thing that jumps out is the condition,
Better I think to use RxCheck to get the two in sync.:
I don't think that is the problem though, not receiving anything. Best to try a stripped down program with XBees only until the wiring and configuration checks out.
Thanks for the quick reply. I have two series 1 Xbee's. I cut all the code down to just the xbee object and the fullduplex. I have Xbee1 send the "!", then send "200", and after a two second wait repeat. Xbee2 is setup the same except that it is waiting for the Dec. I threw in a pst "terminal is working" to make sure that the serial terminal is working and it does indeed print that when i start it up. the only thing i have done to the Xbee modules since i used them last (about a year ago with my BS2) was to update the firmware last week sometime.
I also made the change in the receive where it waits for the delimiter to start.
Should i be running the receive code in its own cog? I
Thanks for the feedback!
Mat
It is a good idea to check the XBee settings with X-CTU. Return them to the defaults with both MY and DL addresses set to zero. There are a lot of settings that could mess things up. Maybe your previous project left them with incompatible settings? You can also change the settings programmatically using the XBee_object, but I did not see any of that in your code. Please post the code. Recheck the wiring!
I assume you want "base station" to "rover" communication of data, and not rover-to-rover comms. Is that correct?
p.s. You cannot run XBee modules in full-duplex mode. One transmits and the other receives. A module cannot transmit and receive at the same time.--Jon
Sorry for the long delay in getting back in touch with this. I did get it all working. I took everything off of everything and re-wired it all. I still need to do something with my power sources but that i will come with the next revision. I am also interested in making a dead-mans switch so if it looses the signal from the controller it will just stop (right now it stops about 10% of the time), any ideas how i can implement that?
So far:
I had to change how i controlled my pan and tilt though... i had the pan and tilt directly connected to the value of the joystick. If you pushed the joystick halfway to the left then the camera panned halfway to the left. This turned out to be too jittery and i had to change it so the joystick just gave the servo a value that was the speed to move at in the given direction. I have a few videos i took. I have been working hard on it since them but font have an updated video yet.
http://www.youtube.com/watch?v=xPDT9aWC0qw&list=PLBG76VnJE54IQh5PoTmgcP5CjLzmIPTkX
Thank you all for your helpful feed back.
Mathew
I, too, have a rover project using Props (and XBees when the code is worked out) in the works but much more to do. My rover is bigger and uses power chair motors, Sabertooth 2x25 and two 12V SLA batteries. I had to go with continuous rotation servos from ServoCity for the pan and tilt since I wanted to allow my camera to stay pointed in one direction instead of snapping back to the neutral (strait ahead) position when I let go of the joystick. It still uses RC-format PWM signals. I have it all working with a Futaba/FrSky combo for now while I complete the mechanical components.
I'd appreciate seeing you latest code to see how it's structured. It might help get my code moving forward again.
falcon
My next base for a rover will be a lot bigger and probably similar in size to yours. I still like track and other then a tri-star wheel system its my first choice for mobility. I have a link that might interest you if you want to do a tracked vehicle. it covers several home made designs and their pro's and con's.
http://www.rctankcombat.com/articles/track-systems/
I have attached the code for my rover and for my remote. My remote does all the grunt work and the rover just accepts the values and applies them to the correct variables. The code that i have attached for the remote is a fresh build from tonight. It has the camera pan / tilt and proportional motor control. This build has the code setup so that the camera on the rover is now properly mapped to the right joystick (ie. when you push left it pans left, the old one was inverted for R/L). This code is also set up so that the joystick moves the camera when the joystick is moved and is no longer setup for the camera to be attached to the joystick location (it was neat but too hard to control and jittery as heck). I would think that it would be much harder to do this pan/tilt with continuous rotation servo's as there would not be a way to tell when you have gone too far. with non-modified servos they have a stop point and you just setup for center to be point dead ahead. Also you dont have to worry about winding your wires up and tearing them loose with a regular servo.
A large portion of my code uses object that other people made (such as the motor, servo control and the xbee handling). Mostly what i have is just a single cog that tells them what to do and passes variable between. there isnt much else other then a some code to set limits on vales (such a servo max rotation) there is also two small chunks of code that invert one track control as well as the L/R pan. this is so that they are going the correct direction.
cheers!
Also check my youtube link over the next few days.. I have one new video thats getting uploaded and I am leaving right now to go film another that will show how far my range is now that my remote has a 60mW Xbee in it.
I'd love to build a tracked robot using a snowblower but I can't find the parts here in the Mid-South. I do cruise the Minnesota Craig's list adds from time to time hoping to see a snowblower carcass that would be reasonable to ship.
I am using a ServoCity Pan http://www.servocity.com/html/spg785a_top_mount.html and TIlt http://www.servocity.com/html/spt400_tilt_system.html Both use the continuous rotation servos. They move while the joystick is displaced from center, and stop when the joystick is released. I, too, had problems trying to hold the joystick still.
I use a slipring http://www.ebay.com/itm/300Rpm-Capsule-Compact-Tiny-Slip-Ring-12-Circuits-12-5mm-2A-240V-Test-Equipment-/321101098230?pt=LH_DefaultDomain_0&hash=item4ac31decf6 between the tilt servo/camera assembly and the platform it sits on. I pass the three tilt servos wires, camera power, video, audio and RS-485 for zoom control through the slipring. It happily rotates endlessly without having to worry about the wires. I was apprehensive about the quality of the video suffering from the slipring but it is rock solid. See the slipring wires that will connect to the camera in this pic:
Future improvements include an RC Helicopter stability gyro to give my tilt servo/camera assembly some compensation similar to what full size tanks have on their barrels when the tank traverses rough terrain.
For a larger rover, you might be interested in the Kangaroo X2 by Dimension Engineering http://www.dimensionengineering.com/products/kangaroo An easy way to integrate encoder feedback, and works with differential steering arrangements.
I appreciate the code. It's always useful to see how others approach a silmilar goal.
falcon
might be a bit off the topic (maybe not)...
I found a website that might interest you. Its all about unusual locomotion.
http://www.unusuallocomotion.com/
Cheers