Severson-Group / docs.amdc.dev

Source for the AMDC Platform documentation website
https://docs.amdc.dev/
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Update docs for new timing manager operation and configuration #100

Open npetersen2 opened 5 months ago

npetersen2 commented 5 months ago

Per our discussion on Aug 12, 2024: we plan to add one more docs page, plus two one new tutorial:

New arch page

  1. New architecture page after System which explains the timing manager system from a maintainers perspective.
    • Completed by Patrick, new file here

New tutorials - Edited by @codecubepi, 10/8/2024

  1. New tutorial (right after VSI tutorial) which builds on the VSI tutorial and uses the uInverter hardware for the testbed. It explains how sensors work on the AMDC, how they interface to the Timing Manager and the PWM generation, how to enable/disable.
    • Since users will have just completed the VSI tutorial with a uInverter, I think it would make a lot of sense to write this tutorial around the analog/ADC sensor interface (not all users will go right into the AMDS/eddy current sensor).
    • Patrick has provided a template/outline for this new tutorial here.
  2. The new tutorial should start with the basics of the sensor interace, and then get into the more advanced features of the timing manager: configuration options (sub-rates, modes of operation for ISR, etc), performance of sensors, and how to profile their operation (read timer count from IP)

Other

I've already updated the TOC links for the new pages as well as graphics to include the timing manager. I believe the only thing remaining is the Sensors tutorial. PR for this branch/issue is already open (draft) here:

Originally, this issue said to write two new tutorials, but Nathan and I discussed merging them into one, so that users can learn all about the timing manager in one tutorial, and just stop reading once they get to the advanced features if they don't need to apply them.

Known4225 commented 1 week ago

In 10/18 meeting with @elsevers , we are thinking we'll do the following for our tutorial 1 so that we don't even require the user to have a uInverter:

  1. One really simple tutorial on using AMDC timing manager + task + ADC and no additional hardware. Outline:

    • Story/theory:
      • Introduce goals of the timing manager from the perspective of VSI + hardware command for changing PWM frequency and wanting to synchronize 1) data collection to start at a value/peak; 2) only running a task once all data is collected.
      • scheduling your task for data inputs:
        • Synchronized vs legacy mode. Explain that this tutorial is covering the synchronized mode.
        • timing manager event ratio, pwm switching frequency, what happens when the us in header file is mismatched to the event ratio: not an integer multiple, too slow, faster).
    • Code it: Modify VSI tutorial code to
      • Configure task with add timing_manager_enable_sensor(ADC)
      • Set up ADC to read channel xxx
      • Set Do to be abs(Vin / 12V)
      • Enhance stats command: by using the timing manager diagnostics commands to display
        • Already present: Loop and run time (stats on the orange control task running block)
        • Sensor sampling window (duration of the gray sensors sampling block and loop timing between consecutive sensor sampling windigs)
      • Add serial port command to change the ADC clock rate
    • Demonstrate it
      1. Tell user it is optional to: Use multimeter or oscilloscope to measure output of PWM port. Can optionally attach a variable dc supply to ADC pin and change ratio
      2. with default ADC clock and PWM frequency, use stats command to measure the sensors sampling and control task running blocks
      3. change ADC clock rate and remeasure
      4. change PWM frequency and remeasure (demonstrate two cases: 1) where the task keeps its same rate 2) where new PWM frequeny causes task to run less frequently because the task period is not a multiple of the PWM period)

    Not yet spec'd out, but we plan to add a more advanced tutorial along the lines of what is described above with the AMDC + uInverter and all the different options.