I am new on the forum…
A few years ago (2014) I made an arduino project, which basically consisted in coding from scratch a hobbyking KK3 board to be used as an R/C aircraft 3 axis gyro with control parameters being able to change in function of airspeed which was read by a pitot tube.
Thing is, back in its time, the final code showed a slight issue with servo jittering and offset precission (Lack of, even with gyros disabled) so I never tested it on an airplane, but other than that, it worked fine.
I had thought for quite a long time that these issues had to do with the arduino servo library being not-efficiently coded…
Then I just read somewhere (As I am heading into a new similar project) that the micros() function has a precission of just 4us… that could have been the source of the precission issue.
Mind that I read the PWM signals with PinChangeInt library ISRs and use the servo library to output the PWM to the servos. I have attached the code related to that project, maybe some friendly soul will check whether I am on the right track with the precission issue or maybe there’s something entirely different going wrong with my code…
Thanks in advance!
FBW_FINAL.ino (12.6 KB)