Author Topic: Pitch Roll gauge project.  (Read 8041 times)

0 Members and 1 Guest are viewing this topic.

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Pitch Roll gauge project.
« on: November 30, 2015, 11:19:02 pm »
I want to make an old school pitch roll gauage like the mid 80's Toyota Tercels had, but use a micro and a solid state accelerometer to determine pitch and roll state.  The update rate for the unit would be 5 to 10 times per second.  I have not used a solid state accelerometer before.   There seem to be a multitude of choices.  Can anyone give a recommendation on good chip for a project like this?

Bobby
 

Offline jmaja

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Pitch Roll gauge project.
« Reply #1 on: December 01, 2015, 11:20:10 am »
Accelerometers use obviously acceleration for calculating the pitch and roll angles. Thus they are prone to vibration and accelerations not due to gravity. It is not a good idea to update at 5-10 Hz, since you need quite much damping anyway.

You can use any chip you like to get similar accuracy as the old Tercel had. There are plenty of options. Just pick one with the bus and power options you prefer and with a reasonable range (say +-2 g).

You could also use a gyro and try to limit the problem with vibration and other accelerations, but then it gets quite more complicated and also you need good quality chip to do it well.
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17769
  • Country: 00
Re: Pitch Roll gauge project.
« Reply #2 on: December 01, 2015, 11:44:39 am »
I want to make an old school pitch roll gauage like the mid 80's Toyota Tercels had, but use a micro and a solid state accelerometer to determine pitch and roll state.  The update rate for the unit would be 5 to 10 times per second.  I have not used a solid state accelerometer before.   There seem to be a multitude of choices.  Can anyone give a recommendation on good chip for a project like this?

For measuring a huge force like gravity?

None are 'better', all of them are perfectly capable of that.

 

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Re: Pitch Roll gauge project.
« Reply #3 on: December 01, 2015, 02:24:51 pm »

For measuring a huge force like gravity?


None are 'better', all of them are perfectly capable of that.

No.  I want to display the angle of tilt and roll that a 4x4 might experience as it runs an off road trail.  The old Toyota's had a mechanical tilt / roll display that used a pendulum. I want to replace the pendulum with a sensor and a micro controller.  I did not phrase my request as well as I could have.  I have found a number of these chips, but I was wanting recommendations / opinions on ones that folks here have used and been happy with.

Bobby

 

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Re: Pitch Roll gauge project.
« Reply #4 on: December 01, 2015, 02:28:20 pm »
Accelerometers use obviously acceleration for calculating the pitch and roll angles. Thus they are prone to vibration and accelerations not due to gravity. It is not a good idea to update at 5-10 Hz, since you need quite much damping anyway.

You can use any chip you like to get similar accuracy as the old Tercel had. There are plenty of options. Just pick one with the bus and power options you prefer and with a reasonable range (say +-2 g).

You could also use a gyro and try to limit the problem with vibration and other accelerations, but then it gets quite more complicated and also you need good quality chip to do it well.

Thank you for the tips.

Bobby
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Pitch Roll gauge project.
« Reply #5 on: December 01, 2015, 04:13:10 pm »
As jmaja mentioned, accelerometers alone do not make great tilt sensors.  They measure acceleration, all acceleration.  When the only acceleration present is that due to gravity, you can measure the tilt angle easily, just some basic trig.  The problem is when other accelerations come into play, like hitting a bump while driving, or turning, or hitting the gas or brake, or hitting something else.  All of these external forces will screw up the tilt angle you calculate if you only use acceleration to derive it.

For that reason most IMUs pair the 3-axis accelerometer with a 3-axis gyroscope.  The gyro measures rotation rates, so it's not susceptible to lateral acceleration.  You can't just use the gyro alone either though, since you're integrating rotation rates to calculate angle, any offset will lead to drifting.  You need to use both, the gyro for short term noise rejection and the accelerometer for long term stability.

Some pretty advanced Kalman filtering usually goes into this calculation.
« Last Edit: December 01, 2015, 04:19:59 pm by suicidaleggroll »
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17769
  • Country: 00
Re: Pitch Roll gauge project.
« Reply #6 on: December 01, 2015, 08:30:28 pm »
I have found a number of these chips, but I was wanting recommendations / opinions on ones that folks here have used and been happy with.

And the reply is that they're all pretty much the same at this level.

I'd get one that only has accelerometer. If you get one with gyros and stuff it will be more complicated to program.

The most popular device on eBay seems to be the ADXL345. I've used ADXL345s, they work. If they're popular on eBay that usually means there will be a lot of web pages on how to use them.
« Last Edit: December 01, 2015, 08:58:16 pm by Fungus »
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17769
  • Country: 00
Re: Pitch Roll gauge project.
« Reply #7 on: December 01, 2015, 08:52:20 pm »
As jmaja mentioned, accelerometers alone do not make great tilt sensors.  They measure acceleration, all acceleration.  When the only acceleration present is that due to gravity, you can measure the tilt angle easily, just some basic trig.  The problem is when other accelerations come into play, like hitting a bump while driving, or turning, or hitting the gas or brake, or hitting something else.  All of these external forces will screw up the tilt angle you calculate if you only use acceleration to derive it.
I think the update rate needed for a visual indicator will be low enough that this isn't a problem. These dials are used to see how steep a hill is. A lot of the time the car will be moving very slowly (or even stopped) when you're looking at the dial.

Just take the average over the last few seconds and you'll be fine.

For that reason most IMUs pair the 3-axis accelerometer with a 3-axis gyroscope.

The math needed to cancel out bumps will be horrible. I wouldn't even attempt it based on personal experiences with gyros (I hate them).

And it might not even make much difference. 'Bumps' are mostly linear and gyros won't help with that.
« Last Edit: December 01, 2015, 09:00:04 pm by Fungus »
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4357
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Pitch Roll gauge project.
« Reply #8 on: December 01, 2015, 08:57:30 pm »
If you're designing a PCB with an accelerometer, and plan to solder it by hand, then be careful. MEMS accelerometers are very easy to overheat and damage, and I've wrecked quite a few this way. Consider using a pre-assembled module with the accelerometer already mounted; it could save a lot of frustration.

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17769
  • Country: 00
Re: Pitch Roll gauge project.
« Reply #9 on: December 01, 2015, 09:02:31 pm »
Just a thought: As well as an angle indicator you could put in a red warning light for when the car is near the limits. Most of the time that's all the information you need and you won't have to look down at a dial to see it.

 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Pitch Roll gauge project.
« Reply #10 on: December 01, 2015, 09:49:07 pm »
For that reason most IMUs pair the 3-axis accelerometer with a 3-axis gyroscope.

The math needed to cancel out bumps will be horrible. I wouldn't even attempt it based on personal experiences with gyros (I hate them).

And it might not even make much difference. 'Bumps' are mostly linear and gyros won't help with that.
That's the point.  Bumps and other lateral accelerations affect accelerometers, they don't affect gyros, which is why you use the gyro to correct the accelerometer measurements in the short term (or use the accelerometer to discipline the gyro in the long term, however you want to look at it).

I've used gyros and accelerometers plenty of times in the past, and I have no issues with gyros at all.  You pretty much need them if you want any kind of accuracy in your orientation measurement while moving.  While theoretically an accelerometer could work while stationary, the vibration in the cab of the truck will probably throw so much noise into the orientation measurement that it's not useful without a gyro to smooth things out.

Maybe it would be acceptable though, that's for the OP to decide.  Either way I'd suggest getting a gyro/accel pair and building the software around the accel part of it for now (ignoring the gyro).  If it's acceptable, you can ignore the gyro and you wasted a dollar on the more expensive part.  If it's unacceptable, then modify your software to combine the two measurements to smooth things out.
« Last Edit: December 01, 2015, 09:55:32 pm by suicidaleggroll »
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 932
  • Country: us
Re: Pitch Roll gauge project.
« Reply #11 on: December 02, 2015, 03:14:27 am »
Those tilt/pitch units on older 4wd's were just gadgets for the wannabie 4wd person. Most offroad 4wd rollovers occur when your vehicle is somewhat off camber and then bumps over a rock etc and that takes it over - at which point that gadget is totally useless... and if you were staring at it rather than the terrain, well...

There's plenty of apps for smart phones that mimic the old tilt/pitch displays graphically if you think you need the gadget. I'd suggest it's essentially useless in the real world.

cheers,
george.
 

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Re: Pitch Roll gauge project.
« Reply #12 on: December 02, 2015, 04:04:31 pm »
If you're designing a PCB with an accelerometer, and plan to solder it by hand, then be careful. MEMS accelerometers are very easy to overheat and damage, and I've wrecked quite a few this way. Consider using a pre-assembled module with the accelerometer already mounted; it could save a lot of frustration.

Thank you for the tip.  I was not aware that they were that sensitive to heat.

Bobby
 

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Re: Pitch Roll gauge project.
« Reply #13 on: December 02, 2015, 04:12:24 pm »
There's plenty of apps for smart phones that mimic the old tilt/pitch displays graphically if you think you need the gadget. I'd suggest it's essentially useless in the real world.

This is more for the fun factor and for knowing the actual angle.  There is also the challenge of the circuit and code development.

Bobby
 

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Re: Pitch Roll gauge project.
« Reply #14 on: December 02, 2015, 04:19:39 pm »
Just a thought: As well as an angle indicator you could put in a red warning light for when the car is near the limits. Most of the time that's all the information you need and you won't have to look down at a dial to see it.

I am thinking about hood mounted like some of those old hot rods that had tachometers mounted out in front of the driver on the hood.  Possibly 2 back lighting colors as it approaches a preset value.  I also may try a single multiple color LED so Red for danger and green for ok. (Thanks for that suggestion.)  There are so many ways to present the data to the user.

Bobby
 

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Re: Pitch Roll gauge project.
« Reply #15 on: December 02, 2015, 05:23:29 pm »
[

For measuring a huge force like gravity?

None are 'better', all of them are perfectly capable of that.

So I looked at the data sheet recommended below your post for the ADXL345.  If I set a zero point and kept that value in memory, then I could use gravity for my tilt measurement.  Not as exotic as real time measurement of actual movement and using a gyro, but gets me where I want to go.  I am going to try this for my first pass in a rough test as soon as I can get some sample boards in.

Thank you for the big tip there that I missed first time around.

Bobby
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 932
  • Country: us
Re: Pitch Roll gauge project.
« Reply #16 on: December 02, 2015, 08:53:36 pm »
There's plenty of apps for smart phones that mimic the old tilt/pitch displays graphically if you think you need the gadget. I'd suggest it's essentially useless in the real world.

This is more for the fun factor and for knowing the actual angle.  There is also the challenge of the circuit and code development.

Bobby

The smart phone apps show the angles as well as the graphic. You can set the warning point and it will change colour etc. Some will also log the extremes etc.

Anyhow, if you are just playing to learn, go for it. Just don't use it offroad thinking it will be the end all confirmation of being safe or at risk of rolling/flipping...

cheers,
george.
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17769
  • Country: 00
Re: Pitch Roll gauge project.
« Reply #17 on: December 02, 2015, 10:34:47 pm »
Anyhow, if you are just playing to learn, go for it. Just don't use it offroad thinking it will be the end all confirmation of being safe or at risk of rolling/flipping...

I bet you're fun at parties.
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 932
  • Country: us
Re: Pitch Roll gauge project.
« Reply #18 on: December 03, 2015, 12:29:35 am »
Anyhow, if you are just playing to learn, go for it. Just don't use it offroad thinking it will be the end all confirmation of being safe or at risk of rolling/flipping...

I bet you're fun at parties.

For sure. I also go offroad so am well aware how 'useful' (not) those roll/tilt units actually are (not)...

cheers,
george.
 

Offline zirlou21

  • Newbie
  • Posts: 5
  • Country: 00
Re: Pitch Roll gauge project.
« Reply #19 on: December 03, 2015, 01:13:24 am »
 :) :) :)


...have you try the IMU mpu6050 it is a 6DOF(3accel-3gyro) it is also used in PS2 comtroller.The integration of accel/gyro data is built-in.
 

Offline InahoTopic starter

  • Contributor
  • Posts: 13
Re: Pitch Roll gauge project.
« Reply #20 on: December 08, 2015, 05:10:54 pm »
:) :) :)


...have you try the IMU mpu6050 it is a 6DOF(3accel-3gyro) it is also used in PS2 comtroller.The integration of accel/gyro data is built-in.

I looked at the specs and it looks like a good chip.  Lots of folks using it in projects so lots of examples.  Thanks for the recommendation.

Bobby
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17769
  • Country: 00
Re: Pitch Roll gauge project.
« Reply #21 on: December 08, 2015, 05:47:51 pm »
I also go offroad so am well aware how 'useful' (not) those roll/tilt units actually are (not)...

I bet they're useful for learning...

 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 932
  • Country: us
Re: Pitch Roll gauge project.
« Reply #22 on: December 09, 2015, 12:26:11 am »
I also go offroad so am well aware how 'useful' (not) those roll/tilt units actually are (not)...

I bet they're useful for learning...

Learning how to interface the sensor to the uC, yes.

Learning to go offroad, no!

cheers,
george.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf