anshchawla521 / DIY_FC

GNU General Public License v3.0
0 stars 1 forks source link

Frequency mis match #3

Closed anshchawla521 closed 1 year ago

anshchawla521 commented 1 year ago

PID frequency -2000hz Motors - 50 hz Servo command call frequency -2000hz

anshchawla521 commented 1 year ago

to solve the above issue we can either increase the frequency of pwm signal to 490 hz as ESC dont care about frequency and only the width of pulse so max theoretical frequency for 2ms width signal would be 500 hz but actual max would be less than that so that the ESC can differentiate between pulses.

OR we can switch to ONESHOT125 with max frequency of 4000hz(theoretical) and operate it on 2khz(PID loop frequency)

anshchawla521 commented 1 year ago

Fixed in Commit 5ac0893 by adding oneshot125 although in crude but safe manner that what make the motors stop if the code crashes