How does maghold work ?
Posted: Sun Sep 07, 2014 7:29 pm
Hello all,
i try to understand how maghold works. I don´t use Arduino IDE for Programming. I use Bascom on an Atxmega. My MAG is a CMPS10 I2C and i gives me values between 0 and 360.
My Question is:
For example the desired degrees are 0°. How does multiwii code prevent that the actual degrees jump to 360° ? My code use a PID to adjust a PWM. There is no Problem if the desired degrees are for example 100°. But if the desired degrees are 0° the PID Controller adjust the PWM so far that the actual degrees become for a little moment 360 - 355 °. So the Servo ( PWM ) turns on full rotation until the degrees are nearly 0°.
How Multiwii handles this ?
Kind Regards
Kay
i try to understand how maghold works. I don´t use Arduino IDE for Programming. I use Bascom on an Atxmega. My MAG is a CMPS10 I2C and i gives me values between 0 and 360.
My Question is:
For example the desired degrees are 0°. How does multiwii code prevent that the actual degrees jump to 360° ? My code use a PID to adjust a PWM. There is no Problem if the desired degrees are for example 100°. But if the desired degrees are 0° the PID Controller adjust the PWM so far that the actual degrees become for a little moment 360 - 355 °. So the Servo ( PWM ) turns on full rotation until the degrees are nearly 0°.
How Multiwii handles this ?
Kind Regards
Kay