SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By ksamer
#179973
I have a Gyro Breakout Board - LY530AL - 300°/s (PN SEN-09165) mounted on a motorcycle. I want to estimate the value of body position in turning a motorcycle by comparing the lean angle of the motorcycle+rider calculated from the GPS data with the lean angle of the motorcycle itself.

I can differentiate the calculated lean angle over time to get a lean rate which matches nicely with the lean rate from the gyro. I cannot seem to go the other way, integrating the lean rate from the gyro to match the lean angle calculated from the GPS data.

Is there an issue I am missing in integrating the signal from the gyro?

Regards,

KS Amer

Kinelogix
By ksamer
#179980
Thanks for your reply.

The integration is being done by a third party analysis software package that goes with the data logger, so I have no code of my own. Integration of other traces (brake pressure to give brake work, for example) functions fine. The authors of that program say it's an issue with the gyro output.

Regards,

KS Amer
By Mee_n_Mac
#179981
I can differentiate the calculated lean angle over time to get a lean rate which matches nicely with the lean rate from the gyro. I cannot seem to go the other way, integrating the lean rate from the gyro to match the lean angle calculated from the GPS data.
So what is it (specifically) that appears wrong to you ?

If it works one way, it should work the other once you get the offset compensated for properly.
By ksamer
#179982
The Lean Angle trace derived by integrating the Gyro Trace comes out at a funky angle and scale (bottom panel in attachment). It somewhat matches the Calculated Lean Angle Trace in the top panel, however.

Regards,

KS Amer
You do not have the required permissions to view the files attached to this post.
By Mee_n_Mac
#179983
First off I can see drift due to some residual gyro offset. W/o measuring it (offset) ahead of time I might look at the data you've shown and find a section where you know the bike won't be leaned over and the subtract an offset that makes that be true. Then you can begin to compare the 2 data sets.

How do you derive the lean angle from GPS data ? I might guess from velocity and steering angle and "known" physics of the bike, tires and track but no sense in me guessing. I wonder which data is the truer representation ?