vcu icon indicating copy to clipboard operation
vcu copied to clipboard

feat(drs): set up timer control for DRS servo

Open t-bre opened this issue 3 years ago • 0 comments

Description

  • The DRS servo moves one of the parts of the rear wing to change its aerodynamic properties.
  • The servo we have is the MG996R.
  • The servo is controlled by a pulse of between 1-2ms at a frequency of 50Hz (see datasheet).
  • The length of the pulse controls the servo angle.
  • For DRS, we want the ability to have the servo in one of two possible (ideally configurable) positions.

Tasks

  • [ ] Modify VCU.ioc to set up a pin-connected hardware timer for PWM and re-generate code.
  • [ ] Add a new software module for DRS and write some code to allow the servo position to be controlled.
  • [ ] Write some kind of testbench.
  • [ ] Test pulse width using oscilloscope.
  • [ ] Test control of actual servo on rear wing.

Additional Notes

  • When re-generating code, delete the Makefile which gets generated in src - we have our own Makefile in the project root. If it doesn't build, check what was added to the generated Makefile and add it to our one.

t-bre avatar Nov 01 '22 18:11 t-bre