heading hold yaw correction

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
noobee
Posts: 66
Joined: Fri Feb 25, 2011 2:57 pm

heading hold yaw correction

Post by noobee »

hi

would like verify the behavior for heading hold through a magnetometer.

is positive heading in the clockwise direction like a compass heading and in the range of [-180,180]?

Code: Select all

      int16_t dif = heading - magHold;
      if (dif <= - 180) dif += 360;
      if (dif >= + 180) dif -= 360;
      rcCommand[YAW] += dif;


should the code for the yaw correction be

Code: Select all

      rcCommand[YAW] -= dif;

Post Reply