GC_MOVE_PREP (176)
ID 176
Application: |
PLC |
Group: MOTION
Short description:
Function that prepares the motion parameters for the current G-code related to the motion.
Inputs (3):
no. |
type |
impulse |
mark |
notes |
1 |
B |
yes ( 0->1 ) |
exe |
Change from 0 to 1 - block activation |
2 | B | yes ( 0->1 ) | vector_end | end signal with linear interpolation in the motion trajectory smoothing mode M1008=1 |
3 | R | - | e | the max value of the deviation for the Smooth mode (dla M1008=1) |
4 | R | - | cos_f | the cos angle at which the vectors are considered to be parallel to the value of the interval (0,1) |
Outputs (19):
no. |
type |
impulse |
mark |
notes |
1 |
B |
yes ( 0->1->0 ) |
G0_ptp |
positioning without interpolation |
2 |
B |
yes ( 0->1->0 ) |
G1_vector |
positioning with linear interpolation |
3 |
B |
yes ( 0->1->0 ) |
G2_circle_cw |
Positioning with clockwise circular interpolation |
4 |
B |
yes ( 0->1->0 ) |
G3_circle_ccw |
Positioning with counterclockwise circular interpolation |
5 |
R |
- |
X |
Target position X |
6 |
R |
- |
Y |
Target position Y |
7 |
R |
- |
Z |
Target position Z |
8 |
R |
- |
I |
Position I |
9 |
R |
- |
J |
Position J |
10 |
R |
- |
vel |
Resultant movement speed |
11 |
R |
- |
vel_begin |
Initial movement speed |
12 |
R |
- |
vel_end |
End movement speed |
13 |
R |
- |
acc |
Acceleration |
14 |
R |
- |
dec |
Braking |
15 |
R |
- |
acc_jerk |
Acceleration jerk |
16 |
R |
- |
dec_jerk |
Braking jerk |
17 |
B |
no |
xy |
Selection of the plane of movement in a circle |
18 |
B |
no |
xz |
Selection of the plane of movement in a circle |
19 |
B |
no |
yz |
Selection of the plane of movement in a circle |
20 | R | - | r_out | calculated arc radius for Smooth mode (dla M1008=1) |
21 | B | no | smooth | switched on at the start of the motion VECTOR, if an arc will be executed along a straight line in the motion trajectory smoothing mode, switched off after the vector_end signal |
22 | B | yes ( 0->1->0 ) | Error | error signal |
23 | I | - | Error_ID |
Error ID: 1 - the current g-code is not of the G type, the error concerns the R3091 register, |
Settings (X):
no. |
type |
impulse |
mark |
notes |
1 | I | - | virt_X | |
2 | I | - | virt_Y | |
3 | I | - | virt_Z | |
4 | R | - | acc | |
5 | R | - | dec | |
6 | R | - | acc_jerk | |
7 | R | - | dec_jerk | |
8 | R | - | psf | position scaling factor: X, Y, Z, I, J, Next_X, Next_Y, Next_Z, earc |
Function operation:
The block sets the motion parameters for a given line from the G-code table if that line is related to the motion execution. The block is only used during the first cycle of each move. The PTP, Vector, Circle_CW, Circle_CCW outputs are active for one controller cycle. These outputs should be connected to the inputs of the PTP, VECTOR or CIRCLE blocks.
The function uses the marker M1008. M1008 = 1 - smoothing turned on, M1008 = 0 - smoothing turned off
Before specifying new motion parameters and running the Vector, Circle_CW, and Circle_CCW outputs:
- the function checks the states of special registers: _Last_G, _Last_M1008 (i.e. M1009)
- the function checks if the next G-code is the R3097 movement (_Next_G) = 1
- checks the state of the M1008 marker
- checks the condition '-2' and '-3'
- using the table below sets the appropriate values for the outputs vel_begin and vel_end
- runs vector output
- conditionally waits for vector_end input activation
- conditionally runs the output of Circle_CW or Circle_CCW
There are 6 ways of the function operation (the last column of the table)
1: vel_begin = 0, vel_end = 0, we pass the destination point directly from the current G-code, run VECTOR, we do not wait for activation vector_end
2: vel_begin = vel, vel_end = 0, we pass the destination point directly from the current G-code, run VECTOR, we do not wait for activation vector_end
3. vel_begin = 0, vel_end = vel, we calculate a new destination point for VECTOR and CIRCLE, run VECTOR, turn on smooth = 1 output, wait for vector_end activation, insert vel_begin = vel, execute CIRCLE, turn off Smooth output = 0
4. vel_begin = vel, vel_end = vel, we calculate a new destination point for VECTOR and CIRCLE, run VECTOR, wait for vector_end activation, execute CIRCLE
5. vel_begin = vel, vel_end = vel, we pass the destination point directly from the current G-code, run VECTOR, we do not wait for activation vector_end
6. vel_begin = 0, vel_end = vel, we pass the destination point directly from the current G-code, run VECTOR, we do not wait for activation vector_end
Block settings calculator gc_move_prep
Smooth function table:
TESTS:
(* SHAPE Nr: 0 *)
G0 X 20.000 Y 30.000
G1 X 20.000 Y 150.000
G1 X 120.000 Y 150.000
G1 X 120.000 Y 30.000
G1 X 20.000 Y 30.000
(* SHAPE Nr: 1 *)
G0 X 74.127 Y 30.552
G1 X 19.901 Y 86.947
G1 X 65.372 Y 150.070
G1 X 119.598 Y 93.675
G1 X 74.127 Y 30.552
(* SHAPE Nr: 2 *)
G0 X 22.220 Y 32.703
G1 X 22.220 Y 102.329
G1 X 91.847 Y 102.329
G1 X 91.847 Y 32.703
G1 X 22.220 Y 32.703
(* SHAPE Nr: 3 *)
G0 X 24.396 Y 34.879
G1 X 24.396 Y 93.734
G1 X 63.899 Y 93.734
G1 X 63.899 Y 34.879
G1 X 24.396 Y 34.879
(* SHAPE Nr: 4 *)
G0 X 26.186 Y 36.668
G1 X 26.186 Y 78.640
G1 X 62.513 Y 78.640
G1 X 62.513 Y 36.668
G1 X 26.186 Y 36.668
(* SHAPE Nr: 5 *)
G0 X 28.137 Y 38.620
G1 X 28.137 Y 41.209
G1 X 114.587 Y 41.209
G1 X 114.587 Y 38.620
G1 X 28.137 Y 38.620
(* SHAPE Nr: 6 *)
G0 X 70.858 Y 32.557
G1 X 70.858 Y 40.015
G1 X 82.348 Y 40.015
G1 X 82.348 Y 32.557
G1 X 70.858 Y 32.557
(* SHAPE Nr: 7 *)
G0 X 79.905 Y 72.154
G1 X 99.564 Y 67.986
G1 X 45.071 Y 44.136
G1 X 32.999 Y 69.375
G1 X 64.040 Y 72.617
G1 X 61.281 Y 63.586
G1 X 74.731 Y 37.421
G1 X 103.702 Y 62.197
G1 X 57.487 Y 57.335
G1 X 95.425 Y 48.304
G1 X 36.448 Y 34.643
(* SHAPE Nr: 8 *)
G0 X 63.090 Y 139.257
G1 X 48.961 Y 120.380
G1 X 35.893 Y 89.636
G1 X 47.549 Y 101.772
G1 X 74.392 Y 88.018
G1 X 30.595 Y 110.941
G1 X 58.145 Y 144.381
G1 X 88.167 Y 131.167
G1 X 106.887 Y 122.267
G1 X 85.695 Y 93.681
G1 X 55.672 Y 110.941
G1 X 104.062 Y 81.815
G1 X 36.952 Y 81.815
M2 (Program end)
https://projekty.multiprojekt.pl/laravel-filemanager/files/8/Nowy dokument tekstowy (3).txt