Control loop hard rate

Hi everyone,

I would like to know if it is possible to set the control loop rate to a hard defined value.

In mc_att_control_main.cpp the control loop poll the gyros, which results in a loop rate about 250Hz. “About”, because when I logged the rate, the sampled loop time varied between 3ms and 6ms with a mean at 4.1ms.

A fixed rate would be better to perform some discrete filtering etc…

Also, is it possible to increase the gyro frequency ? to result in a faster control rate.

Thanks,

Romain

Yes it’s possible to increase the gyro frequency and we’re (slowly) working on making that possible upstream. We need to split the gyro and delta angle publications first.

It’s still better to have the control loop governed by the gyro publication. What’s your rate controller going to do without new rate data? What we should do is look at the source of the publication to remove as much jitter as possible and achieve the desired rate.

Hi, how to logged this rates, thanks

I got this
if mc_att_control.cpp line 1762, just log dt!

Hi Dagar,
In order to increase the attitude loop frequency of the ‘mc_att_control_main.cpp’ we need to increase the publishing rate of the gyros. How to increase the publishing rate of the gyros ? What are the limitations ?
As the attitude loop needs the IMU as well, do we need to do something regarding the imu ?