This build level is the first to close
the loop using the Phase Current and Angle/Position feedback.
- Go to the settings.h file and
change the definitions to match the following (closed loop current control,
debug buffers on, 8000 cycles per set point):
- If desired, go to the
single_chip_servo.c file and modify the Iq set point array. Default values shown
below.
- Build the project in Debug mode,
then load it into MAIN_Cortex_R5_0_0.
- Once the project is loaded, open
the 'single_chip_servo.c' file and find the following line, then right-click and
select 'Run to Line'.
- Running to this line allows the
control code to run through the eight different setpoints and fill up the debug
buffer so that we can view the graph.
- Check
the output by importing the following graphs:
- Example output shown below
(Alpha, Beta, Iq, and Id graphed from top to bottom). Notice how the Iq graph
matches the setpoints given above in the setpoint array and that Id is
controlled close to 0 as requested: