I`ve just got my MMA7260Q accelerometer sample thanks to Freescale. Using this accelerometer i want to make a position application. My question is if somebody had implemented a position algorithm using this kind of accelerometer and where can i find some tips ?
Thanks.
--
Alban edit: FSL Part number in message subject.
Message Edited by Alban on 2007-03-28 08:48 AM
Message Edited by rocco on 2007-03-2706:07 PM
Hi All,
When reading AN3397 I think I found some small mistakes. Please confirm.
Formula 1:
Area = Samplen-1 + [Samplen-Samplen-1]/2 (Total area of slice. A1 + A2)
No index on Area and no need T, because T=1 (For each slice there is A1 and A2)
Figure 3: Lacks of an axis indicating positive direction of t. Samplen-1 and Samplen should be interchanged if time-axis is from left to right.
In general the text is very good and will help me a lot (I´m sure).
thanx
As soon as I have tested MMA7620QT with MSP430 I will post my results.
Hi,
I tried to implement the formula found in http://www.freescale.com/files/sensors/doc/app_note/AN3397.pdf?fsrch=1 to measure displacement in 1 dimension, however apparently the result is way off compared to the actual distance.Here's what I did( I also noticed that the formula is slightly wrong);
velocity[1] = velocity[0] + acceleration[0]*T + ((acceleration[1] - acceleration[0] )/ 2)*T
and
position[1] = position[0] + velocity[0]*T + ((velocity[1] - velocity[0] )/ 2)*T
where T = 0.001s in my case.
can somone please verify me if I did the correct calculation here?
Thanks.
I might be a bit tired, but what is the error that people are talking about - is it the "absolute value" thing in formula 1 of the AN? I'd be inclined to think that you could forget about the T if it was constant, along the lines that if your acceleration was in m/s/s, but T was 1 ms, then the velocity would end up being in mm/s and position in micrometres - or something like that (I think?) They don't seem to worry about T in the AN, at least in the integration bit anyway.
Hi Arquimedes
Yes, formula is bit wrong. But area index is indeed required. Also T (sampling time) is in general case not equal 1. T should be as small as possible for better accuracy.
Area[n] = (Sample[n-1] + (Sample[n] - Sample[n-1])/2 ) * T
or
Area[n] = ( (Sample[n-1] + Sample[n])/2 ) * T ,
Area = sum of A[i]
Hi all,
the program to test ST evaluation board STEVAL-MKI006V1 is stopping responding after a time of use. My operational system is Windows Vista 64 bits (Laptop HP Pavilion dv6000 with 4GB of DDRII-RAM). Map browsing demo is out of control. Do I need to change registers values?
Hello,
You are unlikely to receive help on this forum concerning an evaluation board that uses a non-Freescale processor.
Regards,
Mac
Hi All,
I´m testing MMA7260QT accelerometer. My microcontroller is an MSP430F2274. I connect accelerometer to my microcontroller according schematic in AN3397. The code I used was derived from the source code in same AN (just added code for z-axis). I used P2.1, P2.2 and P2.3 in MSP430. The problem is that with the accelerometer in a fixed position (no-movement), there´s a big variation in x,y,z position. I expected to read values around zero in such situation. Below is my ADC_GetAllAxis routine
void ADC_GetAllAxis(void)
{
unsigned int delay;
ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE;
delay = 0x0100;
//X-Axis
ADC10AE0 |= 0x02; //P2.1 - A1 ADC input port
ADC10CTL0 &= ~ENC; //Disable conversion
while (ADC10CTL1 & BUSY); //Wait ADC10 to be ready
ADC10CTL0 |= ENC + ADC10SC; //Enable and start conversion
Sample_X = ADC10MEM; //Take converted value
while(--delay); //Wait
delay = 0x0100;
//Y-Axis
ADC10AE0 |= 0x04; //P2.2 - A2 ADC input port
ADC10CTL0 &= ~ENC;
while (ADC10CTL1 & BUSY);
ADC10CTL0 |= ENC + ADC10SC;
Sample_Y = ADC10MEM;
while(--delay);
delay = 0x0100;
//Z-Axis
ADC10AE0 |= 0x08; //P2.3 - A3 ADC input port
ADC10CTL0 &= ~ENC;
while (ADC10CTL1 & BUSY);
ADC10CTL0 |= ENC + ADC10SC;
Sample_Z= ADC10MEM;
while(--delay);
}
Hello,
Arquimedes wrote:The problem is that with the accelerometer in a fixed position (no-movement), there´s a big variation in x,y,z position. I expected to read values around zero in such situation.
My understanding is that the outputs from the accelerometer are biased to about one-half the supply rail voltage to operate at the centre of the linear output region. Each output will therefore swing positively and negatively about this point. This offset voltage must be taken into account for the ADC calculations.
The other factor is that, one or more axes, depending on the orientation of the accelerometer, will output a static voltage swing corresponding to its component of gravitational acceleration.
Regards,
Mac
I forgot to put ISR routine
__interrupt void ADC_ISR(void)
{
return;
}
ADC10_ISR(ADC_ISR)
Hello,
If you are attempting to detect the removal of equipment from a motor vehicle, perhaps you might utilize a potential change of tilt condition on the action of removal. This could be enhanced if the physical mounting would provide a "built in" tilt motion during installation and removal. The tilt would be detected by a change in the gravitational axis.
Changes of vehicle motion are tyically likely to be significantly less than 1g, and would be present for only short duration. Low pass filtering, or averaging of the results for each axis, should filter out vibration components.
Regards,
Mac
Hi Bigmac!
I´m not trying to detect the removal of my circuit from a motor. My equipment is collecting data and transmitting to a remote Data Collector (300 meters afar) that sends this information (encrypted) to our office via Web. Both the End Device and Access Point have accelerometers to detect the removal from its home position (could be an wall near the point of interest).In reality I think that accelerometers could be 2-axis. I received my ST eval board (LIS302DL) today and I´ll test it.My processor is Texas MSP430F2274.
Thank you
Arqui
I want to ask you what was the sensitivity of your accelerometer and what was it`s maximum rating?I used three of the Analog Devices ADXL105, which measure with 2mG sensitivity, up to 1G.
I tried to implement the algorithm found in the freescale AN3397 using a 3-axis 2g accelerometer LIS3L02AS4 from ST but it acts very strange, it gave accelerations only when the pcb starts moving and after that if I continued to move the pcb with a normal speed the acceleration was 0.Yes. That is exactly what you should be seeing. When the board is moving at a constant velocity, the acceleration is zero. However, your integration of acceleration would have given you the current velocity. As you integrate that current velocity (now constant), you will get a changing position. It's unlikely to be very accurate, though.
Another question: what can you tell me about hardware consideration between sensor and ADC?I needed a small amount of analog between the sensors and the DSP, mainly to trim the gain and offset, and convert to differential signals. I then used an audio ADC to sample at 24-bit resolution and 48kHz. I then did the bandwidth filters in DSP firmware. I used the DSP56002.
Message Edited by rocco on 2007-03-2812:33 AM