ECS or Local HMI can send mode, position reference, velocity reference.
All motion control logic is located in Routine Control_position
Wait for position
...
States of position control
...
command
Wait for mode
Routine Az_Mode sets mode based on ECS or Local commands.
Control_position is active only in Local PTP or Remote PTP, Jog, Offset.
Wait for command
ECS sends new ID and position ID or new position reference from ECS or Local.
Each position command is change in ID or position reference are executed and replaces any current move.
New move
Verify position reference within travel limits.
Initialize
Reset state control
Validate motion parameters
Calculate
...
Starting speed = minimum(0.05 * Position error, 1° / sec)
...
replace any current operation.
Reset
Reset position logic when:
Entering or leaving PTP mode
Entering tracking mode
PLC first scan
Fault reset
Point to Point or Offset or Remote Jog move
Position reference
Assign Position Reference based on mode.
Check for valid Position Reference.
Check for valid move direction.
Check if Actual Position crossed Position Reference.
Position error
Calculate Position Error.
Check if Position Error is within tolerance.
Wait for motion command
change in ECS command ID
change in Position Reference
Stop move
Manual command, available only in PLC editor
New move
Initialize
Reset state controls and parameters.
Validate motion parameters.
Calculate
Starting Speed (based on mode and Position Error).
Accel, decel, distance & time
Direction of travel
Start move
Move in Progress = onON
End move
Wait for
Position Error < stop lead distance
Actual Position crossed Position Reference (Position Error changed sign)
Safety stop
Entering Tracking Mode
Cancel move
Move in progress = OFF
While move in progress
Control speed
Initial Speed Reference = Starting Speed
While position error < near distance : Speed = near speed
While position error < creep distance : Speed = creep speed
While position error < final distance : Speed = final speed
Control acceleration
While position error > 3° (Ramp control)
Accel = 100 RPM / sec (~0.1° / sec)
Decel = 50 RPM / sec
Jerk = 20 RPM / sec / sec (S-curve)
While position error < 3° (Quick response for stopping)
Accel = 500 RPM / sec (~0.5° / sec)
Decel = 500 RPM / sec
Jerk = 500 RPM / sec / sec (no curve)
When Position error < stop distance
or Position error crosses 0
or Safety enabled OFF
End move
Move in progress = OFF
If Tracking mode
...
Tracking mode
Position Error smoothing
Selectable
First order low pass filter with tunable time constant.
Reduce response to encoder jitter
Speed reference
= Velocity + (Position error * proportional gain)
Tracking motion control
While position error > 10° | Max output = +/- 0.25° / sec | Limit speed overshoot |
While position error > 30° | Max output = +/- 0.75° / sec | Allow quick recovery |
While position error < 1° | Max output = +/- 0.20° / sec | Limit speed overshoot |
While position error < 0.1° | Gain = 0.04 | Allow quick recovery |
While position error > 0.2° | Gain = 0.10 | Reduce response to transients |
While position error > |
...
0.5° |
...
Fast response for controlling position
Accel = 200 RPM / sec (~0.2° / sec) | Fast response for controlling position |
While position error < tracking range (0.5°) |
...
Accel = 10 RPM / sec (~0.05° / sec) | Slow response for smooth control | |
While position error < 0.05° |
Slow response for smooth control
Accel = 5 RPM / sec (~0.005° / sec) |
If not Tracking
and Move in progress OFF
...
Slow response for smooth control |
Speed output control
If Tracking or Move in progress
Send Position Speed Reference to Control_Speed
else Speed reference = 0
...
Control Loop
...