Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: DigglerD on April 05, 2010, 03:45:40 PM

Title: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: DigglerD on April 05, 2010, 03:45:40 PM
Hi.

As you can see by my post count I am new to this forum but I am also completely new to robotics as well. I am trying to solve a problem and after scouring the internet for several days, it seems this forum has some discussion loosely around my problem but not exactly. I've read several threads on this board and some others like: http://www.teamhassenplug.org/NXT/NXTSensors.html. (http://www.teamhassenplug.org/NXT/NXTSensors.html.)

My problem... I am looking to acquire a sensor that will:

   1. Run on 5v power.
   2. Measure tilt from 0 to ~90 degrees.
   3. Output 0.5v at 0 degrees.
   4. Linearly increase output to ~4.5v as the unit reaches a ~90 degree angle.


and the kicker...

Remain unaffected by lateral acceleration and deceleration.

It would seem that (1) a sensor that will accomplish my needs does not exist, (2) angle by accelerometer will be fooled by lateral acceleration and deceleration, (3) gyro sensors will measure the speed of tilt but not the tilt itself. The question I see asked constantly on the net goes something like:

Q: Can I use an acceleration sensor on a bot going a steady speed to measure tilt?

To which the answer is usually, yes. My question is; if not going a steady speed (assuming a 1 - 2g accel/deceleration), what can I use to measure tilt?

The naive part me is hoping there is a nice package to buy, but if I need to do some work, I'm willing to try (even though I am very novice in electronics).

My first thought when starting was "how do RC copters do this", so I trolled through a bunch of RC sites but was unable to get pinout and output signal specifics as the modules all seem to be plug and play... for RC helicopters (which makes sense).

I also found this nifty piece http://www.gadgetgangster.com/find-a-project/56?projectnum=213 (http://www.gadgetgangster.com/find-a-project/56?projectnum=213) but after running through this tutorial (http://www.instructables.com/id/Accelerometer-Gyro-Tutorial/step3/Combining-the-Accelerometer-and-Gyro/ (http://www.instructables.com/id/Accelerometer-Gyro-Tutorial/step3/Combining-the-Accelerometer-and-Gyro/)), I was thoroughly confused... again, I am so novice that novice is probably not the word.

My story...

I have a drag car that runs in a limited class where wheelie bars have been banned. If you've ever watched drag racing, wheelie bars are those long sticks that extend from the rear of the car to prevent the front end from rising too high under power. When you have a car that gains a lot of traction on launch but omit the wheelie bars, this happens:

[youtube]YhPn5_Z0qfADragginBumper[/url][/youtube]

In drag racing, our goal is to get from point A to point B as fast as we can, if you are going up, you are not going forward. In addition to this, it's really hard to drive the car when you can only see the sky and the front wheels no longer steer the car (because they are in the air). hence, the goal is to have a device that will measure tilt, plug it into my timing computer, and reduce timing (horsepower) as the tilt of the vehicle increases.

My project...

I want to build a device that will measure the tilt of the car on a single axis and report that value using an analog signal. Almost all tilt sensors today use an accelerometer and since later acceleration will be a function of g measurement, the tilt measurements from these sensors (like digital protractors) are significantly changed by the vehicle's acceleration and deceleration. My specifications are roughly predetermined because I only have one input port on my timing computer, the MAP (Mass Air Pressure) sensor port. The MAP port has a 3-pin plug. That plug has GROUND, 5v+ OUT and 0.5v-5v IN/SIGNAL. The computer reads 0.5v as a baseline (usually sea level ambient pressure) and 5v as a max (somewhere around 30+ PSI). I plan to replace the traditional MAP with a "tilt" sensor that will output 0.5v at a 0 degree tilt and 5v somewhere around a 90 degree tilt with of course all the variable voltages in between.

Thanks in advance for any help...
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: Soeren on April 05, 2010, 04:11:32 PM
Hi,

[...] I am looking to acquire a sensor that will:

   1. Run on 5v power.
   2. Measure tilt from 0 to ~90 degrees.
   3. Output 0.5v at 0 degrees.
   4. Linearly increase output to ~4.5v as the unit reaches a ~90 degree angle.
It's pitch (as related to your rear axle) that you wanna measure, so you should be looking for a gyro.
Don't mine your specs too much. I guess you have 12V (or 24V) allready and the rest is just creating the interfacing to suit your ECM.
Actually, it doesn't even have to be particularly linear, as it will be a closed loop (motor, chassis, gyro and all). And it should never get anywhere near 90° as long as the electronics work ;D

A couple of other possible ways to detect front end lift:
- IR distance detector (but it may be too slow?).
- Strain gauge on the front suspension.
(just off the top of my head - there's allways several ways to shave a goat).


Btw. How long time from start to a lift of say 5°, 10°, 15° etc. (just trying to get a comprehension of what timing restraint there will be).
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: DigglerD on April 05, 2010, 04:29:29 PM
Hi,

[...] I am looking to acquire a sensor that will:

   1. Run on 5v power.
   2. Measure tilt from 0 to ~90 degrees.
   3. Output 0.5v at 0 degrees.
   4. Linearly increase output to ~4.5v as the unit reaches a ~90 degree angle.
It's pitch (as related to your rear axle) that you wanna measure, so you should be looking for a gyro.
Don't mine your specs too much. I guess you have 12V (or 24V) allready and the rest is just creating the interfacing to suit your ECM.
Actually, it doesn't even have to be particularly linear, as it will be a closed loop (motor, chassis, gyro and all). And it should never get anywhere near 90° as long as the electronics work ;D

A couple of other possible ways to detect front end lift:
- IR distance detector (but it may be too slow?).
- Strain gauge on the front suspension.
(just off the top of my head - there's allways several ways to shave a goat).


Btw. How long time from start to a lift of say 5°, 10°, 15° etc. (just trying to get a comprehension of what timing restraint there will be).


In order...

The car is a 16v system that charges at about 19v but my timing computer has a 5v output for sensors. Why not linear? I figure as tilt increases, my correction should also increase. But yes... 90 degrees and we're beyond sensors and correction  ;D

How would you go about this method?

WRT your other thoughts...

The infrared sensor was my first approach. I purchased one of these (http://www.sparkfun.com/datasheets/Sensors/Infrared/gp2y0a02yk_e.pdf (http://www.sparkfun.com/datasheets/Sensors/Infrared/gp2y0a02yk_e.pdf)) and it actually ...kinda works but the measurements don't seem reliable and, I was worried about terrain irregularities as the car moved down the track.

A strain gauge (or distance sensor) on the front suspension will only tell me when the front suspension is fully unloaded. At that point, the wheelie can be 1" high or 4' high with the same reading from the sensor. In my application I would prefer to have the front wheels around 1" off the ground (full strain or travel) as this will apply maximum weight (traction) to the rear wheels.

I'm not precisely sure on my start time but luckily my ECU has a graph where I can plot my start based on the voltage output of the sensor. In this sense, the sensor can be really dumb as I have upstream devices that can handle the extra computing.
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: waltr on April 05, 2010, 05:49:05 PM
I wonder if an ultrasonic range finding is fast enough?
The idea of measuring how high the front wheels are off the ground sounds to be the most reliable to do.

Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: DigglerD on April 05, 2010, 05:52:55 PM
I wonder if an ultrasonic range finding is fast enough?
The idea of measuring how high the front wheels are off the ground sounds to be the most reliable to do.


My father in law suggested this approach. To me, "ultrasonic" implied measuring time to echo. These cars are VERY loud... wouldn't that throw off the sensor?
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: dunk on April 05, 2010, 07:12:44 PM
my first thought when reading this was the same as Soeren. a gyro, also known as an "angular rate sensor".
these sensors measure the rate of rotation rather than a specific angle and are immune to forces of acceleration and have very low response times.
the down side of these sensors is they are prone to "drift". ie, with no reference point any interference or inaccuracies will cause the reference angle to drift away from the true angle over time.
they also tend to give different readings at different temperatures, are less accurate in mechanically noisy environments (ie, vibration) and generally don't like playing nice.

usually gyros are used in conjunction with some other form of sensor to offset the drift but in your case you could zero all perimeters while you had the clutch in.
i would imagine your critical period is only a few seconds long. an average across multiple gyros should be sufficiently accurate.

i can't help thinking some sort of mechanical sensor would be easier to implement though.
do you have front suspension on your vehicle? a linear encoder measuring front suspension compression would work.

if you are talking about wheelie bars then the forces are going to be large enough to distort your chassis. can you measure that?
what about a laser shining down the length of the vehicle at an array of light sensors so you can measure how much your chassis is bending? this way you can turn the length of the vehicle into a strain gauge.

while we are throwing ideas about,
is putting an optical reference point behind the vehicle an option and measure the angle with machine vision?
an LED beacon oscillating at half the cameras frame rate and compare the vertical position of the "on" pulses, using the "off" pulses as a mask to isolate the beacon.
i suspect this approach would have at least ~100ms latency by the time video frames were captured and processed so maybe it's too slow (not to mention over complicated).

one last thing,
power boats face a similar problem to the one you are describing.
they are looking to maintain a level angle through rough seas using the throttle. you could see if the devices they use are adaptable.
i don't know what they use these days. when i last skippered such craft all the automatic throttle controls were somewhat temperamental but i'd imagine rate gyros have been integrated by now.


dunk.
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: DigglerD on April 05, 2010, 07:48:09 PM
I like the idea of setting 0 with the clutch (or in my case, transbrake) as that would be very simple. However, my understanding of gyros is that they measure the speed of change in tilt but not the actual angle of tilt... I need the latter.

For the most part, I want to stay away from mechanical sensors as they are more likely to be visible. The class I am running has outlawed wheelie bars but has not stated anything about electronically sensing an limiting wheelies. If something were visible, someone might complain which may result in amendments to the rules.

I will check out the boat idea... do you have any idea what the assist may have been called?
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: dunk on April 06, 2010, 03:39:24 AM
I like the idea of setting 0 with the clutch (or in my case, transbrake) as that would be very simple. However, my understanding of gyros is that they measure the speed of change in tilt but not the actual angle of tilt... I need the latter.
correct. you would need to integrate the output.
not really a problem though. if your rate of change becomes anything other than zero then you need to ease up on the throttle.
have you any electronics or programming experience? you will probably need a simple microcontroller to read the rate gyro and convert the output into something your engine management understands.

I will check out the boat idea... do you have any idea what the assist may have been called?
so going back 10-15 years to when i used to move boats about there was often a device that would throttle down in the bows of the boat lifted too high.
it was little more than a tilt sensor and as such would be affected by changes in speed and the effects of rough seas so they were little more than EPOs leaving the helmsman to do the delicate control.

from more recent trips by water taxi, technology appears to have caught up though. the taxis i was on appeared to do the fine tuning automatically.
i can't find a reference to it online though. do you live near the sea? drop into a power boat shop and ask a few questions.

there's also a bunch of US Navy guys on this forum that might be able to ask someone with more recent first hand experience than mine....


dunk.
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: DigglerD on April 06, 2010, 10:57:17 AM
correct. you would need to integrate the output.
not really a problem though. if your rate of change becomes anything other than zero then you need to ease up on the throttle.
have you any electronics or programming experience? you will probably need a simple microcontroller to read the rate gyro and convert the output into something your engine management understands.

The vehicle will need tilt as it needs suspension travel and a 1-2" wheelie so I'd rather not flip a switch with any rotation. Thinking about the math... what I think (that's a big think) I would need to do is:

(1) Start a timer.
(2) Take a gyro output sample ($last_sample) at a rate of say every 1ms and multiply it by time elapsed ($last_elapsed_time) to get the change in angle ($last_angle). This step may be redundant as I think it only grabs an initial value.
(3) Take the current gyro output sample ($current_sample), multiply it by time elapsed ($elapsed_time) to get the current change in angle ($current_angle), add it to the last change in angle ($last_angle) to get total change in angle ($total_angle).
(4) Assume a 90 degree maximum angle and a 5v maximum output voltage.
(5) Take the total change in angle ($total_angle) and convert it to a scaled voltage using the assumption in step #4.

(($current_sample * $elapsed_time) + $last_angle) = $total_angle
($total_angle / 90) * 5 = Voltage Out


I plotted an example in Excel (I also included the formulas I used).

(http://img138.imageshack.us/img138/251/anglefromgyro.jpg)

I only know Perl and this would be easy to program in Perl but as I understand, it is not a language used for this type of stuff and wouldn't be fast enough even if I could use it. (I'm in the Silicon Valley and may be able to convince someone to write some code for me). What language would I need to learn?

Thanks again for all the troubleshooting on this with me.
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: dunk on April 06, 2010, 01:33:18 PM
yup.
if $elapsed_time is the time between samples then that looks something like it.


as you've worked out, Perl isn't going to get you very far in embedded electronics.
you are going to need a microcontroller to take readings from the gyro.
there are nearly as many microcontroller options as there are applications.
generally speaking you program microcontrollers in C although there are a few other options.

learning to program a microcontroller is not hard but it is a little time consuming....
for a trivial example look here:
http://www.societyofrobots.com/step_by_step_robot.shtml (http://www.societyofrobots.com/step_by_step_robot.shtml)

have a search on this forum for other microcontroller recommendations.
the big 2 chip manufacturers in the hobby market are Atmel.com (http://Atmel.com) AVR and Microchip.com (http://Microchip.com) PIC.
most people on this forum use AVRs.

if you want a ready made circuit along with a (non C) programing and development environment, Arduino.cc (http://Arduino.cc) has a big following.
personally, i don't see the point of the Arduinos as it is just an AVR chip with a clumsy programing environment but they have a huge user base so there must be some advantage.
bear in mind, i tend to like doing things the hard way... i think the Arduinos are fairly easy to get started on.


dunk.
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: DigglerD on April 06, 2010, 05:37:25 PM
if you want a ready made circuit along with a (non C) programing and development environment, Arduino.cc (http://Arduino.cc) has a big following.
personally, i don't see the point of the Arduinos as it is just an AVR chip with a clumsy programing environment but they have a huge user base so there must be some advantage.
bear in mind, i tend to like doing things the hard way... i think the Arduinos are fairly easy to get started on.

dunk.

So after looking at the options all day... I can see the draw of the Arduino... it's already put together, the low level programming is already taken care of and I just need to call the I/O, import my logic and flash the board via USB... not nearly as versatile but not nearly as complex either.

I'm looking at:

http://www.trossenrobotics.com/p/FTDI-Basic-Breakout-5V.aspx? (http://www.trossenrobotics.com/p/FTDI-Basic-Breakout-5V.aspx?)
http://www.trossenrobotics.com/store/p/5931-Arduino-Pro-5V-16MHz.aspx (http://www.trossenrobotics.com/store/p/5931-Arduino-Pro-5V-16MHz.aspx)
http://www.sparkfun.com/commerce/product_info.php?products_id=9373 (http://www.sparkfun.com/commerce/product_info.php?products_id=9373)

Thoughts? Will I need more parts?
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: Razor Concepts on April 06, 2010, 05:45:52 PM
The Arduino Pro is kind of useless since basically all it has is the chip and the PCB. Might as well get a "real" one with the proper usb connection built in instead of the FTDI breakout board.

I would recommend the Seeeduino. The standard Arduino has header pins with "strange" spacing that is proprietary, the seeeduino has the strange spacing along with the standard spacing so you can use standard .1" prototype boards.

Also note that the gyro you picked is a yaw rate gyro, which means for use on your dragster, the PCB will have to be vertical. Sparkfun sells other gyros that you can mount flat, yet still measure the right axis.
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: Soeren on April 06, 2010, 07:19:38 PM
Hi,

my timing computer has a 5v output for sensors.
No problem, that's what interfacing is all about (interface actually means "between faces").
You take what the sensor delivers and "reformat" it into what the ECU wants - sort of like a Star Trek translator without the jumpsuit holding it.


Why not linear? I figure as tilt increases, my correction should also increase. But yes... 90 degrees and we're beyond sensors and correction  ;D
It's not to avoid linear, but it just doesn't matter very much, as you just want to have X amount of tilt. If X rises a little, you counter it a little, if X goes high, you counter a lot - main thing is that you end up where you wanna be.
Since 90° is bad, you want full correction to come on before that point anyway (unless you're related to Evil Knievel of course ;)).


How would you go about this method?
As simple as possible, that way less can break down.
Actually, it's as simple as a primitive thermostat - too much and you ease off, too little and you let go a bit (perhaps a tad more involved, but that's the basic principle in all cybernetics, be it the humble thermostat, a race car or a multi-DOF robot).


You obviously can regulate down with a signal of 0.5V to 4.5V, or is that the total voltage controlling it that you want to modify?


The infrared sensor was my first approach. I purchased one of these [---] and it actually ...kinda works but the measurements don't seem reliable and, I was worried about terrain irregularities as the car moved down the track.
That is probably due to missing decoupling and shielding - I imagine a drag racer being even more (electrically) noisy than a street car.
You probably would be better off with a sensor covering a shorter distance, as you will then get more resolution over the range you will be using. Take a look at this page (http://www.acroname.com/robotics/info/articles/sharp/sharp.html) at the bottom of which is a comparison table to the different sensors (and each page has got a datasheet link for that sensor).

Mounted in a suitable height, I can't imagine it should have any problems with irregularities on a track (or the cars would as well). Besides, do you plan on doing the entire track with your front wheels in the air? (Oh well, just watched the video link that didn't work yesterday... Seems that's the way to go - saves on front tires as well ;)).
More than 1 IR sensor could be used (just like the auto-focus on a camera) and the result averaged.


A strain gauge (or distance sensor) on the front suspension will only tell me when the front suspension is fully unloaded. At that point, the wheelie can be 1" high or 4' high with the same reading from the sensor. In my application I would prefer to have the front wheels around 1" off the ground (full strain or travel) as this will apply maximum weight (traction) to the rear wheels.
Would the traction change much from barely touching (i.e. a few kg max. on the front axle) to 1" above ground?

If 1" above ground is the sweet spot, why don't your ECU take that into account - I imagine that a race ECU is a bit optimized compared to a street car (just look at Mega Squirt and it's still for street cars) and I would think that it would be easy to measure when the least power is wasted (something like: power applied/[mass x acceleration])?


I'm not precisely sure on my start time but luckily my ECU has a graph where I can plot my start based on the voltage output of the sensor. In this sense, the sensor can be really dumb as I have upstream devices that can handle the extra computing.
I have never been to a drag race (or tilted a drag queen for that matter ;D), so I have no idea of how fast a car goes into the air. Are we talking 10ms, 100ms, 1s or something different (just a ballpark guess based on your experience).

Another optical method that would be way faster than the Sharp sensors:
Mount one (modulated and slightly decollimated) LASER pointing down to the track slanted and 3 detectors that is made to have a quite narrow field of view, each looking at positions where the LASER will point when eg. 3/4", 1" and 1-1/4" into the air respectively (or closer together if you can get it very narrow).

When you start, it shouldn't react until it reaches the 1-1/4" detection where it will back down until the 1" is detected. Whenever one of the side detectors are grazed, the ECU is then told to back down or drop the hammer.
The best result would probably be with the sensors slightly "engaged" or perhaps with 5 sensors (but that's just more adjusting to do) and the readings should be quick and smooth, as a car with the front oscillating up and down half an inch would probably not go unnoticed (and would not be fun riding either I guess), but luckily the inertia of the entire system is helping out here.

Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: tim_wang on April 10, 2010, 03:02:37 PM
You can reliably measure the tilt angle using a 2 axis accelerometer with a single axis gyroscope. The sensor readings are fusing using a Kalman filter.

Your requirements for measuring the tilt angle were:

1. Run on 5v power.
There are many accelerometers and gyroscopes that run on 5V.

2. Measure tilt from 0 to ~90 degrees.
The accelerometer can read angles from -180 to +180 degrees. The gyroscope just reads angular velocity, the rate of change of the angle.

3. Output 0.5v at 0 degrees.
Using a 5V power supply, the accelerometer will read 2.5V at 0 degrees, lower than 2.5V for negative angles, and higher than 2.5V for positive angles. The gyroscope will read 2.5V at 0 degrees angular velocity, lower than 2.5V for counter clockwise rotation, and higher than 2.5V for clockwise rotation.

4. Linearly increase output to ~4.5v as the unit reaches a ~90 degree angle.
The accelerometer will give you a linear output voltage from -180 to +180 degrees. The gyroscope will give you a linear output voltage between its maximum rated angular velocities.

Remain unaffected by lateral acceleration and deceleration.
The Kalman filter removes high frequency noise from the accelerometer readings, the type you get when you violently shake the accelerometer, and uses the resulting signal to correct the gyroscope drift.

I have used this exact combination in my balancing robot, and it works great.

Good luck!
Title: Re: Reading tilt in a mobile (rapid acceleration/deceleration) environment
Post by: DigglerD on April 10, 2010, 04:50:24 PM
It's not to avoid linear, but it just doesn't matter very much, as you just want to have X amount of tilt. If X rises a little, you counter it a little, if X goes high, you counter a lot - main thing is that you end up where you wanna be.
Since 90° is bad, you want full correction to come on before that point anyway (unless you're related to Evil Knievel of course ;)).

You clearly understand the application. I’ve received a lot of “why”’s in the last couple weeks.

You obviously can regulate down with a signal of 0.5V to 4.5V, or is that the total voltage controlling it that you want to modify?

I have a voltage supply of either 5v (from the ECU) or ~19v (from the alternator… it’s a 16v system). I’d rather use one of the two as [for me] the math and resistor work gets tricky trying to get some other voltage lower or inbetween.

That is probably due to missing decoupling and shielding - I imagine a drag racer being even more (electrically) noisy than a street car.
You probably would be better off with a sensor covering a shorter distance, as you will then get more resolution over the range you will be using. Take a look at this page (http://www.acroname.com/robotics/info/articles/sharp/sharp.html) at the bottom of which is a comparison table to the different sensors (and each page has got a datasheet link for that sensor).

Mounted in a suitable height, I can't imagine it should have any problems with irregularities on a track (or the cars would as well). Besides, do you plan on doing the entire track with your front wheels in the air? (Oh well, just watched the video link that didn't work yesterday... Seems that's the way to go - saves on front tires as well ;)).
More than 1 IR sensor could be used (just like the auto-focus on a camera) and the result averaged.
So I moved everything to shielded cable, wrapped the sensor up in foil and grounded it. It does work better. The trouble I see now is the sensor is a bit picky about what it reflects off and once out of range it resets to 0. So while I’d want a short range for resolution, I’d need a long range to remain within its parameters.


A strain gauge (or distance sensor) on the front suspension will only tell me when the front suspension is fully unloaded. At that point, the wheelie can be 1" high or 4' high with the same reading from the sensor. In my application I would prefer to have the front wheels around 1" off the ground (full strain or travel) as this will apply maximum weight (traction) to the rear wheels.

Would the traction change much from barely touching (i.e. a few kg max. on the front axle) to 1" above ground?

This is an interesting point. Presumably if the front is light as a feather then yes.. the strain gauge could be sufficient… assuming maximum strain does in fact equate to minimum front end lift at all times. To say, typically the car should have enough traction to push the front end off the ground but I wonder would would happen in a reduced traction scenario where the car can push the front end up but does not have enough traction to lift it off the ground… I might not want to reduce power at that point. Consider a 500# weight on the ground… attempting to pick it up may yield maximum strain, but may still leave 200# of force on the ground.

I need to think about this idea more.

If 1" above ground is the sweet spot, why don't your ECU take that into account - I imagine that a race ECU is a bit optimized compared to a street car (just look at Mega Squirt and it's still for street cars) and I would think that it would be easy to measure when the least power is wasted (something like: power applied/[mass x acceleration])?
I would love to measure wasted power but I got kind of lot in your description and what outcome the equation would yield.

I have never been to a drag race (or tilted a drag queen for that matter ;D), so I have no idea of how fast a car goes into the air. Are we talking 10ms, 100ms, 1s or something different (just a ballpark guess based on your experience).

The video suggests something in the neighborhood of 80 degrees/s.

You can reliably measure the tilt angle using a 2 axis accelerometer with a single axis gyroscope. The sensor readings are fusing using a Kalman filter.

Your requirements for measuring the tilt angle were:

1. Run on 5v power.
There are many accelerometers and gyroscopes that run on 5V.

2. Measure tilt from 0 to ~90 degrees.
The accelerometer can read angles from -180 to +180 degrees. The gyroscope just reads angular velocity, the rate of change of the angle.

3. Output 0.5v at 0 degrees.
Using a 5V power supply, the accelerometer will read 2.5V at 0 degrees, lower than 2.5V for negative angles, and higher than 2.5V for positive angles. The gyroscope will read 2.5V at 0 degrees angular velocity, lower than 2.5V for counter clockwise rotation, and higher than 2.5V for clockwise rotation.

4. Linearly increase output to ~4.5v as the unit reaches a ~90 degree angle.
The accelerometer will give you a linear output voltage from -180 to +180 degrees. The gyroscope will give you a linear output voltage between its maximum rated angular velocities.

Remain unaffected by lateral acceleration and deceleration.
The Kalman filter removes high frequency noise from the accelerometer readings, the type you get when you violently shake the accelerometer, and uses the resulting signal to correct the gyroscope drift.

I have used this exact combination in my balancing robot, and it works great.

Good luck!

You rock man.

I got an email exactly about this last night and I think this is the route I’m going to try.

http://tom.pycke.be/mav/92/kalman-demo-application (http://tom.pycke.be/mav/92/kalman-demo-application)

[youtube]AWAFFZ7rPDc[/youtube]

It performs brilliantly but unfortunately I know absolutely zilch about C. Searching around a bit more, I found:

http://starlino.com/imu_kalman_arduino.html (http://starlino.com/imu_kalman_arduino.html)

Again, I know nothing about Arduino or how to code it but after reading through a few links, it seems like it’s a bit easier to learn than C.

So I think I have some marching orders but I also want to investigate the strain gauge suggestion as well.