Pages: [1]   Go Down
Author Topic: Xbee RC Control Protocol  (Read 1358 times)
0 Members and 1 Guest are viewing this topic.
Russia
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know that a lot of people have made projects with Arduino and Xbee’s to control their robots, cars, planes etc. I have been searching for a good example or answer to my question for many days, but I haven’t found yet.  I successfully configured 2 Xbee’s Series 1 so I have 2 Arduino Duemilanove talking to each other, or I can send messages from terminal programs using self-made adapter (max3232 chip) and Xbee.

The question is: Which is the best way of controlling motors/servos via serial interface? I worry a bit about loss of a control data when the object (mobile robot) is moving. I’m thinking about continuous stream of data that force robot to move and when the stream is interrupted robot must stop. Or something like handshaking with a special symbol or value( although I don’t understand how exactly it could help). Or some other ideas?

Any links, ideas, sample codes will be much appreciated.
Thanks in advance.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 650
Posts: 50838
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I worry a bit about loss of a control data when the object (mobile robot) is moving.
The stream of data need not be continuous. Simply record when there was serial input, and stop if the time since the last serial input exceeds your comfort margin.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Most RC receivers have what is called a 'Failsafe' feature.  What they do is when packets are not received, certain servo channels are moved to a 'safe' position.  Often the failsafe on an airplane just cuts the throttle to keep it from flying off into oblivion.

I think anything else may just be more effort than it's worth.
Logged

http://ilektron-x.blogspot.com - Hacking and General Electronics Goodness

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been doing a very similar thing with my QuadCopter project.  Basically, a pair of XBees talking to each other and a Joystick on my PC sending serial control commands.  I'm using the arduino messaging library to receive the simple control commands on the arduino.  Occasionally commands get missed - but these tend to be one-shot commands.  The joystick sends continous data when it is moved, so the odd missed message doesn't matter too much.
Logged

Russia
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been doing a very similar thing with my QuadCopter project.  Basically, a pair of XBees talking to each other and a Joystick on my PC sending serial control commands.  I'm using the arduino messaging library to receive the simple control commands on the arduino.  Occasionally commands get missed - but these tend to be one-shot commands.  The joystick sends continous data when it is moved, so the odd missed message doesn't matter too much.
That's exactly what I have been looking for! Could you, please, share with me a part of the project related to RC control?
Which one messaging library have you used? http://arduino.cc/playground/Code/Messenger That one or some other? Thank you for pointing me at messenger library it's seems that it is a good way to the solution.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, that's the library I've been using.

I just use simple one character commands eg: sending "m 1 1300\n" sets a PWM pulse of 1300 on motor 1 (speed controller 1).

I've written the client app in .NET and I'm using a DirectX .Net wrapper library (SlimDX http://slimdx.org/) to read the Joystick.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How about cutting out the PC?

http://ilektron-x.blogspot.com/search/label/joystick

If you have an old joystick laying around, or want to pick one up at a thrift store, you can use an xbee to interpret the joystick positions.
Logged

http://ilektron-x.blogspot.com - Hacking and General Electronics Goodness

Pages: [1]   Go Up
Jump to: