Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop-rate scheduled tasks always slip at 800Hz #13757

Closed
andyp1per opened this issue Mar 8, 2020 · 2 comments
Closed

Loop-rate scheduled tasks always slip at 800Hz #13757

andyp1per opened this issue Mar 8, 2020 · 2 comments

Comments

@andyp1per
Copy link
Collaborator

andyp1per commented Mar 8, 2020

I added a dummy callback to the runcam driver (doesn't matter where it is this was just convenient):

void AP_RunCam::dummy() {
}

I then included this in the vehicle schedule table at the loop rate:

SCHED_TASK_CLASS(AP_RunCam, &vehicle.runcam, dummy, LOOP_RATE, 50)

I then set SCHED_DEBUG = 2 and SCHED_LOOP_RATE = 800

The empty task is then reported to always slip:

Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)
Scheduler slip task[51-dummy] (2/1/50)

My suspicion is that this is because 800Hz is close to the backend IMU rate of 1000Hz. 800Hz gives a tick length of 1250us and the IMU period is 1000us. Since we always wait for an IMU sample before scheduling the next tick if we overrun by 250us I think we will always slip loop rate tasks. Just a theory.

@tridge @peterbarker I could use some help figuring this out

Version
4.0.4-dev

Platform
[X] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

Airframe type
All

Hardware type
Tested on an omnibusF4pro

@andyp1per
Copy link
Collaborator Author

Effectively fixed by #13758

@andyp1per andyp1per linked a pull request Mar 8, 2020 that will close this issue
@IamPete1
Copy link
Member

fixed by #13741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants