06 January 2008

Almost balancing!

Bot nearly balancing! Changed code to use floats rather than ints/longs or fixed points implemented on ints/longs. Tweaked target angle and KP value. Console controller can now set target angle and PID control values. Skew motor power as motors are not equal speed/power.

Problem: Target angle slightly off. Tends to drive forward/backward at fixed angle.

Solution 1: add component that sets target angle based on desired vs actual motor speed. Probably a PID controller to set target angle of current PID controller.

Solution 2: add component that sets target angle based on maintaining fixed location. Probably a PID controller to set target angle of current PID controller.

Problem: Only works when tethered and drawing power from USB. Behaves totally nuts when using onboard 9V battery. No idea why yet, need to debug.

No comments:

Post a Comment