Running A Robotics Contest with XBEE..Please help!
Kevin Pace
Posts: 7
I have been running a robotics competition for the last 4 years and we have been using the PROP with the XBEE PRO 802.15.4 Modules. In the past few years the contest has not had a large number of bots....Maybe 60 or so. This year we expect about 200 Robots in attendance. Although we have a system that is working...Its far from perfect and Im looking for some advice from some of you that have a lot more experience than I do with the XBEE modules and the PROP. I have talked with the tech support at Digi for quite some time and have continued to improve communication with the XBEES but I'm not sure we have exhausted all avenues.
The biggest issue we have right now is erratic behavior. One person will be driving their robot and it will start doing bizarre things and the driver loses contro of the robot. This happens frequently and is concerning for those who are driving!
Here are the settings we have programmed the XBEE modules with:
* We are spreading the Channels out. We are using all 12 channels and putting a standard number of robots on a single channel. Around 16 Robots on a single channel.
* We are using a 4 digit PAN ID for each PAIR of xbees. (We have an xbee as a transmitter and one as a receiver coupled on both sides with a Propeller.)
* There are at least two digits that are different in each PAN ID. An example would be one pair with # 2015 and another pair with # 2026
* We are using a PS2 Controller for robot control.
* The DL and MY values for each pair are opposite numbers . On a transmitter we might have a DL of 5968 and a MY of 5967 They would be reversed on the Receiver.
* On the level 1 robots we are using a POWER LEVEL of "0" because they only have to transmit across an 8 foot span.
* On the level 2 robots we have a power level of 4 because they have to operate about 40 feet away.
* We are running at a baud rate of 9600 (This matches the baud rate of the PS2 Controller)
Accordng to DIGI these are the main settings that we can control. We are using the XCTU program to program the software and I have made the latest FIRMWARE updates on each module pair. (Currently 10ED)
Are there any advantages to running the xbees in another configuration mode?
Since we have a PROPELLER on the transmit and receive side would it be possible to write some PROP CODE that could determine whether data is coming from the correct xbee and tell a servo or DC motor etc to GO or STOP based upon that directive?
I have attached the code we are currently using on the TRANSMITTER and RECEIVER. Along with the objects we are also using.
We have a great deal invested in the XBEE and PROPELLER and we feel confident we can work out these bugs with help from those of you much smarter than I am!
Thanks for any support you can give.
(I only ask this because DIGI has told me that I have ALL the settings correct and that we shouldnt be getting wild behavior)
The biggest issue we have right now is erratic behavior. One person will be driving their robot and it will start doing bizarre things and the driver loses contro of the robot. This happens frequently and is concerning for those who are driving!
Here are the settings we have programmed the XBEE modules with:
* We are spreading the Channels out. We are using all 12 channels and putting a standard number of robots on a single channel. Around 16 Robots on a single channel.
* We are using a 4 digit PAN ID for each PAIR of xbees. (We have an xbee as a transmitter and one as a receiver coupled on both sides with a Propeller.)
* There are at least two digits that are different in each PAN ID. An example would be one pair with # 2015 and another pair with # 2026
* We are using a PS2 Controller for robot control.
* The DL and MY values for each pair are opposite numbers . On a transmitter we might have a DL of 5968 and a MY of 5967 They would be reversed on the Receiver.
* On the level 1 robots we are using a POWER LEVEL of "0" because they only have to transmit across an 8 foot span.
* On the level 2 robots we have a power level of 4 because they have to operate about 40 feet away.
* We are running at a baud rate of 9600 (This matches the baud rate of the PS2 Controller)
Accordng to DIGI these are the main settings that we can control. We are using the XCTU program to program the software and I have made the latest FIRMWARE updates on each module pair. (Currently 10ED)
Are there any advantages to running the xbees in another configuration mode?
Since we have a PROPELLER on the transmit and receive side would it be possible to write some PROP CODE that could determine whether data is coming from the correct xbee and tell a servo or DC motor etc to GO or STOP based upon that directive?
I have attached the code we are currently using on the TRANSMITTER and RECEIVER. Along with the objects we are also using.
We have a great deal invested in the XBEE and PROPELLER and we feel confident we can work out these bugs with help from those of you much smarter than I am!
Thanks for any support you can give.
(I only ask this because DIGI has told me that I have ALL the settings correct and that we shouldnt be getting wild behavior)
Comments
I would think that a faster transmission rate would help. I run mine at 115K in an effort to reduce to a minimum any lag. It should not make any difference what the speed of the PS2 controller is since it communicates directly with the Propeller.
-Phil
From my own use of the XBees, it sounds like you're doing everything according to the instructions. I would suspect you are seeing some anomalies just due to the amount of RF happening on relatively close frequencies. And, just like trying to herd cats, you may also have a few "rogue" operators firing up their systems with their own ideas of what the radio parameters should be.
From a security-of-operation point of view, you would normally not depend solely on the radios for the security of the data getting to the right place. The data itself should be able to tell the receiving end processor that it is meant for that receiver. That can be a simple inclusion of an identifier character the transmitter adds to the data string and the receiver checks for.
Similarly, a simple check-sum added to the data stream can help check for garbled data strings and shut the system down if data comms are lost or not making sense. With Props available, you can add those features easily with no additional negative effect on operation.
Due to other constraints, my current system is not on Parallax equipment, but is BASIC and I can provide details if you PM me.
Cheers,
I even did a test where I had three robots in a small area programmed as listed above and I cut on the Transmitter and receiver of each but did not touch any of the controls on any robot. I just let them sit as if they were waiting for data to be sent to them. After a few minutes, we will often see a robot arm or dirve motors just make erratic motions. In order to gain control of all the robots when the transmitters and receivers are started the ANALOG button on the PS2 controller must be pressed. If the analog button is NOT pressed once the Transmitter and receiver are on any motors connected to Prop ports just take off and run. When the ANALOG button is pressed, the motors stop moving and are ready to be controlled. The erratic response I get from multiple robots on the same channels remind me of when the analog button is off...BUT its still on when the erratic motion occurs. I have LED's connected to the TX and RX lines on the xbees and I see no dropout of communication when this occurs. I have been thinking that there might be a way of preventing the motor movement by writing some code that looks only for a specific xbee signal and if it doesnt get that signal, motors dont move. I am currently using this command "repeat until xbee.rx == "!" and if I use every character available I have around 90 possible characters that I can use instead of an Exclamation point. I'm running some tests with this application to see if this helps. However, Im not a great programmer so Im sure a skilled programmer could look at my code and might find some issues that could be causing the action im getting. I hope this helps clarify the problem. Thanks for any help you can provide.