You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gyro task goes through the common scheduler. As a result, with a set frequency of 6400 Hz, the actual frequency varies from 4000 to 6000 Hz. This disrupts the reading of new data and filtering at the gyro frequency.
Desired Behavior
Reading gyro at gyro frequency.
Suggested Solution
voidFAST_CODENOINLINEscheduler(void)
{
// Cache currentTimeconsttimeUs_tcurrentTimeUs=micros();
//gyro taskstatictimeUs_tprevGyroDiv,GyroDiv;
GyroDiv=currentTimeUs / GyroTaskmkS;
if(GyroDiv!=prevGyroDiv){
gyroUpdate(void);
prevGyroDiv=GyroDiv;
}
//other tasks// The task to be invokedcfTask_t*selectedTask=NULL;
uint16_tselectedTaskDynamicPriority=0;
boolforcedRealTimeTask= false;
// Update task dynamic prioritiesuint16_twaitingTasks=0;
for (cfTask_t*task=queueFirst(); task!=NULL; task=queueNext()) {
// Task has checkFunc - event drivenif (task->checkFunc) {
....
Who does this impact? Who is this for?
Mainly for small drones 5 inch and less.
Additional context
In my case gyro task takes about 15mks and it rather will not affect other tasks behavior .
The text was updated successfully, but these errors were encountered:
On the oscilloscope it looks terrible. The frequency became closer to the set one, but the phase is random.
It looks like fifo will have to be done after all
Current Behavior
The gyro task goes through the common scheduler. As a result, with a set frequency of 6400 Hz, the actual frequency varies from 4000 to 6000 Hz. This disrupts the reading of new data and filtering at the gyro frequency.
Desired Behavior
Reading gyro at gyro frequency.
Suggested Solution
Who does this impact? Who is this for?
Mainly for small drones 5 inch and less.
Additional context
In my case gyro task takes about 15mks and it rather will not affect other tasks behavior .
The text was updated successfully, but these errors were encountered: