Measure a Vehicle's Dynamic Motion
Walter Stockwell, Crossbow Technology, San Jose, CA- February 15, 1999
When testing a vehicle, you often must measure its dynamic motions and its angle relative to the road. Accelerometers let you measure the forces caused by turning, accelerating, or braking, but the turning measurements won’t be accurate unless the vehicle is level relative to the earth during the turn. If the vehicle tilts forward, such as when you apply the brake, you’ll get gravity components—the braking force—that an accelerometer will detect. By using a combination of sensors, however, you can compensate for the gravity component and accurately measure angle and dynamic motion.
Most tilt sensors sense the direction of gravity as a reference direction. In a tilt measurement, you want to measure gravitational acceleration only. When you want to measure motion acceleration, you don’t want to measure any tilt component. Unfortunately, a tilt sensor will make inaccurate angle measurements when subjected to motion acceleration, and an accelerometer will make inaccurate acceleration measurements when the vehicle tilts. Angular-rate sensors can help correct for the effect of the forward tilt by measuring rotations (roll, pitch, and yaw) around a vehicle’s center, but they have their own drawbacks: They measure rotation rate, not rotation angle.
Best of All Worlds
Fortunately, each measurement technology can compensate for weaknesses in the other. You can combine acceleration measurements with angular-rate measurements to produce accurate measurements of the vehicle’s dynamic motions. With enough computational power, you can perform accurate measurements of acceleration and angles in real time.
To perform the calculations, you must measure acceleration along three orthogonal axes and measure rotations around these same axes (Fig. 1). If possible, mount the sensors at the vehicle’s center of gravity to minimize rotational accelerations that can affect the accelerometer measurements.
The angular-rate sensors measure the rate that a vehicle rotates around a given axis, but you want the rotation angle, not the rotation rate. If you integrate the rate over time, you’ll get the vehicle’s angle as a function of time. For example, if you use angular- rate sensors to track the vehicle’s rotational motion around the x-axis and around the y-axis, you can then integrate the rotational information to calculate the vehicle’s roll and pitch as a function of time. Using the calculated roll and pitch (see Fig. 1), you can subtract the gravity components produced by the tilt from the accelerometer’s x-axis and y-axis data. The calculations give you the true acceleration caused by the vehicle’s motion, not by gravity.
To calculate the actual pitch and roll angles, you must integrate the angular-rate signals. Unfortunately, an offset error in angular rate will produce an error in angle; that angle error increases linearly with time. In addition, the random noise in the rate sensors will produce a random-walk effect in the calculated angle. The random-walk causes the calculated angle to drift at a rate proportional to the square root of time, even in the absence of rate-bias error. These effects will limit the usefulness of all but the most expensive angular-rate sensors for measurements lasting longer than a few minutes.
Fortunately, accelerometers are stable over long time periods so you can compensate for the angular-rate sensor’s long-term errors. With both sensors, you can produce angle stable calculations over both short periods and long periods. Use the rate sensor to measure angle changes on short time scales, say less than a few minutes. Use the accelerometer like a tilt sensor to calculate the tilt angles and force the rate sensor’s derived angles to slowly match the accelerometer angles over a few minutes.
Get the Hardware
To perform the measurements, you need sensors, data-acquisition equipment, and computational power. You need a three-axis accelerometer aligned along the body, and three angular-rate sensors aligned with the accelerometer axes. You can also add a temperature sensor and use the data to compensate for temperature effects in the accelerometer and rate sensor outputs. (For more detail on the measurement system, see “Vehicle Dynamics Measurement System,” above.)
Place the sensors as close to the vehicle center of motion as possible. Otherwise, rotational motions will cause the accelerometers to measure centrifugal accelerations. Remember, you use the accelerometers to measure the linear accelerations of the center of gravity of the vehicle. You should minimize coupling the rotational motion into the accelerometer measurements. These centrifugal accelerations will complicate the analysis of the acceleration data, but you can avoid the problem by proper sensor placement.
Figure 2 shows the algorithm for one axis. Integrate the rate- sensor output in real time to find a raw angle. Use the accelerometer to measure the direction of gravity and infer a tilt angle. For example, if you measure 0.1 g acceleration in the x-axis, this implies a tilt of asin(0.1) = 5.7—the “gravity angle.” To avoid a false indication of the gravitational tilt angle caused by vibration and shock, use a low-pass filter with a 100-Hz or lower cutoff frequency. A simple single-pole RC filter is all you need.
When you calculate angle for the pitch axis (x) and the roll axis (y), calculate the difference between the raw angle and the gravity angle for each axis. That difference is the error signal that you can use to correct the angle calculation. A gain parameter, k, controls how much of the error signal you use to correct the rate-sensor angles. The gain parameter k is similar to the erection rate in an analog vertical gyro.
The value of k sets the time constant at which the error-signal calculations stabilize the rate-sensor angle calculation. You should choose a time constant that is longer than your expected maneuvers in testing. Multiply the time constant by your measurement rate, and take the inverse. Use the result as your value for k. For example, if you want a time constant of 5 s, and you sample the accelerometers and rate sensors at 200 Hz, then k = 1/5*200 = 0.001.
Finally, sum the raw angle from the rate sensor with the error signal. You’ll get the stabilized angle, dominated on short time scales by the rate sensor information, but corrected on long time scales by the accelerometer data. For motions of shorter duration than about five to six times the time constant, the pitch and roll angles will primarily reflect the angular rate sensor data. For longer durations, the accelerometer data will dominate the calculated angles.
You can use the stabilized tilt angles to correct your raw accelerometer data, which will let you find the true acceleration along all axes. Remember, if the vehicle is tilted, the accelerometers will measure some of gravity’s acceleration on the x-axis (pitch) and some on the y-axis (roll).
One way to correct for tilt is to create a rotation matrix, using the measured pitch and roll, that will rotate the measured acceleration vector (x-, y-, and z-axis measurements aligned with the vehicle) with respect to earth. Once you’ve compensated for tilt, you’ll measure pure motion acceleration, not gravity.
After the calculations, you’ll have a complete description of the motion of your vehicle including angular rates, stabilized tilt angles, and corrected linear accelerations. You’ll have a reliable system for vehicle motion testing. T&MW
Walter Stockwell, Ph.D. is an application engineer at Crossbow Technologies. He escaped from academia after earning a Ph.D. in particle astrophysics from UC Berkeley; (408) 965-3300,