Go Down

Topic: self-balancing unicycle problem (Read 10401 times) previous topic - next topic


Jul 07, 2017, 07:11 am Last Edit: Jul 07, 2017, 07:56 am by Southpark
If anyone cares, I finally discovered the real problem: The function getEulerAngles in the IMU library for my digital IMU would invert the pitch measurement if the IMU had spun around.
Nice work. This certainly highlights the benefits of testing the IMU with your hand, and finding out whether it behaves properly using extensive manual testing - before the IMU is even used for anything, like a bike etc. That is..... moving the IMU around, and observe the measured data in the serial monitor.....to ensure the readings are always behaving.

Pretty amazing how you got a plane parked inside your garage as well.


Also..... when it comes to the control system --- try to minimise all sources of delay in the code. Eg.... if using serial.begin .... turn it off during real-performance testing..... because sending serial data can slow down the control system.

Also...... remove serial writes for your 'real performance' testing.

It is possible that your 2400 bit per second serial rate is letting you down. If you are using that rate during actual testing (ie... you riding on the unicycle)....then see what happens if you turn off serial communications. You might be pleasantly surprised to find that things start behaving much better.

micros() could also provide improvement ..... instead of millis().

Go Up