Severson-Group / AMDC-Firmware

Embedded system code (C and Verilog) which runs the AMDC Hardware
http://docs.amdc.dev/firmware
BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

Improvements to firmware timing #305

Open npetersen2 opened 1 year ago

npetersen2 commented 1 year ago

We want to be able to run ultra-high-speed motors where our control algorithms match our simulated/modeled system assumptions. Right now, the v1 firmware timing is not very "tight," so the mathematical model/simulation does not exactly match the hardware implementation.

Issues with v1 firmware

Sensor sampling / synchronization

Control task alignment to PWM carrier

PWM duty cycle output timing

Proposed changes

I propose to fix these issues, we create a new system module (located in sys/) that has a counterpart in the FPGA. This module will be in charge of system timing. The user configures each aspect of the above sections, and it orchestrates the sensor sampling, ISR generation, and PWM output flushing.

npetersen2 commented 12 months ago

A draft architecture of the new FPGA structure:

image

codecubepi commented 1 month ago

It seems like this is implemented by the new timing manager IP. See #323 and the v1.3 release candidate. @npetersen2 I'm not sure what you want to do with this issue, it seems like a duplicate.