Timing Issues To Make Arduino RC Car Realistic

Hi,

Im building a RC car that can be controlled wirelessly. One Arduino on transmitter side and one on the receiver. Transmitter connected to accelerometer. I will either be using Xbee or RF link radio modules for radio control

Accelerometer tilts left the y axis will go from 2.5V to 2.6V >>> The Arduino will register this as a left movement by 0.1V >>>> input to Arduino >>>> converted to digital (ADC)>>>> processed (software) >>> packetised >>>> transmitted by Tx module >>>> received by Rx module >>>> processed (software) >>>> depacketised >>>> converted to analog or PWM (DAC)>>>> then sent to the motor/servo.

If I want all of this has to happen within 500ms in order to feel realistic:

What do I need to consider?
Where are the bottlenecks?
What are the workarounds?
How do I measure times of each stage?
Which is the most critical stage?

Thanks.

That 500ms is easy. It would take perhaps a few milliseconds.

If you use a RF link, it has to be reliable. The cheapest modules are not very reliable.

I think that measuring time is not needed. The main thing is the smoothing of the accelerometer. The accelerometer will have strong output changes for little vibrations. So you have to average or smooth it, and that will need a number of readings and will take some time.

You also need a driver module for the motor. And perhaps a DC-DC converter for the 5V of the servo.

The RC car has to stop if it is out of range. You could send keep-alive commands twice a second. If the RC car doesn't receive those anymore, it could stop.

That 500ms is easy. It would take perhaps a few milliseconds.

The RF data rate of the Xbee is 250Kbps.
The RF data rate of the RF link modules is 4.8Kbps.

Based on this and the fact that the Xbee is a more reliable method of radio transmission then to achieve a real life feel to the RC car I would want to use the Xbee module has my RF control.

I think that measuring time is not needed. The main thing is the smoothing of the accelerometer. The accelerometer will have strong output changes for little vibrations. So you have to average or smooth it, and that will need a number of readings and will take some time.

I see what you mean here, when the accelerometer moves it will be outputting values for x,y,z axis. I want values on x-axis to cause left rotation of servo, y-axis values cause right rotation of servo and z-axis causes forward or reverse of DC motor. I will need to do some sort of averaging as you suggest and then try to map these values to the servo rotations.

You also need a driver module for the motor. And perhaps a DC-DC converter for the 5V of the servo.

I was going to use a H-bridge driver for the DC motor for forward/reverse movement. I was going to use a separate power source for the servos and motors instead of powering off the arduino. Is this what you mean?

thanks for all the advice!

I was assuming that you use 5V servo motors.
If you do use 5V servo motors, the voltage regulator (on the Arduino board or an other voltage regulator) could get hot. A DC-DC converter would convert the voltage without loss, so your battery is will last longer.

parcark7:
Accelerometer tilts left the y axis will go from 2.5V to 2.6V >>> The Arduino will register this as a left movement by 0.1V

I'm not sure what sort of accelerometer you're going to use, but usually they only detect linear or rotational acceleration. There are ways to use linear acceleration to detect tilt but as far as I know they usually rely on the unit being stationary. Detecting tilt on a platform that is also being shaken around in three dimensions is quite hard to do without a gyro. And if you use a gyro they're prone to drift and unless you deal with that you'll find that after a while the 'upright' position will no longer register as the neutral position. If you rely on sensing rotational acceleration, that is also prone to drift.