Pitch Roll gauge project. - Page 1
Forum section: electronics / projects

author: Inaho
author_rank: Contributor
timestamp: November 30, 2015, 11:19:02 pm
content: 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

author: jmaja
author_rank: Frequent Contributor
timestamp: December 01, 2015, 11:20:10 am
content: 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.

author: Fungus
author_rank: Super Contributor
timestamp: December 01, 2015, 11:44:39 am
content: Quote from: Inaho on November 30, 2015, 11:19:02 pmFor measuring a huge force like gravity?None are 'better', all of them are perfectly capable of that.

author: Inaho
author_rank: Contributor
timestamp: December 01, 2015, 02:24:51 pm
content: Quote from: Fungus on December 01, 2015, 11:44:39 amNo. 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

author: Inaho
author_rank: Contributor
timestamp: December 01, 2015, 02:28:20 pm
content: Quote from: jmaja on December 01, 2015, 11:20:10 amThank you for the tips.Bobby

author: suicidaleggroll
author_rank: Super Contributor
timestamp: December 01, 2015, 04:13:10 pm
content: 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.

author: Fungus
author_rank: Super Contributor
timestamp: December 01, 2015, 08:30:28 pm
content: Quote from: Inaho on December 01, 2015, 02:24:51 pmAnd the reply is that they're all pretty much the same at this level.I'd get one thatonlyhas 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 theADXL345. 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.

author: Fungus
author_rank: Super Contributor
timestamp: December 01, 2015, 08:52:20 pm
content: Quote from: suicidaleggroll on December 01, 2015, 04:13:10 pmI 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.Quote from: suicidaleggroll on December 01, 2015, 04:13:10 pmThe 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.

author: AndyC_772
author_rank: Super Contributor
timestamp: December 01, 2015, 08:57:30 pm
content: 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.

author: Fungus
author_rank: Super Contributor
timestamp: December 01, 2015, 09:02:31 pm
content: 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.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: December 01, 2015, 09:49:07 pm
content: Quote from: Fungus on December 01, 2015, 08:52:20 pmThat'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.

author: georges80
author_rank: Frequent Contributor
timestamp: December 02, 2015, 03:14:27 am
content: 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.

author: Inaho
author_rank: Contributor
timestamp: December 02, 2015, 04:04:31 pm
content: Quote from: AndyC_772 on December 01, 2015, 08:57:30 pmThank you for the tip. I was not aware that they were that sensitive to heat.Bobby

author: Inaho
author_rank: Contributor
timestamp: December 02, 2015, 04:12:24 pm
content: Quote from: georges80 on December 02, 2015, 03:14:27 amThis is more for the fun factor and for knowing the actual angle. There is also the challenge of the circuit and code development.Bobby

author: Inaho
author_rank: Contributor
timestamp: December 02, 2015, 04:19:39 pm
content: Quote from: Fungus on December 01, 2015, 09:02:31 pmI 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

author: Inaho
author_rank: Contributor
timestamp: December 02, 2015, 05:23:29 pm
content: Quote from: Fungus on December 01, 2015, 11:44:39 amSo 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

author: georges80
author_rank: Frequent Contributor
timestamp: December 02, 2015, 08:53:36 pm
content: Quote from: Inaho on December 02, 2015, 04:12:24 pmThe 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.

author: Fungus
author_rank: Super Contributor
timestamp: December 02, 2015, 10:34:47 pm
content: Quote from: georges80 on December 02, 2015, 08:53:36 pmI bet you're fun at parties.

author: georges80
author_rank: Frequent Contributor
timestamp: December 03, 2015, 12:29:35 am
content: Quote from: Fungus on December 02, 2015, 10:34:47 pmFor sure. I also go offroad so am well aware how 'useful' (not) those roll/tilt units actually are (not)...cheers,george.

author: zirlou21
author_rank: Newbie
timestamp: December 03, 2015, 01:13:24 am
content: ...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.

author: Inaho
author_rank: Contributor
timestamp: December 08, 2015, 05:10:54 pm
content: Quote from: zirlou21 on December 03, 2015, 01:13:24 amI 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

author: Fungus
author_rank: Super Contributor
timestamp: December 08, 2015, 05:47:51 pm
content: Quote from: georges80 on December 03, 2015, 12:29:35 amI bet they're useful for learning...

author: georges80
author_rank: Frequent Contributor
timestamp: December 09, 2015, 12:26:11 am
content: Quote from: Fungus on December 08, 2015, 05:47:51 pmLearning how to interface the sensor to the uC, yes.Learning to go offroad, no!cheers,george.