Name :S-type acceleration and deceleration positioning control pulse output
Symbol:PTO_POSITION_CTRL_S
Illustrate:
When the function block is enabled, the positioning control will be performed by S-type acceleration/deceleration (7 stages), and when the target frequency and target acceleration cannot be reached, it will be automatically reduced.
Image:
Parameter:
| Parameter | Statement | IN/OUT | Parameter role | Illustrate | Default value |
|---|---|---|---|---|---|
| OUTPORT | UDINT | IN | Pulse output port | 0-7 | not |
| EXECUTE | BOOL | IN | The function block is enabled | Rising edge trigger (after triggering, it cannot be triggered again if it is not completed) | not |
| DESFREQ | UDINT | IN | Target frequency: UnitsHz | 1-200KHz;0:Use default values (automatically reduce frequency when target frequency is unreachable, perform triangle control) (load on EXECUTE rising edge) | Yes/100 |
| STARTFREQ | UDINT | IN | Start Frequency: UnitsHz | 0-200KHz(The target frequency is not exceeded, and it is processed as 0 when exceeded) (loaded on the rising edge of EXECUTE) | Yes/0 |
| ENDFREQ | UDINT | IN | End Frequency: UnitsHz | 0-200KHz(The target frequency is not exceeded, and it is processed as 0 when exceeded) (loaded on the rising edge of EXECUTE) | Yes/0 |
| DESTACC | UDINT | IN | Target acceleration/deceleration rate:Hz/ms | Positive: less than maximum acceleration (1000Hz/ms), 0: Uses the default value (automatically decreases when target acceleration/deceleration is unreachable) (loaded on EXECUTE rising edge). | Yes/100 |
| JERK | UDINT | IN | Acceleration rate:Hz/ms | Positive: less than the maximum jerk(100Hz/ms);0:Use the default value (EXECUTE Rising edge) | Yes/10 |
| PULSENUM | DINT | IN | Number of pulses + direction | Non-0: Positive - Forward Motion, Negative - Backward Motion (Loaded on EXECUTE Rising Edge) | not |
| ABORT | BOOL | IN | Emergency stop triggering | TRUE:Emergency stop enabled (irrevocable after enabled, and cannot be re-enabled until the processing is completed) | Yes/FALSE |
| STOPTIME | UDINT | IN | Emergency stop time: Unitsms | Stop the pulse output within the set time. NON-0;0: RUNS BY DEFAULT (LOADED ON EXECUTE RISING EDGE) | Yes/5 |
| DONE | BOOL | OUT | Positioning control completion signs | TRUE:All pulse outputs are complete, positioning control is performed (status is maintained for only one cycle) | Yes/FALSE |
| BUSY | BOOL | OUT | Positioning controls the operating state | TRUE:Positioning control is executing normally, FALSE: Positioning control is not executed, execution is complete, or emergency stop is being made | Yes/FALSE |
| CMDSTOP | BOOL | OUT | Emergency stop status | TRUE:During the emergency stop, the pulse frequency has not been reduced to 0 (at this time, it is not possible to respond to the new axis start control)) | Yes/FALSE |
| ERROR | BOOL | OUT | Error flags | TRUE:There was an error with the function block call | Yes/FALSE |
| ERRORID | DINT | OUT | Error codes | 0:Normal, Other: Error code value | Yes/0 |
Error codes:
| Error codes | Illustrate |
|---|---|
| 0 | Inerrancy |
| 1 | Invalid pulse port |
| 2 | The pulse port is busy/pre> |
| 3 | The pulse port is performing a stop action |
| 7 | The frequency exceeds the maximum allowable range |
| 10 | Acceleration exceeds the maximum allowable value |
| 13 | The jerk exceeds the maximum allowable value |
| 14 | The S-curve parameter is incorrect |
Example:
LD:
ST:
Interpretation:
A pulse of 0 for OUTPORT means that the operation port has 0 pulse output; EXECUTE is the rising edge, which means that this function block is executed; DESTFREQ is 10000, which means that the maximum target pulse frequency in the S-type acceleration and deceleration positioning control process is 10000Hz, and the port outputs the pulse at a maximum rate of 10000Hz (if the target frequency is not reached, the frequency will be automatically reduced); A STARTFREQ of 100 indicates that the initial pulse output frequency of the function block is 100Hz. ENDFREQ is 50, which means that the output frequency of the function block is 50Hz after the pulse output is completed; DESTACC is 800, which means that the maximum acceleration/deceleration speed of the pulse output frequency is 800Hz/ms (plus/ (1) In the acceleration section: the acceleration gradually increases from 0 to the maximum acceleration (the pulse output frequency is gradually accelerated from the starting frequency to the maximum target frequency) ;(2) the constant velocity section: the acceleration is 0, and the constant frequency output is maintained (if there is a constant velocity section) ;(3) the deceleration section: the deceleration gradually increases from 0 to the maximum deceleration (the pulse output frequency gradually decelerates from the maximum target frequency to the end frequency); If the JERK value is 50, the pulse frequency acceleration will change by 50 Hz/ms, and the maximum acceleration and deceleration of the pulse frequency will not exceed 800 Hz/ms (DESTACC) (if the target acceleration DESTACC is not reached, it will be automatically reduced) PULSENUM is 100000, a positive number, indicating forward movement, and the number of output pulses in the whole S-type acceleration and deceleration positioning control process is 100000; If ABORT is FALSE, it means that the function block is operating normally and does not perform emergency stop. STOPTIME is 10, which means that after the emergency stop starts, it will decelerate to 0 within 10ms. If DoneOut is TRUE, the positioning control is executed. If BusyOut is TRUE, it means that port 0 is executing the positioning control pulse output, if it is FALSE, the positioning control pulse output cannot be executed, and bError will be set to TRUE. If CmdStopOut is TRUE, the emergency stop is in progress and the pulse output frequency has not been decelerated to 0, and if it is FALSE, the emergency stop has not been executed or has been completed. If ErrorOut is TURE, it means that there is an error in the function block, and the output of the S-type acceleration and deceleration positioning control pulse cannot be executed, and the error code is ErrorIDOut.