System Tuning
This guide covers the control loop tuning parameters for optimizing ASI BAC motor controller performance.
Control Loop Overview
ASI BAC controllers use multiple control loops to regulate motor operation:
| Control Loop | Function |
|---|---|
| Current Regulation | Controls phase current feedback (FOC) |
| PLL Regulation | Tracks sensorless angular position |
| Speed Regulation | Controls output current based on speed setpoint |
| Acceleration Control | Shapes acceleration and deceleration behavior |
Current Regulation Control Loop
The phase current control loop manages current feedback for Field-Oriented Control (FOC). Adjusting current regulation affects overall acceleration and current overshoot behavior.
Bandwidth Tuning
Current Regulator bandwidth calculates the feedback gains:
Current regulator Kp(Proportional gain)Current regulator Ki(Integral gain)
| Bandwidth Effect | Result |
|---|---|
| Higher bandwidth | Faster current correction, less overshoot, less integrator windup |
| Too high | Instability, audible noise, overcurrent faults |
| Too low | Poor acceleration performance |
Recommended Values
| Motor Type | Current Regulator Bandwidth |
|---|---|
| Higher speed motors | 3000-5000 |
| Lower speed motors | 1500+ |
General Guideline
Maintain sufficiently high Current Regulator bandwidth for desirable acceleration and performance while avoiding instability.
Manual Tuning
If Current Regulator bandwidth is set to 0, you can manually set individual PI gains:
| Parameter | Rise Time | Overshoot | Settling Time | Steady-State Error | Stability |
|---|---|---|---|---|---|
| Increase Kp | Decrease | Increase | Small change | Decrease | Degrade |
| Increase Ki | Decrease | Increase | Increase | Eliminate | Degrade |
Manual Tuning
Manual PI tuning is not recommended. Use bandwidth tuning when possible.
PLL Regulation Control Loop
The Phase-Locked Loop (PLL) tracks sensorless angular position for motor flux frequency calculation and controls output frequency.
Bandwidth Effects
PLL bandwidth calculates:
PLL Kp(Proportional gain)PLL Ki(Integral gain)
| Bandwidth Effect | Result |
|---|---|
| Higher bandwidth | Faster lock time, faster frequency adjustment |
| Too high | Instability, output noise, audible noise, vibrations, jitter amplification |
| Too low | Jitter removed from reference clock |
Tuning Guidelines
| Motor Type | PLL Bandwidth |
|---|---|
| Higher electrical frequency motors | 300+ |
| Geared hubs, mid-drive motors | 300+ (prevents instantaneous phase overcurrent faults) |
| Lower electrical frequency motors | Lower values tolerable |
| Direct drive hubs | Lower values tolerable |
Adjustment approach: If experiencing jitter, adjust by increments of 100 (up/down), up to 500.
PLL Damping
PLL damping affects the auto-calculated PLL Kp factor. Increasing damping increases the Kp component.
Manual Tuning
If both PLL bandwidth and PLL damping are set to 0, you can manually set:
PLL Kp oldPLL Ki old
| Parameter | Rise Time | Overshoot | Settling Time | Steady-State Error | Stability |
|---|---|---|---|---|---|
| Increase Kp | Decrease | Increase | Small change | Decrease | Degrade |
| Increase Ki | Decrease | Increase | Increase | Eliminate | Degrade |
Speed Regulation Control Loop
The speed regulation loop controls output current based on measured speed to achieve the target speed setpoint.
Key Parameters
| Parameter | Function |
|---|---|
| Speed regulator Kp | Proportional gain for speed error |
| Speed regulator Ki | Integral gain for speed error |
Tuning Effects
| Parameter | Rise Time | Overshoot | Settling Time | Steady-State Error | Stability |
|---|---|---|---|---|---|
| Increase Kp | Decrease | Increase | Small change | Decrease | Degrade |
| Increase Ki | Decrease | Increase | Increase | Eliminate | Degrade |
Step-by-Step Tuning Procedure
Initialize Values
Set Speed regulator Ki to 0 and Speed regulator Kp to 1.
Test Step Response
Under intended operating conditions/load, induce a step response:
- Command full throttle from 0 speed
- Observe system acceleration
Adjust Kp
- Too fast/aggressive or oscillating: Reduce Kp by 25%
- Too slow: Double Kp (up to less than 8)
- Repeat until proportional response is satisfactory
Add Integral Gain
Set Speed regulator Ki to 1 and test at target speed setpoint.
Adjust Ki
- Still undershooting: Double Ki (up to less than 128)
- Overshooting: Reduce Ki by 25%
- Repeat until steady-state is satisfactory
Final Balance
Test response from various speeds. If system became too aggressive with Ki, reduce both Kp and Ki proportionally.
Tuning Goals
- Kp goal: Set as low as tolerable for desired response without overshooting target speed
- Ki goal: System settles at setpoint without oscillating above/below
Acceleration Control
Acceleration is primarily affected by:
- Available torque-producing current
- Imposed power limits
- Acceleration ramp limits
- Current regulation control loop
- Speed regulation control loop (for speed-limited modes)
Motor Limitations
If acceleration is insufficient despite tuning, the application may need a motor with better torque constant (Kt in Nm/A) or more current than the controller can output.
Speed Regulator Modes
| Mode | Value | Ramp Rates Used |
|---|---|---|
| Speed mode | 0 | Speed mode ramps |
| Torque mode | 1 | Torque mode ramps |
| Torque with speed limiting | 2 | Torque mode ramps |
Torque Mode Ramp Rates
Acceleration Ramps
| Parameter | Function |
|---|---|
| Positive motoring torque ramp | Current ramp-up when commanding (throttle on) |
| Negative motoring torque ramp | Current ramp-down when reducing (throttle off) |
| Pedalec positive motoring torque ramp | Pedal sensor current ramp-up |
| Pedalec negative motoring torque ramp | Pedal sensor current ramp-down |
Guidelines:
- Too low: Acceleration becomes jarring, may damage mechanical components
- Too high: Acceleration seems slow (positive ramp) or continues too long (negative ramp)
- To disable: Set values to 1 ms
The ramp is linear and specifies the time (in ms) to reach peak current from zero (positive) or zero from peak (negative).
Speed Limit Ramp Time
For Speed regulator mode 1 (Torque with speed limiting):
Speed limit ramp time limits acceleration relative to speed limit by limiting current output.
Use cases:
- Improve engagement in geared hub drives
- Reduce clutch wear
- Take up slack in chain drive systems
- Reduce instantaneous overcurrents when accelerating with drivetrain slack
Note: Linear ramp only takes effect from 0 RPM. Set to 0 to disable.
Braking Ramps
| Parameter | Function |
|---|---|
| Positive braking torque ramp | Regen current ramp-up |
| Negative braking torque ramp | Regen current ramp-down |
Wheel Lock Prevention
Setting Positive braking torque ramp too low can cause wheel lock-up. Recommended: 200 ms or longer.
Speed Mode Ramp Rates
For Speed regulator mode 0 (Speed mode):
| Parameter | Function |
|---|---|
| Speed mode positive acceleration | Target acceleration rate |
| Speed mode Regen ramp | Target deceleration rate |
Value interpretation:
| Value | Meaning |
|---|---|
| 16 | 1× rated RPM in 1 second |
| 32 | 0.5× rated RPM in 1 second |
| 8 | 2× rated RPM in 1 second |
Recommended values:
- Speed mode Regen ramp: 48 (good default)
- Speed mode positive acceleration: 4, 8, or 16 (starting points)
Speed Mode Requirements
Speed mode positive accelerationshould be less thanSpeed mode Regen rampRegeneration battery current limitmust be > 0% for regen ramp to functionFeatures bit 13(engine braking) must be enabled when Control command source ≠ 0
Key Parameters Reference
Current Regulation
| Address | Parameter | Function |
|---|---|---|
| 110 | Current Regulator bandwidth | Bandwidth for auto-calculation (Hz) |
| 111 | Current regulator Kp | Proportional gain |
| 112 | Current regulator Ki | Integral gain |
PLL Regulation
| Address | Parameter | Function |
|---|---|---|
| 113 | PLL bandwidth | Bandwidth for auto-calculation (Hz) |
| 114 | PLL damping | Damping factor for Kp |
| 115 | PLL Kp | Proportional gain |
| 116 | PLL Ki | Integral gain |
Speed Regulation
| Address | Parameter | Function |
|---|---|---|
| 117 | Speed regulator Kp | Proportional gain |
| 118 | Speed regulator Ki | Integral gain |
| 119 | Speed regulator mode | 0=Speed, 1=Torque, 2=Torque+Limit |
Acceleration Ramps
| Address | Parameter | Function |
|---|---|---|
| 120 | Positive motoring torque ramp | Acceleration ramp (ms) |
| 121 | Negative motoring torque ramp | Deceleration ramp (ms) |
| 122 | Positive braking torque ramp | Regen ramp-up (ms) |
| 123 | Negative braking torque ramp | Regen ramp-down (ms) |
| 124 | Speed limit ramp time | Speed-based current limit (ms) |
| 125 | Speed mode positive acceleration | Speed mode accel rate |
| 126 | Speed mode Regen ramp | Speed mode decel rate |
Next Steps
- Configure Motor Setup before tuning control loops
- Review Braking Systems for regen configuration
- Set up Protection Systems for safe operation