The vertical acceleration is important for rapid elevation change as well as banked turns, not to mention motorcycles. Even better would be to add all three gyro axes as well. The immediate benefit would be to give yaw rate directly.
For motorcycles, the lean angle would then be arccos(1/x) where x is the accelerometer value for the axis aligned with the vertical axis of the bike. There would be no need to calculate lateral acceleration from differentiating GPS data, with its inherent noise. GPS data could be used instead to verify the axis angle calibration.
Of course for both ways to calculate motorcycle lean angle, the assumption is that the track surface is level. You can't do a simple calculation with just GPS earth frame of reference lateral or bike frame of reference vertical acceleration if the turn is banked.
I'll post some raw data graphs from a few laps around Bristol Motor Speedway at about 70 mph to show what I mean.
Log all three accelerometer axes
-
- 20 or more Posts ★★★
- Posts: 836
- Joined: Thu May 03, 2012 5:26 am
- Location: Kingsport, TN USA
Re: Log all three accelerometer axes
I logged data three ways. I used the logging capability of a VBOX Sport to log GPS fixes at 20Hz. I used an iPod Touch gen 4 with an Emprum Ultimate GPS dongle and an application called Sensor Data to record x,y and z axis acceleration, rotation rate and GPS time. The high steel grandstands caused some dropouts with the Emprum but didn't seem to bother the VBOX Sport and the Dual. I also used HLT on an iPhone 4s with a Dual XGPS160 to log data. The longitudinal acceleration is not plotted because most of the time my speed was fairly constant. The z axis of the iPod was oriented longitudinally with respect to the vehicle and the y axis vertically. That makes the z axis the longitudinal acceleration and roll axis, the y axis vertical acceleration and yaw and the x axis lateral acceleration and pitch.
Lateral acceleration:

Note the difference between the VBOX Sport data in the earth frame of reference and the HLT and Sensor Data from the vehicle frame of reference. The vehicle frame shows negative lateral acceleration at times because I wasn't going fast enough on the straighter parts of the oval, which are still banked, for the lateral acceleration to shift the total acceleration in the xy plane vector to the other side of the gravity vector. Trust me, I wasn't turning right even if it felt that way.
Vertical acceleration:

If the track were level, then vertical acceleration wouldn't change much unless the car has a lot of roll angle. But it isn't and vertical acceleration in the vehicle frame is significant. If I transformed the data to the earth frame of reference with quaternions or direction cosine matrices, the vertical acceleration would equal the gravitational acceleration and the lateral acceleration would equal the GPS lateral acceleration. I haven't tried it, but the magnitude of the total acceleration in the xy plane from the vehicle frame should equal the vector sum of gravity plus the GPS lateral acceleration.
Yaw Rate (y axis rotation rate)

Note that the Yaw rate from the internal gyro is less than the yaw rate calculated from VBOX Sport heading data. That's because the track is banked and some of the yaw rate will be seen in the pitch rate.
Pitch Rate (x axis rotation rate)

Roll Rate (z axis rotation rate)

You can see the rapid change in roll as the car enters and exits the high banked turns at each end of the oval.
I have bits and pieces of an R program to calculate direction cosine matrices which would give you the Euler (roll, pitch and yaw) angles, but it's very much a work in progress. It's based on do it yourself drone flight control programs. Double integration of the accelerometer axes to get distance traveled and single integration of the rotation rates is subject to rapid drift because the data are noisy. You need an absolute earth frame reference like GPS and magnetometer readings to correct the drift. But GPS isn't fast enough or precise enough for flight control.
Edit: This data was acquired with single suction cup mounts. That likely accounts for some of the noise. However, I could have used a low pass filter to remove the high frequency noise inherent in the iPod data. HLT data is already low pass filtered.
Lateral acceleration:

Note the difference between the VBOX Sport data in the earth frame of reference and the HLT and Sensor Data from the vehicle frame of reference. The vehicle frame shows negative lateral acceleration at times because I wasn't going fast enough on the straighter parts of the oval, which are still banked, for the lateral acceleration to shift the total acceleration in the xy plane vector to the other side of the gravity vector. Trust me, I wasn't turning right even if it felt that way.
Vertical acceleration:

If the track were level, then vertical acceleration wouldn't change much unless the car has a lot of roll angle. But it isn't and vertical acceleration in the vehicle frame is significant. If I transformed the data to the earth frame of reference with quaternions or direction cosine matrices, the vertical acceleration would equal the gravitational acceleration and the lateral acceleration would equal the GPS lateral acceleration. I haven't tried it, but the magnitude of the total acceleration in the xy plane from the vehicle frame should equal the vector sum of gravity plus the GPS lateral acceleration.
Yaw Rate (y axis rotation rate)

Note that the Yaw rate from the internal gyro is less than the yaw rate calculated from VBOX Sport heading data. That's because the track is banked and some of the yaw rate will be seen in the pitch rate.
Pitch Rate (x axis rotation rate)

Roll Rate (z axis rotation rate)

You can see the rapid change in roll as the car enters and exits the high banked turns at each end of the oval.
I have bits and pieces of an R program to calculate direction cosine matrices which would give you the Euler (roll, pitch and yaw) angles, but it's very much a work in progress. It's based on do it yourself drone flight control programs. Double integration of the accelerometer axes to get distance traveled and single integration of the rotation rates is subject to rapid drift because the data are noisy. You need an absolute earth frame reference like GPS and magnetometer readings to correct the drift. But GPS isn't fast enough or precise enough for flight control.
Edit: This data was acquired with single suction cup mounts. That likely accounts for some of the noise. However, I could have used a low pass filter to remove the high frequency noise inherent in the iPod data. HLT data is already low pass filtered.