Increase uORB publishing frequency


As mentioned in the PX4 uORB messaging page, most of the sensors and modules run at 250Hz and we can check the publishing frequency using uorb top command.

Does anyone know how to increase the uORB publishing frequency to 400Hz (ex: EKF2, position controller, attitude controller ) so as my vehicle will react faster ?

Thank you !

This is a very broad statement, and raising the loop frequency is only one part of the equation. For a good controls response, the lag between a sensor input and a motor output is most important and not the actual loop rate. This being said a higher loop rate usually means that the worst lag is 1/loop rate, so therefore the higher the loop rate, the shorter the lag.

In current setups there are more things at play such as the gyro filter frequencies as well as control gains, etc… In my opinion you can increase your performance (e.g. react faster) considerably if you tune the gyro filter frequencies and control loops without having to change the overall publishing rate.

There are currently efforts under way to increase some of the loop to run faster, mainly reading from the sensor and the attitude rate loop. You can see one pull request in that direction here: and we are also talking about this topic quite a bit on the weekly dev calls. If you’re interested feel free to join and learn more about what is going on.

If you want to try on your own, you would have to change the publishing rate of the gyro drivers and then make sure it all flows through the system correctly. However, it’s likely that you’ll run into various issues or edge cases, one of them being CPU load too high.

Thanks for your suggestions, it helps a lot.

My quadrotor did have a lag problem while automatically tracking a target, and that’s why I wondered if the control loop rate could be increased or not.

I think I can follow the following page to tune the gyro filter frequency, but I have no idea how to tune the control loops, could you provide some directions ?

See here:

OK, I will take a look, thank you!