This build level closes the speed loop
in addition to the current loop.
- Go to the settings.h file and
change the definitions to match the following (closed loop speed control, debug
buffers on, 8000 cycles per set point):
- If desired, go to the
single_chip_servo.c file and modify the Speed 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 8 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 (Iq,
Id, and speed graphed from top to bottom). Notice how Iq ramps and stays high
during the speed ramps and goes close to zero to maintain speed. The speed graph
at the bottom shows that the speed ramps to the requested value and then levels
out. The ramp is slope is determined by the MAX_SPD_CHANGE definition in the
settings.h file. You'll notice that during the ramp from 750 to -500 and then
-750 that -500 was basically skipped because the ramp wasn't steep enough to
reach it within the cycles allowed.