Fast_Moto wrote:I am calculating lean angle using the arctan of the lateral accelration calculated from GPS heading and speed information. As part of the process, I need to do some low-pass filtering. Does it make sense to do an initial filter of the GPS heading which is used in subsequent calculations or just do a filter of the final output of the calculations.
Are you on a banked track?
Are you on a track with altitude changes?
If the answer is no and no, then compute the lateral acceleration as ((lateral^2 = vert^2)^0.2 - 1G).
Then your lean angle is your lateral acceleration with your tangent function applied knowing the vertical acceleration (1G).
Your lean angle might be less if the rider is hanging off the bars.
Usually these devices get confused on long steady turns - I would look there for errors.
The other away to do it is to use the devices roll (pitch and yaw), and the 3 accelerations and propagate the position forward in time. You will not have a lot of error over a short time once you have a good bias value. MATLAB helps with this.
In this example:
I propagated the speed starting at a known ~160 kph (100mph) to find coefficients for drag... (Took about 90 seconds to coast down to a slow speed)
Once I computed the coefficients; then the graph shows the GPS speed in green and modeled speed in red on the top graph.
I took into account the rises and dips in the road, which were not much - but really showed up as needed once the coefficients got close.
One the lower graph is the HP required to do that speed.
That was a totally different problem to yours - but the same principles can apply.
For your case - you could start with the GPS position, speed and heading.
Then propagate the motorcycle forward in time based upon the initial GPS position,speed/heading using just the RPY (Roll, pitch, yaw) and the 3 accelerometers.
You will probably have to take out some bias...
If you plot that against the true position and it matches up, then you have success!
Otherwise you will see regions where the device works great and regions where it is not so good.
I found it easiest to export the data as .cvs and work it off-line outside of i2, where I know how to do the math better/easier.