SixPotatoe Tuning

There are a set of constants that can be modified to change SixPotatoes’ performance. All of these constants are numbered starting with a K. Here is a list of most of these constants and what will be affected by modifying them. Most of these constants were originally established by trial and error. The value of several of them involves several tradeoffs. Whatever motor you use, with a little diligent work, you can probably improve SixPotatoe’s performance for a given situation.

  • K0 – Motor gain. This sets the aggressiveness by which the motor tries to achieve its target speed. This should be set as high as possible. At too high a value, there will be instability and oscillation under some conditions. If this is the case, the value needs to be reduced
  • K1 – Sets changes in pitch to center of oscillation speed. This is difficult to set. The current value should work for all robots that have similar height and weight distribution.
  • K2 – Low-pass filter time constant for COS. This should never need to be changed.
  • K2 – Not used in SixPotatoe
  • K5 – Speed error to angle. Increasing this value will cause SixPotatoe to lean more forward to achieve its target speed.
  • K8 – Not used in SixPotatoe.
  • K12 – Accelerometer pitch offset. There is no need to adjust this since the offset is normally set by the “Throttle Zero” adjustment — top right — on the RC controller.
  • K13 – Constrains the speed error for large angles. If this is set too high, SixPotatoe will rise too quickly and “jump up” off of the ground while it is righting.
  • K14 – Same as K5 but not constrained by the maximum angle.
  • K15 – Pitch beyond which SixPotatoe is not considered upright. This is purposefully set to a high angle value to increase the chance that SixPotatoe will try to recover rapidly from a fall.
  • K16 – Time in milliseconds that SixPotatoe must be greater than K15 to be considered on the ground.
  • K17 – If this were a PID algorithm, this would be the “D”.
  • K20 – Brightness of the LED. This must be between 0 and 256.
  • K21 – Not used for SixPotatoe
  • K30 – Sets the maximum target KPH for SixPotatoe. For example, if the maximum KPH of the motor is 10 KPH, A value of 0.6 would cause the maximum target speed for SixPotatoe to be 6 KPH.
  • K31 – Maximum KPH while lying on the ground.
  • K32 – Value for steering while on the ground.
  • K40 – Gyro correction for Yaw. This is only used while running autonomously. You can adjust this to get the turning angles exactly right.