Pages: [1]   Go Down
Author Topic: Sending Acceleromter Data Wirelessly  (Read 753 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

PROJECT AIM > To send accelerometer x,y,z axis data wirelessly to an arduino board where each axis data will control the movment of a separate motor.

Accelerometer X axis -->  transmitter --> receiver --> servo left
Acceleromater Y axis -->  transmitter --> receiver --> servo right
Accelerometer Z axis -->  transmitter --> receiver --> motor forward/reverse
 
Option 1 - is to use RF Tx/Rx Link Modules with Arduino boards.
Option 2 - is to us Xbee wireless modules with 1 or 2 arduino boards.

I have the following questions:

1) How do I make sure the correct data goes to the correct motor if im using the RF Link Modules? Theres only 1 data pin on the     transmitter so all the data will arrive at the receiver conjoined. If I use Xbee's, there seems to be a number of analog/digital pins for transmission i.e channels

2) Is there a need for two microcrontrollers for this type of project or do I just need one on the receivers side to control movment of the motors depending on what data is received?

thanks,
Carpark
















 
Logged

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

What, exactly, is the servo to do with the raw accelerometer data? The instantaneous rate of acceleration is of only fleeting interest.

Quote
Theres only 1 data pin on the     transmitter so all the data will arrive at the receiver conjoined.
So? The data might be something like <1:34 2:83 3:193> which the Arduino can then parse.

Quote
If I use Xbee's, there seems to be a number of analog/digital pins for transmission i.e channels
The analog and digital pins collect data that needs to be transmitted. The data is still transmitted in a packet on a single channel.

Quote
2) Is there a need for two microcrontrollers for this type of project or do I just need one on the receivers side to control movment of the motors depending on what data is received?
That would depend on the radio chosen. The XBee module has a microcontroller on board that can collect sensor, including accelerometer, data and transmit that.

Other, less expensive, transceivers do not have microcontrollers aboard, so you need to provide one.

You still need to deal with the accelerometer output on a microcontroller, and recognize exactly what an accelerometer is telling you (instantaneous rate of acceleration, not any kind of angular information).
Logged

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

Hi PaulS,

I appreciate the reply.

Quote
What, exactly, is the servo to do with the raw accelerometer data? The instantaneous rate of acceleration is of only fleeting interest.

The accelerometer will output raw data as follows for x,y,z axis when it is on a flat surface:
512  506  620
512  506  620
513  506  620
...

The servo will move steering left or right. The motor will cause forward/reverse motion. So depening on the changes detected on the x-axis, I want the servo motor to rotate a certain amount to the left, depening on the changes detected on the y-axis, I want the servo motor to rotate a certain amount to the right, and finally changes detected on the z-axis will cause either the motor to rotate clockwise/anticlockwise (forward/reverse). Should I be converting the raw data into something like voltage and then using this to control the movement of the different motors?

Quote
So? The data might be something like <1:34 2:83 3:193> which the Arduino can then parse.

I agree the Arduino can parse this data but how would I separate the x,y,z axis data? Would it be as easy as the 1st segment of the block will always be x-axis data, the 2nd will always be y-axis data and the 3rd always z-axis data and this sequence would repeat along the packet of data being received from the transmitter?

Quote
The analog and digital pins collect data that needs to be transmitted. The data is still transmitted in a packet on a single channel.

Ok, I had thought those pins would act as separate channels. So there is only 1tx and 1rx pin on the Xbee module. After looking at the Xbee data sheet again I can see what you mean.

Quote
Other, less expensive, transceivers do not have microcontrollers aboard, so you need to provide one

Is the reason for having to use a microcontroller on a less expensive transceiver to allow anologue to digital conversion of the accelerometer data received?

Quote
You still need to deal with the accelerometer output on a microcontroller, and recognize exactly what an accelerometer is telling you (instantaneous rate of acceleration, not any kind of angular information).

Ok, so are you saying when I receive the raw accelerometer data on the Tx side, I must process that data in some way before it is transmitted to the Rx side?

Thanks,

Parcark


Logged

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

Quote
So depening on the changes detected on the x-axis, I want the servo motor to rotate a certain amount to the left, depening on the changes detected on the y-axis, I want the servo motor to rotate a certain amount to the right
The assumption here is that changes to the x axis value are completely isolated from changes to the y axis value. I don't see this as a valid assumption. Laying on the table, maybe. Held in your hand, no.

Unless you are not referring to the same servo in both cases. In which case, never mind.

Still, assuming that the raw value corresponds to some meaningful servo position is not a valid assumption. I see no relationship whatsoever between the instantaneous rate of acceleration along one axis and the position of a servo.

As long as you don't care that there is no meaningful relationship, carry on.

Quote
Would it be as easy as the 1st segment of the block will always be x-axis data, the 2nd will always be y-axis data and the 3rd always z-axis data
I don't see why you need to assume anything. I explicitly define which value is which. The data could just as easily be sent in three packets (<1:34> <2:83> <3:193>) or in the same packet but in a different order (<1:34 3:193 2:83>) and the Arduino should be able to parse and interpret the data correctly.

Quote
Is the reason for having to use a microcontroller on a less expensive transceiver to allow anologue to digital conversion of the accelerometer data received?
That's one reason. The other is to actually operate the radio.

Quote
Ok, so are you saying when I receive the raw accelerometer data on the Tx side, I must process that data in some way before it is transmitted to the Rx side?
Maybe, maybe not. It depends on what you understand that the accelerometer is outputting (instantaneous rate of change of velocity) and what you are expecting to get (current orientation, for example).

If all you want is a number to position a servo, and there needs to be no correlation between that number and the servo position, then no processing of the number is required.

If, on the other hand, the purpose of moving the servo is to counter the motion of the accelerometer, then, yes some post processing of the raw data is going to be required.
Logged

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

Hi Paul,

Quote
The assumption here is that changes to the x axis value are completely isolated from changes to the y axis value. I don't see this as a valid assumption. Laying on the table, maybe. Held in your hand, no.

Unless you are not referring to the same servo in both cases. In which case, never mind.

Still, assuming that the raw value corresponds to some meaningful servo position is not a valid assumption. I see no relationship whatsoever between the instantaneous rate of acceleration along one axis and the position of a servo.

As long as you don't care that there is no meaningful relationship, carry on.

I see what your saying about the axis values not being isolated and yes the x and y axis refer to the same servo. So there will be various data being produced from the x, y axis which then will cause the servo motor to rotate left or right. I think I will need to create a relationship between axis values produced and servo position. Im not sure how I will go about this.

I have some other questions which you might be able to offer some guidance?

Let's say I am driving the RC car forward and want to turn left, so I tilt the accelerometer left. How soon should the car turn left in order to feel like a proper RC car?

So, when the accelerometer tilts left the y axis will go from 2.5V to 2.6V. The uController will register this as a left movement, by 0.1V. This has to be packetised, transmitted, received, depacketised and sent to the motor/servo. Lets say all of this has to happen within 500ms in order to feel realistic. So what do we need to consider. Where are the bottlenecks?  What are the workarounds?

The accelerometer outputs an analog voltage. This is input to the uController, converted to digital (ADC), processed (software), sent to transmitter, transmitted, received by receiver, sent to uController, processed (software), converted to analog or PWM (DAC) then sent to the motor/servo. What are typical times for each of these operations? How can they be measured? Which of these stages is the critical stage?

Thanks,

Ruaidhri
Logged

Pages: [1]   Go Up
Jump to: