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

Validate that the Control Task Doesn't interfere with PWM Signals #31

Open
davinbirdi opened this issue Oct 7, 2022 · 4 comments
Open
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@davinbirdi
Copy link
Contributor

davinbirdi commented Oct 7, 2022

Talking about how we utilized RTT to stop the printf delay that was causing the beat sounds while running DPR Solenoid tests.

RTT solves the problem by removing that delay, but I do not remember testing if the delay is still there if the control task takes a long time.

How to test:

  • Use a very large delay in the control loop and monitor if the PWM frequency changes

Things to investigate:

  • How I am controlling the PWM task, am I using a Task Start & Stop? Which delays am I using, an absolute delay (xTaskDelayUntil() vs. vTaskDelayUntil())
@davinbirdi davinbirdi self-assigned this Oct 7, 2022
@davinbirdi davinbirdi added this to the DPR Prototype milestone Oct 7, 2022
@davinbirdi
Copy link
Contributor Author

@Amarantheum I mentioned this today and we try to figure out a systematic way of testing the timing.

@davinbirdi
Copy link
Contributor Author

https://www.freertos.org/vtaskdelayuntil.html

This is the FreeRTOS API Reference/Documentation, I save this as a bookmark as I come back to it a lot: https://www.freertos.org/a00106.html

@Esouder
Copy link
Member

Esouder commented Oct 7, 2022

This should ultimately not be an issue (I guess at least in this specific case) though since once we have SPI working we can make the high-side switches handle all the PWM, right?

@Amarantheum
Copy link
Contributor

I was thinking that maybe a way we could test this is by writing to a buffer every time a task executes. Assuming getting a timestamp takes a small number of cpu cycles, writing to a buffer and updating a pointer into the buffer to write the next task completed and time stamp should take only a few cpu cycles. This is because writing is not like read where the cpu has to wait for slower cache performance for the value to be in the cpu register and the C compiler should optimize a counter in a while loop to just use a register and not read/write to a location in memory every time (unless you use the volatile keyword).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants