PWM update frequency

Post here to get support
Post Reply
thefred
Beginner
Posts: 6
Joined: Thu Jan 16, 2020 11:23 am

PWM update frequency

Post by thefred »

Hi All,

I was wondering if it is possible to increase the frequency with which the PWM values are published in a vanilla crazyflie.

From this post viewtopic.php?f=5&t=1405&sid=106e883fc5 ... 2a6e21d466 , I take that the PWM frequency is 328kHz, so I guess we could update the value more often than the 400Hz (https://github.com/bitcraze/crazyflie-f ... tors.h#L52) it is set to.

I understand that this also implies increasing the speed of everything else (PID controller, Kallman). Also, since tasks would run more frequently, it also would have higher power consumption, but otherwise would be more responsive, wouldn't it?

Is it as simple as changing those constants?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: PWM update frequency

Post by tobias »

It all depends on what you want to achieve? I guess you are referring to the external signal, driving external ESC? The simple solution is to enable OneShot125 which can update 2000 times per second.

Changing the system update rates will probably create more issues then it solves but you can always test and see what happens.
Post Reply