Position Loop (P Loop) Tuning 

Position Loop tuning is the final stage of motor tuning and ensures accurate following of commanded motion with minimal overshoot and optimal stability.


Complete all steps on this page.

On this page

  1. Configure the Scope
  2. Verify Channel Setup
  3. Start Tuning Trace
  4. Adjust Position Loop Gains
  5. Gain Adjustment Guidance
  6. Compare Results 


1.  Configure the Scope for Position Tuning

Open Scope Axis C and configure the Function Generator:

Function Generator settings 

    • Apply To: Position
    • Function: Square Wave
    • Amplitude: 10000 counts
    • Frequency: 2 Hz

This square‑wave position command forces the motor to move sharply back and forth, which makes position loop errors easy to see.

2.  Verify Channel Setup for Position Measurement

On the Settings tab, confirm the following channel assignments:

    • Ch1 – Commanded Position (pink)
    • Ch2 – Active Load Position (blue)
    • Ch3 – Ch6: Disabled

This ensures the graph compares commanded vs actual position clearly.


Return to Top

3.  Start the Tuning Trace

Press Start in the Function Generator.

The Scope begins recording motion while the motor follows the position square‑wave.
The graph displays:

    • Pink: Commanded Position
    • Blue: Actual Position

Observe:

    • Overshoot
    • Undershoot
    • Settling time
    • Smoothness of transitions

4.  Adjust Position Loop Gains

Open the Gains tab (center bottom).
Adjustable Position Loop parameters are:

    • Pp (Position Proportional Gain)
    • Aff (Acceleration Feed‑Forward)
    • Vff (Velocity Feed‑Forward)

Interpretation 

Initial values example:

    • Pp = 1000  
    • Aff = 0  
    • Vff = 16384

This produced noticeable overshoot and lag.


After adjustment:

    • Pp = 500  
    • Vff = 12000  


Return to Top

5.  Gain Adjustment Guidance

Pp (Position Proportional Gain)

    • Increases stiffness and responsiveness
    • Too high → overshoot / oscillation
    • Too low → sluggish following
    • Reducing Pp from 1000 → 500 improved stability

Vff (Velocity Feed‑Forward)

    • Helps during fast moves
    • Reduces following error
    • Too high → overshoot on each transition
    • Your tuning reduced Vff for smoother tracking

Aff (Acceleration Feed‑Forward)

    • Helps when the motor accelerates quickly
    • Leave at 0 unless necessary

6.  Compare Results and Repeat if Needed

After adjusting Pp and Vff, press Start again to re-test.
Repeat the fine‑tuning process until:

Desired outcome:

    • Blue trace matches pink closely
    • No oscillation
    • Minimal overshoot
    • Smooth transitions


Return Home