Skip to content

Timing Manager Tutorial#112

Merged
Known4225 merged 57 commits intouser/codecubepi/tm-sched-updatesfrom
user/known4225/tm-tutorials
Dec 20, 2024
Merged

Timing Manager Tutorial#112
Known4225 merged 57 commits intouser/codecubepi/tm-sched-updatesfrom
user/known4225/tm-tutorials

Conversation

@Known4225
Copy link
Contributor

This PR closes #100.

This Timing & Sensors tutorial expands upon the VSI tutorial and enables the ADC sensor to observe the effects of the timing manager. Users will learn how certain tuning parameters (mainly the User Event Ratio and the PWM frequency) can affect the loop time of their control tasks.

@Known4225 Known4225 requested a review from codecubepi November 6, 2024 20:30
@Known4225 Known4225 requested a review from elsevers as a code owner November 6, 2024 20:30
Copy link
Contributor

@codecubepi codecubepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Known4225 , excellent start!

Please review my feedback with @elsevers .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment from @elsevers ... do we have the original SVG for this image somewhere? Likely a request for @npetersen2

Copy link
Contributor

@codecubepi codecubepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the first round of changes @Known4225 . Here are a few more things I caught.

@Known4225 Known4225 changed the base branch from main to user/codecubepi/tm-sched-updates November 12, 2024 20:41
@Known4225 Known4225 requested a review from codecubepi November 12, 2024 22:56
@Known4225 Known4225 requested a review from elsevers December 16, 2024 15:48
Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really coming together! See my inline edits below.

Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More edits.

```

The ADC time to acquire refers to how long between the trigger for the ADC to start sampling to when it was complete.\
The ADC time since done is the "staleness" of the data, it refers to how long ago the ADC reported done. This may be useful when controlling a motor with careful timing considerations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things:

  1. Write this as a deliberate step that a user should take (i.e., program your code onto the AMDC and measure the sensor acquisition timing using the newly created ctrl sensor timing command).
  2. Move it down into the Sensor Timing subsection. I suggest that you start the Sensor Timing subsection by telling the user to do two things:
    1. Run ctrl sensor timing to obtain sensor acquisition timing information
    2. Run ctrl stats print to obtain run time and loop time

@Known4225
Copy link
Contributor Author

Known4225 commented Dec 19, 2024

Change requests per 12/19 meeting with @elsevers

1. Initial timing diagrams in Timing Manager Modes section

  1. Add label for PWM carrier
  2. Add multiple boxes for tasks. One of the boxes should be labeled control task (the rest are labeled task 1, task 2, ..., and are blue)

image

2. Update Construct system timing diagram diagram

  1. move the control task to the right and add text annotation showing it as 20.805 us
  2. Fix sensor collection time
  3. TASK_UPDATES_PER_SEC --> TASK_CONTROLLER_UPDATES_PER_SEC
  4. Update PWM Frequency, Sensor collection time, and the Timing Manager event ratio to match the inequalities.
  5. Show the control task box in the same manner as you are showing it in the previous timing diagram, but do not show the blue task boxes
    image

3. Edit inequality 3

RHS should be Total Task Run Time + Sensor Sample Acquisition Time

image

@elsevers
Copy link
Contributor

@Known4225, I have made edits to the tutorial in #123. Let's get these merged in and then have you address this feedback. We're getting close!

@Known4225 Known4225 requested a review from elsevers December 20, 2024 20:35
Copy link
Contributor

@elsevers elsevers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! let's get this merged.

@Known4225 Known4225 merged commit 341f3ae into user/codecubepi/tm-sched-updates Dec 20, 2024
@Known4225 Known4225 deleted the user/known4225/tm-tutorials branch December 20, 2024 22:31
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 this pull request may close these issues.

Update docs for new timing manager operation and configuration

3 participants