Searching \ for '[EE] Weird MEMS accelerator behavior?' in subject line. ()
Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=weird+mems+accelerator
Search entire site for: 'Weird MEMS accelerator behavior?'.

Exact match. Not showing close matches.
'[EE] Weird MEMS accelerator behavior?'
2012\06\16@041106 by

Hi,

On a 3-axial accelerator I compute the magnitude by simple Pythagorean theorem
in 3D, i.e. Mag=sqrt(AccX*AccX+AccY*AccY+AccZ*AccZ)

It is an analogue accelerometer with significant RC filters between its 3 analog

Leaving the accelerometer stationary, whatever the inclination, I measure 1..0g
of course.

But in the presence of strong vibrations, I measure a mean magnitude of more than
2.0g!

Is this theoretically even possible, or should I bughunt it? If it's the filters,
then I thought that the vibration would cancel out thanks to them, was I wrong?

Cheers,
Mario

On 16 June 2012 09:10, Electron <electron2k4infinito.it> wrote:
>
> Hi,
>
> On a 3-axial accelerator I compute the magnitude by simple Pythagorean theorem
> in 3D, i.e. Mag=sqrt(AccX*AccX+AccY*AccY+AccZ*AccZ)
>
> It is an analogue accelerometer with significant RC filters between its 3 analog
> outputs and the PIC ADC.
>
> Leaving the accelerometer stationary, whatever the inclination, I measure 1.0g
> of course.
>
> But in the presence of strong vibrations, I measure a mean magnitude of more than
> 2.0g!
>
> Is this theoretically even possible, or should I bughunt it? If it's the filters,
> then I thought that the vibration would cancel out thanks to them, was I wrong?

Are you taking the mean before or after finding the magnitude? If
after then you will always get a positive mean. Think about it: the
magnitude of a positive and a negative acceleration will both be
positive and hence will not cancel.

If you take the mean beforehand I'm not sure what is going on to cause
such a large error.

All the best,
Brendan
-- Brendan Gillatt
http://www.brendangillatt.co.u

Won't time come into the equation. If I throw something in the air it
will have 1G accelleration beforehand, something greater than 1G while
I'm throwing it, 0G until it hits the ground and possibly many 10's
of G on contact. So over what period are you computing the mean?
Something subject to vibration may have very different positive and
negative peak G values, depending on mounting arrangements. And
computation based on sum of squares will bias the results toward the
higher values.

RP

On 16 June 2012 21:47, Brendan Gillatt <brendanbrendangillatt.co.uk> wrote:
{Quote hidden}

>

Brendan Gillatt wrote:
{Quote hidden}

Just to add some detail to Brendan's response: The squaring operation in the
magnitude calculation is functionally equivalent to a rectifier, in the sense
that whether the input signal is positive or negative, the output will be
positive.

Consider the simple case, where gravity is entirely on the Z axis and the X
and Y axes are zero. Vibration adds a signal to each axis, and any part of
this signal that makes it through the analog filters on X and Y can only add
to the overall magnitude.

Even taking the mean of each axis individually upstream of the magnitude
calculation is not going to be a perfect solution. The "mean" operation is
just another type of low-pass filter, a.k.a. "boxcar filter", a form of DSP,
and it is by no means a great filter either. Some of the vibration signal
will still get through.

And don't forget about aliasing issues: Any vibration signal components that
get through the analog filters and make it to the ADC that are at or near the
sampling frequency (or its multiples) will show up as low-frequency components
in the digital data that will be impossible to remove later.

By far, your best bet for good accuracy is to find a way to physically isolate
the accelerometer from the source of the vibration, e.g., using Sorbothane
mounting hardware. In other words, a mechanical low-pass filter.

-- Dave Twee

2012\06\16@093457 by
At 14.04 2012.06.16, you wrote:
{Quote hidden}

This is impossibile but I can take care of aliasing issues, and add very high
RC constant analog low-pass filters.

But if this alone won't be enough, I give up, as I cannot mount extra silent
blocks or other mechanical means.

I just tried with my Android phone, the vibrations increase the mean magnitude,
so it's not my device, it's physics.. I wonder if electronically or via DSP
methods the vibrations can be canceled out.

Using a magnetometer is impossibile, as the device is mounted on a steel frame.

Gyro's are expensive, and anyway I don't think they will help, as they need a
fixed reference, and the magnetometer can't be used (steel frame) while the
accelerometer suffers from the vibrations issue, as said.

NOTE: all I really need is to know the inclination of my vehicle (dirt bike)
but as I said the vibrations are extreme, and the mounting point can't be
chosen/changed (it's on the frame).

With kind regards,
Mario

>-- Dave Tweed
Quoting Electron <electron2k4infinito.it>:

Hi, e:-

Are you sure that your accelerometer is not clipping in any axis
under vibration + gravity conditions?

--sp

{Quote hidden}

>
Electron wrote:
> NOTE: all I really need is to know the inclination of my vehicle (dirt bike)
> but as I said the vibrations are extreme, and the mounting point can't be
> chosen/changed (it's on the frame).

I figured as much. But in that case, you really only care about the
orientation of the acceleration vector, not its magnitude, right?

Vibration will affect that calculation, too, but it should still be a usable
result. Or are you using the magnitude value to try to decide whether or not
the bike is moving?

-- Dave Twee
what about a second accelerometer, high pass filter, invert the output and apply a proportion of it to the original accelerometer signal like active noise cancelling.  There's a Microchip ap note or reference design about active noise cancelling in a dsPIC

or you might not need the second accelerometer, isolate the vibration frequency and apply the inverse...

Sounds easy but I bet it's not.

Trevor Hancoc
At 16.14 2012.06.16, you wrote:
>Electron wrote:
>> NOTE: all I really need is to know the inclination of my vehicle (dirt bike)
>> but as I said the vibrations are extreme, and the mounting point can't be
>> chosen/changed (it's on the frame).
>
>I figured as much. But in that case, you really only care about the
>orientation of the acceleration vector, not its magnitude, right?

Yes, and a gyro would be the answer, but the gyro alone wouldn't work, as it
still needs a fixed reference. I cannot use a magnetometer, because the device
is mounted on a steel frame. And the accelerometer cannot cope with the (HUGE!)
vibrations coming from the big bore two stroke engine.

I thought, since it's a vehicle after all, about slowly "drifting" the gyro to
assume that gravity is below, i.e. bends, accelerations, decelerations, hills
up and down will cancel out in the long period. But then again it wouldn't be
reliable, e.g. if one uses it on a ring circuit.

>Vibration will affect that calculation, too, but it should still be a usable
>result.

I thought that too, but the vibrations are huge (a few g's) and after solving
clipping issues (which by the way lowers the final resolution) and aliasing,
it still looks like those vibrations don't cancel out but, like a hammer, give
a contribute to raise the average magnitude.

It puzzles me how can this may even be theoretically possibile, it's probably
due to errors in the accelerometer, i.e. when the "hammer" hits, it quickly
integrates a lot of energy, but this energy is then released very slowly and
the low resolution of the accelerometer isn't able to integrate in the opposite
direction. I.e. maybe if it was a perfectly analogic, infinite resolution system,
vibrations would cancel out, but given their highly impulsive nature, on a real
system the errors are so big that it becomes unusable.

There's also the issue of aliasing: although I took care of it, it doesn't mean
that there aren't vibrations that escape the resonance frequency of the MEMS.

>Or are you using the magnitude value to try to decide whether or not
>the bike is moving?

My goal was to detect the lean angle of the bike, if it was on a hill, and how
fast it was accelerating or braking. Of course I expected to do it with large
errors, as gravity adds a lot of problems by itself (but I thought that anyway
the artificial forces would cause the magnitude to differ from 1.0g, so that
would have been of help). In the end, the vibrations predominate a lot over any
other force, including gravity. And I'm even talking about a non moving bike,
idling, when we add rocks, jumps, etc.. it would even go worse.

>
>-- Dave Tweed
>
At 15.58 2012.06.16, you wrote:
>Quoting Electron <electron2k4infinito.it>:
>
>
>Hi, e:-
>
>Are you sure that your accelerometer is not clipping in any axis
>under vibration + gravity conditions?

It was at first (+/- 1.5g) but then I've configured it to +/- 6.0g and
clipping wasn't a problem anymore, but the imbalance persisted. Low pass
filtering it (either digitally via a FIR filter or electronically via
RC network) only made things worse, i.e. the imbalance remained.

I even tried with my Samsung Galaxy and an accelerometer graph plot app,
the problem existed also there (and I assume they took care of aliasing
too).

Thinking of it, I realized that there's no guarantee that vibrations
will cancel out. These vibrations ultimately originate from the piston,
if you imagine it as a hammer, the peak they generate may well be e.g.
mostly positive, like a sinc() not like a sin() hence the contribution
to magnitude will not cancel out no matter how you filter it. Even using
a FIR filter didn't really help.

I'm guessing it's physics, i.e. to filter those vibrations out it would
be necessary some complex adaptative filter or AI algorithm.

Anyone else shares my thoughts? I never imagined it could end up like
this, but experimentally it really seems so now.

Cheers,
Mario

{Quote hidden}

>> -
At 01.35 2012.06.17, you wrote:
>what about a second accelerometer, high pass filter, invert the output
>and apply a proportion of it to the original accelerometer signal like
>active noise cancelling.  There's a Microchip ap note or reference
>design about active noise cancelling in a dsPIC
>
>or you might not need the second accelerometer, isolate the vibration
>frequency and apply the inverse...
>
>Sounds easy but I bet it's not.

Yes also because the MPU cannot really use much of its time in FFT filtering
(the frequency won't be fixed, as it's linked to the RPM of the engine), and
the frequency analysis I have made on the PC showed that it was a very complex
source of noise.

Considering that the sensor wasn't going to add much functionality (but it would
have been cool to have), I think I'll just give up for this battle.

>
>Trevor Hancock
>
It'd be interesting to take the thing for a ride on a bicycle
and see what happens..
On Sat, Jun 16, 2012 at 4:10 AM, Electron <electron2k4infinito.it> wrote:
> On a 3-axial accelerator I compute the magnitude by simple Pythagorean theorem
> in 3D, i.e. Mag=sqrt(AccX*AccX+AccY*AccY+AccZ*AccZ)
>
> It is an analogue accelerometer with significant RC filters between its 3 analog
> outputs and the PIC ADC.

What is the range of your AccX, AccY and AccZ values? What value gives
you zero g? What value gives you 1g?

If you are using A/D counts, 0 to 1023, then you need to use an
integer data type and subtract 512 so that for an acceleration of zero
you have an input of zero.
--
Martin K
You made your ECU so you know where you are in the combustion cycle - or you can monitor the spark,
so take your accelerometer samples mid stroke or wherever the least noise is in the stroke.

Also if your engine is a single cylinder 2 stroke or a 4 stroke twin at 10 000 rpm,
a processor running at 40 mips has 240 000 instructions per firing of the spark,
you will lose time (instruction cycles) because the power stroke has a duration,
maybe you could use that time to update a display or save a data point.

Trevor Hancock
{Quote hidden}

>> http://mailman.mit.edu/mailman/listinfo/piclis
At 02.37 2012.06.18, you wrote:
>On Sat, Jun 16, 2012 at 4:10 AM, Electron <electron2k4infinito.it> wrote:
>> On a 3-axial accelerator I compute the magnitude by simple
>Pythagorean theorem
>> in 3D, i.e. Mag=sqrt(AccX*AccX+AccY*AccY+AccZ*AccZ)
>>
>> It is an analogue accelerometer with significant RC filters between
>its 3 analog
>> outputs and the PIC ADC.
>
>What is the range of your AccX, AccY and AccZ values?

0..1023

>What value gives you zero g?

~512

>What value gives you 1g?

~573

Vibration biases this a lot, around +100 at low RPM and up to +200 at high RPM.

I talk about average, i.e. not only there's a lot of AC noise depending on RPM,
but also this DC bias component which I was surprised to find, illuding myself
that the heavy vibrations would have cancelled out anyway (i.e. no DC, wrong).

>If you are using A/D counts, 0 to 1023, then you need to use an
>integer data type and subtract 512 so that for an acceleration of zero
>you have an input of zero.

Of course.

So far my deductions (but I hope any of You prove me wrong) is that, simply,
MEM accelerometers aren't compatible with high vibration environments, unless
you find one with a lot of KHz bandwidth and do the filtration in software.

In other words, that vibrations (those coming from the piston of a single
cylinder big bore 2 stroke for example) cannot be cancelled e.g. via RC filters,
as this will introduce a DC bias.

With kind regards,
Mario

>--
>Martin K.
>
At 12.51 2012.06.18, you wrote:
>You made your ECU so you know where you are in the combustion cycle - or
>you can monitor the spark,
>so take your accelerometer samples mid stroke or wherever the least
>noise is in the stroke.

Yes, this is definitely something to experiment with, thanks.

>Also if your engine is a single cylinder 2 stroke or a 4 stroke twin at
>10 000 rpm,
>a processor running at 40 mips has 240 000 instructions per firing of
>the spark,
>you will lose time (instruction cycles) because the power stroke has a
>duration,
>maybe you could use that time to update a display or save a data point.

I can use timer interrupts. ;)

Cheers,
Mario

{Quote hidden}

>
On Mon, Jun 18, 2012 at 9:52 AM, Electron <electron2k4infinito.it> wrote:
>>What is the range of your AccX, AccY and AccZ values?
>
> 0..1023
>
>>What value gives you zero g?
>
> ~512
>
>
>>What value gives you 1g?
>
> ~573
>
> Vibration biases this a lot, around +100 at low RPM and up to +200 at high RPM.
>
> I talk about average, i.e. not only there's a lot of AC noise depending on RPM,
> but also this DC bias component which I was surprised to find, illuding myself
> that the heavy vibrations would have cancelled out anyway (i.e. no DC, wrong).

I am guessing that you are just seeing more vibration than your
accelerometers are designed to handle, which you are guessing
yourself.
You could mount them on a rubber isolator or get accelerometers that
will not saturate at your level of vibration.

-- Martin K
ML is correct.
If your mems sensors are hitting a physical limit, they will no longer
produce a correct average
due to clipping.

The typical solution to your problem is having an accelerometer with
sufficient dynamic range that it
does not clip, and low pass filter the heck out of it. Then use a rate gyro
Combine the two signals to get a noise free tilt signal. LPF accel+ HPF
gyro at same break point.
Given your extreme vibration, you will want to find a gryo with the lowest
acceleration induced errors.

See the 'composite filter' techniques used in the DIY Segway software.

Rober
Em 19/6/2012 15:06, Robert Rolf escreveu:
> ML is correct.
> If your mems sensors are hitting a physical limit, they will no longer
> produce a correct average
> due to clipping.
>
> The typical solution to your problem is having an accelerometer with
> sufficient dynamic range that it
> does not clip, and low pass filter the heck out of it. Then use a rate gyro
> to get your dynamic tilt.
> Combine the two signals to get a noise free tilt signal. LPF accel+ HPF
> gyro at same break point.
> Given your extreme vibration, you will want to find a gryo with the lowest
> acceleration induced errors.
>
> See the 'composite filter' techniques used in the DIY Segway software.
>
> Robert

I am sure the OP said he can't mechanically filter the signal. Why?
I think it is easy to stick the entire board to a heavy metal plate and
below them put a soft sponge pad. Is the application that space constrained?

Isaac
At 21.45 2012.06.19, you wrote:
{Quote hidden}

It has to be swapped with the original ECU, which is already (like mine) on
silent blocks (not so effective it seems), space is so tight I cannot use
neither 1mm (no joke, really) more than I already do, and to find the right
box already took me many weeks. :( Also, there's no way I can make it thinner,
to reach this "thinniness" (spelling? :D you see English is not my native
language ;) ) I had to work truly a lot, and my ECU is packed with a lot
of features and components, while the original was truly basic, so it was
already a huge effort (even using small LGA, Micro8 and 0403 components)
to pack all into the original space.

In answer to other messages, the accelerometer I'm using is +/- 6g on all
3 axis, I don't think it's clipping anymore (it was when it was +/- 2g ),
this board is potted on epoxy now, but next week I'll make another one
without the huge LP RC filter I made, and I will try to sample it very fast
and do a FIR filter or try again my favourite solution, i.e. one sample
per engine revolution, but (as Trevor suggested) synchronized to a certain
degree relative to the top dead centre, where maybe vibrations will cancel
out enough (hopefully). I know it's not only the piston or the crankshaft
which cause vibrations, there's the gearbox, the clutch, etc.. but it's
worth a try anyway, maybe the thing become usable.

Cheers,
Mario

>
>
>Isaac
>
>
> In answer to other messages, the accelerometer I'm using is +/- 6g on all
> 3 axis, I don't think it's clipping anymore (it was when it was +/- 2g ),

That's still pretty slim margin. Acceleration is deceptive.
Can you mount a temporary unit with more like a 20G range, to confirm
that you aren't seeing larger events?

I had a project where we were doing somewhat worse things to the PCBs,
but we were able to get the events DOWN to 2000G, with carefully
designed Norsorex dampers. We also had to pay careful attention to
mass distribution on the PCB so that we didn't flex much during those
events
At 22.04 2012.06.20, you wrote:
>> In answer to other messages, the accelerometer I'm using is +/- 6g on all
>> 3 axis, I don't think it's clipping anymore (it was when it was +/- 2g ),
>
>That's still pretty slim margin. Acceleration is deceptive.
>Can you mount a temporary unit with more like a 20G range, to confirm
>that you aren't seeing larger events?

I have some 10g accelerometers and I will mount them when I make new boards,
i.e. when the PCB manufacturer sends them (2 weeks? as I haven't sent the order
yet because I have to spend some days updating some other parts), the one I'm
this PCB by hand but with PTH components which need both sides soldered and
offer physical access only to the bottom side, it's a nightmare (to solder the
connector for example I had to bend all the pins to gain access to the top side,
then re-bend each, and so on. With the cap the height was 1mm too high and I had
to invent other things to overcome the lack of PTH, the board was generally not
easily solderable, etc.. a nightmare when you try to make a professional (0403
components, QFN, etc..) PTH prototype board by hand).

>I had a project where we were doing somewhat worse things to the PCBs,
>but we were able to get the events DOWN to 2000G, with carefully
>designed Norsorex dampers. We also had to pay careful attention to
>mass distribution on the PCB so that we didn't flex much during those
>events.

The original ECU alredy used silent blocks (just thick rubber washers), and
that's what I'm using too. I wonder if there's some better way to damp the
vibrations, but I cannot use any extra mm of space than the original uses,
and it's mounted on a small plate which flexes. A question: what is more
rigid, a 1mm thick plane of aluminium or steel? Is there any rigid material
which will damp vibrations? Or is it even a contraddiction in terms?

>
I haven't been following this thread carefully, but understand that your
average is not working out.

Have you taken the unit in your hand and shaken it all about and then
returned it to its original location *and* kept the orientation of the unit
the same during that motion?

If you integrate the x, y and z accelerations independently, you will get
x,y,z velocities and if you integrate the velocities you get x,y,z
displacements.  Do those make sense?  If not, you likely have a problem with
your algorithm.  Hand motion should be << 6G.  There are different ways to
do numerical integration, some more accurate than others.  For short periods
something close to zero.

If you want to provide some isolation for your accelerometer you need to
find a soft flexible material that will allow movement in all axis.
Clamping a circuit board with a rubber washer with a screw is not going to
cut it.  Try some *small* pieces of thick double sided foam tape.  This
won't remove the higher frequencies, just attenuate them like an electronic
filter.

Gordon Williams

{Original Message removed}
Can you sample your accelerometer data with your 20G sensor and then look
at it with
a sound editor so you can scroll through the data set easily (Audigy is
free OSS).
You could then also do a FFT on the signal at a constant motor RPM and see
if the
cylinder firing rate is the dominant noise source or something else.
You really need to look at your signal to see why it isn't filtering as you
expect.

3M makes a noise damping tape that you might be able to fit on one side of
your mounting plate. It is 0.15 mm thick but works amazingly well to damp
HF ringing
of metal.  A 2 x 6" steel plate going from 'ping' with long ring tone, to
'thunk' with just
a 1" square of tape applied.

I think you actually want the LEAST stiff mounting plate so that you damp
out
the high frequency components coupled in from the mounting holes.

I think you will find that if you want good frequency response to tilt,
you'll need
to go with a composite (accel + gyro) solution.

Dear Robert,

At 22.11 2012.06.21, you wrote:
{Quote hidden}

Found it, thanks:
http://multimedia.3m.com/mws/mediawebserver?mwsId=SSSSSu7zK1fslxtU4x_1mx_Gev7qe17zHvTSevTSeSSSSSS--&fn=436.pdf

>I think you actually want the LEAST stiff mounting plate so that you damp
>out the high frequency components coupled in from the mounting holes.

All right.

>I think you will find that if you want good frequency response to tilt,
>you'll need to go with a composite (accel + gyro) solution.

Would ~ 3Hz still make a gyro necessary in Your opinion?

Thanks a lot.

Mario

>
>R
>
> >Can you sample your accelerometer data with your 20G sensor and then
> >look at it with a sound editor so you can scroll through the data set
> >easily (Audigy is free OSS).
> >You could then also do a FFT on the signal at a constant motor RPM and
> >see if the cylinder firing rate is the dominant noise source or
> >something else.
> >You really need to look at your signal to see why it isn't filtering as
> >you expect.
> >
> >3M makes a noise damping tape that you might be able to fit on one side
> >of your mounting plate. It is 0.15 mm thick but works amazingly well to
> >damp HF ringing of metal.  A 2 x 6" steel plate going from 'ping' with
> >long ring tone, to 'thunk' with just a 1" square of tape applied.

Are you sure that the electronics box isn't moving far enough on its flexible mounting that it hits the frame on big bumps?
-- Scanned by iCritical.
At 11.31 2012.06.22, you wrote:
>> >Can you sample your accelerometer data with your 20G sensor and then
>> >look at it with a sound editor so you can scroll through the data set
>> >easily (Audigy is free OSS).
>> >You could then also do a FFT on the signal at a constant motor RPM and
>> >see if the cylinder firing rate is the dominant noise source or
>> >something else.
>> >You really need to look at your signal to see why it isn't filtering as
>> >you expect.
>> >
>> >3M makes a noise damping tape that you might be able to fit on one side
>> >of your mounting plate. It is 0.15 mm thick but works amazingly well to
>> >damp HF ringing of metal.  A 2 x 6" steel plate going from 'ping' with
>> >long ring tone, to 'thunk' with just a 1" square of tape applied.
>
>Are you sure that the electronics box isn't moving far enough on its
>flexible mounting that it hits the frame on big bumps?

It's moving (vibrating) but not enough to collide with the frame.

Anyhow the bumps aren't causing this (they would worsen the problem though),
as I'm in this situation even just revving with the gearbox in neutral..

Now I have to buy and try with the vibration damper tape (between the ECU and
the mounting plate, which then is attached to the bike's frame through 2 rubber
washers), higher g's accel, different RC constant, DSP.. I will be busy a bit. :D

Cheers,
Mario
> Now I have to buy and try with the vibration damper tape (between the ECU and the
> mounting plate, which then is attached to the bike's frame through 2 rubber
> washers), higher g's accel, different RC constant, DSP.. I will be busy a bit. :D

OK, I wonder if the rubber washers are just too hard, and end up transmitting the vibration to the box.
Is there a metal tube through the middle of the washer so you don't over compress it when tightening the screw?
-- Scanned by iCritical.
At 15.05 2012.06.22, you wrote:
>> Now I have to buy and try with the vibration damper tape (between
>the ECU and the
>> mounting plate, which then is attached to the bike's frame through 2 rubber
>> washers), higher g's accel, different RC constant, DSP.. I will be
>busy a bit. :D
>
>OK, I wonder if the rubber washers are just too hard, and end up
>transmitting the vibration to the box.
>
>Is there a metal tube through the middle of the washer

Yes, attached to the frame.

>so you don't over compress it when tightening the screw?

So I don't have to tighten them too tight? :D

>--
>Scanned by iCritical.
>
>
> >Is there a metal tube through the middle of the washer
>
> Yes, attached to the frame.
>
>
> >so you don't over compress it when tightening the screw?
>
> So I don't have to tighten them too tight? :D

If there is a metal tube, then it doesn't matter high tight you do the screw, it won't over compress the washer and effectively take up all the resilience that should be giving the vibration isolation.

But I wonder if you could use a softer washer to act as a more effective high-stop filter (yes I know that is a low pass filter, but the action you want is high-stop).
-- Scanned by iCritical.
The vibrations may be hitting a resonance in the PCB or the
accelerometer itself

More... (looser matching)
- Last day of these posts
- In 2012 , 2013 only
- Today
- New search...