<< 点击显示目录 >> 主页 轴控开发使用手册 > 轴控应用 > 18.ACOPOS功能块 > MPGEN FB介绍 |
目录
•1. 基本信息
•2. ParID
•3. 功能
•3.1 Mode 0: Disable.
•3.2 Mode 1: Time controlled enable.
•3.3 Mode 2: Enable position coupling, time optimized.
•3.4 Mode 3: Enable position coupling, jolt minimized.
•3.5 Mode 4: Speed controlled enable.
•3.6 Mode 5: Position coupling time optimized compensation movement only within a zone.
编写人 |
林繁伟 |
审核人 |
(检查,测试,注释) |
|
应用归属 |
运动控制 |
|||
软件信息 |
|
硬件信息 |
||
其他 |
|
|||
版本信息 |
修改内容 |
修改人 |
||
V1.00 |
创建 |
林繁伟 |
||
|
|
|
Parameter ID |
Abrv |
Access |
Data |
Value |
Init |
Unit |
Description |
name |
type |
range |
value |
||||
MPGEN_MODE |
m |
WR |
UI2 |
0,1,2,3,4,5 |
0 |
|
Function mode and activation |
0...Off |
|||||||
1...Time controlled |
|||||||
2...Position coupling, time optimized, setting movement parameters |
|||||||
3...Position coupling, jolt minimized, setting master compensation distance |
|||||||
4...Speed controlled |
|||||||
5...Position coupling time optimized, setting movement parameters, compensation only within one zone |
|||||||
MPGEN_SET_VALUE |
z |
RD,WR |
I4 |
|
0 |
units |
Target position (absolute position) at compensation end, or output value in Mode 0 |
(for mode 1,2,3,5) |
|||||||
MPGEN_SET_VALUE_PARID |
*z |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target position, "pointer" on integer value |
(for mode 1,2,3,5) |
|||||||
MPGEN_V_SET_VALUE |
vz |
RD,WR |
R4 |
|
0 |
units/s |
Target speed |
(for mode 4) |
|||||||
MPGEN_V_SET_VALUE_PARID |
*vz |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target speed, "pointer" on float value |
(for mode 4) |
|||||||
MPGEN_MA_PARID |
*x |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of the master position, "pointer" on position value |
(for mode 2,3,5) |
|||||||
MPGEN_MA_S_START |
s_st |
RD,WR |
I4 |
|
0 |
Units |
Master start position |
Coupling position for interval calculation |
|||||||
(for mode 5) |
|||||||
MPGEN_MA_S_IV |
iv |
RD,WR |
I4 |
> 0 |
230 |
Units |
Master interval |
(for mode 5) |
|||||||
MPGEN_MA_S1 |
s1 |
RD,WR |
R4 |
0..s2 |
0 |
Units |
Master starting position of zone in the interval |
s1 is changed as well, if s1 > s2 |
|||||||
(for mode 5) |
|||||||
MPGEN_MA_S2 |
s2 |
RD,WR |
R4 |
>= s1 |
0 |
Units |
Master end position of zone in the interval |
s2 is changed as well, if s1 > s2 |
|||||||
(for mode 5) |
|||||||
MPGEN_MA_S_COMP |
sx |
RD,WR |
I4 |
> 1 |
1 |
units |
Master compensation distance |
(for mode 3) |
|||||||
MPGEN_MA_V_MAX |
vx |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. master speed |
(for mode 2,3,5) |
|||||||
MPGEN_V_MAX |
vy |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. y speed in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_A_MAX |
ay |
RD,WR |
R4 |
> Eps |
1 |
units/s2 |
Max. y acceleration in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_VALUE_I4 |
yi |
RD |
I4 |
|
0 |
units |
Output as integer value (absolute position) |
MPGEN_VALUE_R4 |
yf |
RD |
R4 |
|
0 |
units |
Output as float value |
MPGEN_STATUS |
stat |
RD |
UI1 |
0,1,2 |
0 |
|
Status |
0...off |
|||||||
1...enabled, no compensation movement v=0 |
|||||||
2...enabled in compensation movement |
|||||||
3...enabled, no compensation movement v≠0, only for mode 4 |
|||||||
4...active, no compensation movement, target position not yet reached, only for mode 5 |
|||||||
MPGEN_ERROR_COUNT |
|
RD,WR |
UI1 |
|
0 |
|
error counter |
indicator for limit values exceeded |
|||||||
(for mode 3) |
Mode m is used to enable the function block and to set the "basic" mode of operation. Before enabling, every value z is switched directly through to output y. This initialization is executed as position jump without compensation (similar to "direct homing").
测试程序配置:
Any current compensation movement is immediately stopped. The current output value remains unchanged, except that a new target value z is written.
Warning: This results in a speed jump to 0.
3.2 Mode 1: Time controlled enable.
Changes to the z parameter or the cyclic input *z are recognized as the new, absolute target position and brought to the output in the form of a compensation movement. The compensation movement is executed with constant time, independent of the master speed.
This mode is equal to a positioning (without jolt limitation). However, no online algorithm is calculated as in the SPF. Instead, 3 polynomials y=f(t) are calculated in advance.
The "theoretical" duration of movement results from tx = (vy / ay + dy / vy) if vy is reached -
or tx = 2 sqrt( dy / ay) if vy is not reached. This time (tx) is rounded to multiples of the scan time Ta (400ms).
Position, speed and acceleration as function of the time and the master path:
起作用的参数如下:
Parameter ID |
Abrv |
Access |
Data |
Value |
Init |
Unit |
Description |
name |
type |
range |
value |
||||
MPGEN_MODE |
m |
WR |
UI2 |
0,1,2,3,4,5 |
0 |
|
1...Time controlled |
MPGEN_SET_VALUE |
z |
RD,WR |
I4 |
|
0 |
units |
Target position (absolute position) at compensation end, or output value in Mode 0 |
(for mode 1,2,3,5) |
|||||||
MPGEN_SET_VALUE_PARID |
*z |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target position, "pointer" on integer value |
(for mode 1,2,3,5) |
|||||||
MPGEN_V_MAX |
vy |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. y speed in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_A_MAX |
ay |
RD,WR |
R4 |
> Eps |
1 |
units/s2 |
Max. y acceleration in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_VALUE_I4 |
yi |
RD |
I4 |
|
0 |
units |
Output as integer value (absolute position) |
MPGEN_VALUE_R4 |
yf |
RD |
R4 |
|
0 |
units |
Output as float value |
MPGEN_STATUS |
stat |
RD |
UI1 |
0,1,2 |
0 |
|
Status |
0...off |
|||||||
1...enabled, no compensation movement v=0 |
|||||||
2...enabled in compensation movement |
|||||||
3...enabled, no compensation movement v≠0, only for mode 4 |
|||||||
4...active, no compensation movement, target position not yet reached, only for mode 5 |
A.没有达到Vy(1/2Rule).
Pic:相对位移500unit:速度只达到697(达不到Vy:V_MAX 1000),加减速度都达到设定的1000.
时间是2*SQRT(500/1000)约1.414214 sec,实际达到的V=707.1 unit/sec
B.达到Vy.
Pic:相对位移2000unit:速度和加减速度都达到设定的1000.
Pic:相对位移4000unit:速度和加减速度都达到设定的1000.
3.3 Mode 2: Enable position coupling, time optimized.
With fixed position relationship during the compensation, as with the cam profile couplings.
Assuming constant master speed vx, polynomials y=f(x) are calculated in advance, so that the maximum movement parameters vy and ay are set on the y side (similar to mode 1).
The actual v(t) and a(t) results from the master movement in the compensation.
A compensation curve is calculated as soon as the parameter z is written or a change on the cyclic input *z occures.
起作用的参数如下:
Parameter ID |
Abrv |
Access |
Data |
Value |
Init |
Unit |
Description |
name |
type |
range |
value |
||||
MPGEN_MODE |
m |
WR |
UI2 |
0,1,2,3,4,5 |
0 |
|
Function mode and activation |
|
|
|
|
|
|
|
2...Position coupling, time optimized, setting movement parameters |
MPGEN_SET_VALUE |
z |
RD,WR |
I4 |
|
0 |
units |
Target position (absolute position) at compensation end, or output value in Mode 0 |
(for mode 1,2,3,5) |
|||||||
MPGEN_SET_VALUE_PARID |
*z |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target position, "pointer" on integer value |
(for mode 1,2,3,5) |
|||||||
MPGEN_MA_PARID |
*x |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of the master position, "pointer" on position value |
(for mode 2,3,5) |
|||||||
MPGEN_MA_V_MAX |
vx |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. master speed |
(for mode 2,3,5) |
|||||||
MPGEN_V_MAX |
vy |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. y speed in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_A_MAX |
ay |
RD,WR |
R4 |
> Eps |
1 |
units/s2 |
Max. y acceleration in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_VALUE_I4 |
yi |
RD |
I4 |
|
0 |
units |
Output as integer value (absolute position) |
MPGEN_VALUE_R4 |
yf |
RD |
R4 |
|
0 |
units |
Output as float value |
MPGEN_STATUS |
stat |
RD |
UI1 |
0,1,2 |
0 |
|
Status |
0...off |
|||||||
1...enabled, no compensation movement v=0 |
|||||||
2...enabled in compensation movement |
|||||||
3...enabled, no compensation movement v≠0, only for mode 4 |
|||||||
4...active, no compensation movement, target position not yet reached, only for mode 5 |
|||||||
MPGEN_ERROR_COUNT |
|
RD,WR |
UI1 |
|
0 |
|
error counter |
indicator for limit values exceeded |
|||||||
(for mode 3) |
Negative Movements:和正向运动一样,没有差别,都是基于时间的,
Negative movement direction of the master basically means the same thing as forward movement.
At constant master speed, the position coupling movement corresponds to the time controlled movement.
Change of direction during compensation movement:
The compensation curve moves back to the output point again and is then continued in the opposite direction.
MPGEN_MA_PARID=412,以 虚轴的位置作为主轴。
下左图:
当前虚轴速度是1500,MA_V_MAX=5000,V_MAX=2000,A_MAX=3000
所以MPGEN的最高速度 =2000*(1500/5000) =600 unit/sec
所以MPGEN的最大加速度 =3000*(1500/5000)^2 =270 unit/sec^2
下右图:
当前虚轴速度是6000,MA_V_MAX=5000,V_MAX=2000
所以MPGEN的最高速度 =2000*(6000/5000) =2400 unit/sec
所以MPGEN的最大加速度 =3000*(6000/5000)^2 =4320 unit/sec^2
实际的MPGEN最高速度并没有收到V_MAX限制,仅仅是计算的比例参数而已。
A.没有达到Vy(1/2Rule).
Pic:相对位移500unit:速度只达到697(达不到Vy:V_OUT 2400),加减速度都达到设定的4320.
时间是2*SQRT(500/4320)约0.6804sec ,实际达到的V=1469.69 unit/sec。
Δ
B.达到Vy.
Pic:相对位移2000unit:速度达到V_OUT 2400和加减速度都达到设定的4320.
时间是=2000/2400+2400/4320约1.388888 sec
3.4 Mode 3: Enable position coupling, jolt minimized.
As with mode 2, polynomials y=f(x) are calculated in advance with a fixed position relationship during the compensation. In contrast to mode 2 however, the master compensation distance sx is set in this case. At sufficiently long distances sx, a "relaxed", jolt minimized movement results on the y side. With a small sx, the movement can also exceed the limit values, indicated on the error counter output.
Position, speed and acceleration as function of the master distance:
Parameter ID |
Abrv |
Access |
Data |
Value |
Init |
Unit |
Description |
name |
type |
range |
value |
||||
MPGEN_MODE |
m |
WR |
UI2 |
0,1,2,3,4,5 |
0 |
|
Function mode and activation |
|
|
|
|
|
|
|
3...Position coupling, jolt minimized, setting master compensation distance |
MPGEN_SET_VALUE |
z |
RD,WR |
I4 |
|
0 |
units |
Target position (absolute position) at compensation end, or output value in Mode 0 |
(for mode 1,2,3,5) |
|||||||
MPGEN_SET_VALUE_PARID |
*z |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target position, "pointer" on integer value |
(for mode 1,2,3,5) |
|||||||
MPGEN_V_SET_VALUE |
vz |
RD,WR |
R4 |
|
0 |
units/s |
Target speed |
(for mode 4) |
|||||||
MPGEN_V_SET_VALUE_PARID |
*vz |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target speed, "pointer" on float value |
(for mode 4) |
|||||||
MPGEN_MA_PARID |
*x |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of the master position, "pointer" on position value |
(for mode 2,3,5) |
|||||||
MPGEN_MA_S_COMP |
sx |
RD,WR |
I4 |
> 1 |
1 |
units |
Master compensation distance |
(for mode 3) |
|||||||
MPGEN_MA_V_MAX |
vx |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. master speed |
(for mode 2,3,5) |
|||||||
MPGEN_V_MAX |
vy |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. y speed in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_A_MAX |
ay |
RD,WR |
R4 |
> Eps |
1 |
units/s2 |
Max. y acceleration in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_VALUE_I4 |
yi |
RD |
I4 |
|
0 |
units |
Output as integer value (absolute position) |
MPGEN_VALUE_R4 |
yf |
RD |
R4 |
|
0 |
units |
Output as float value |
MPGEN_STATUS |
stat |
RD |
UI1 |
0,1,2 |
0 |
|
Status |
0...off |
|||||||
1...enabled, no compensation movement v=0 |
|||||||
2...enabled in compensation movement |
|||||||
3...enabled, no compensation movement v≠0, only for mode 4 |
|||||||
4...active, no compensation movement, target position not yet reached, only for mode 5 |
|||||||
MPGEN_ERROR_COUNT |
|
RD,WR |
UI1 |
|
0 |
|
error counter |
indicator for limit values exceeded |
|||||||
(for mode 3) |
当前参数设置如下:
虚轴速度MA_V_ACT是3000 unit/sec,总时间=ID5200/MA_V_ACT =1000/3000=1/3 sec
V_OUT max = 3000/5000*2000=1200unit/sec
伺服内部先计算然后运行。
计算时候:当速度超过V_OUT max时候,MPGEN_ERROR_COUNT 就会 + 1。
当加减速度超过MPGEN_V_MAX时候,MPGEN_ERROR_COUNT 就会 + 1。
A.最大速度小于等于V_MAX,三角型的速度轮廓(1/2Rule)
三角形计算:S =V_MAX*T/2 = (1200*1/3 ) /2=200unit
ΔMPGEN_SET_VALUE范围是0< Y ≤ 200unit
B.ΔMPGEN_SET_VALUE大于等于V_MAX*T total,三角型的速度轮廓(1/3Rule)
得到最小的设定值的偏差S =V_MAX*T = 1200*1/3 =400unit
ΔMPGEN_SET_VALUE范围是Y ≥ 400
右下图:最大V=3*800/(2*1/3)=3600 unit/sec
C.最大速度等于V_MAX,梯形型的速度轮廓(其余区间)
ΔMPGEN_SET_VALUE范围是200< Y < 400unit
实际应用需要注意:当ΔMPGEN_SET_VALUE接近最大值时候,加减速度会接近无穷大!
3.5 Mode 4: Speed controlled enable.
In this mode the speed of the output is controlled. The set point is either written directly to vz or applied via a connection of the cyclic input *vz. When changes occur the set value is limited with vy in positive and negative direction and a compensation speed is calculated with ay and without jolt limitation.
Position, speed and acceleration on the output as function of the time:
Parameter ID |
Abrv |
Access |
Data |
Value |
Init |
Unit |
Description |
name |
type |
range |
value |
||||
MPGEN_MODE |
m |
WR |
UI2 |
0,1,2,3,4,5 |
0 |
|
Function mode and activation |
|
|
|
|
|
|
|
4...Speed controlled |
MPGEN_V_SET_VALUE |
vz |
RD,WR |
R4 |
|
0 |
units/s |
Target speed |
(for mode 4) |
|||||||
MPGEN_V_SET_VALUE_PARID |
*vz |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target speed, "pointer" on float value |
(for mode 4) |
|||||||
MPGEN_V_MAX |
vy |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. y speed in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_A_MAX |
ay |
RD,WR |
R4 |
> Eps |
1 |
units/s2 |
Max. y acceleration in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_VALUE_I4 |
yi |
RD |
I4 |
|
0 |
units |
Output as integer value (absolute position) |
MPGEN_VALUE_R4 |
yf |
RD |
R4 |
|
0 |
units |
Output as float value |
MPGEN_STATUS |
stat |
RD |
UI1 |
0,1,2 |
0 |
|
Status |
0...off |
|||||||
1...enabled, no compensation movement v=0 |
|||||||
2...enabled in compensation movement |
|||||||
3...enabled, no compensation movement v≠0, only for mode 4 |
|||||||
4...active, no compensation movement, target position not yet reached, only for mode 5 |
当前参数设置如下:
加减速是以MPGEN_A_MAX为准,速速是受到MPGEN_V_MAX限制
MPGEN_STATUS
1...enabled, no compensation movement v=0
速度为0,停止
2...enabled in compensation movement
速度在变化过程中
3...enabled, no compensation movement v≠0, only for mode 4
速度为不0,正在运行
3.6 Mode 5: Position coupling time optimized compensation movement only within a zone.
Just as in mode 2, a coupling is established with a master position and the compensation curve is pre-calculated time optimized with the movement parameters. However, the compensation movements here are only allowed in a specific zone within one master interval.
类似于模式2,但是只允许在主轴的间隔周期设定的范围内才进行运动补偿
Configuring the zone and interval start:
Positions s1 and s2 determine a zone, based on the start of the interval. The interval shift is defined with the start position s_st. There is no difference if the master position x0 is located before or after s_st. After coupling, the zones repeat cyclically per interval in the positive and negative direction of movement.
Example of x0 after s_st and within the zone:
S1和S2在区间内
The zone may also be required to go over an interval end. In this case, the end position of the zone would be defined as being larger than the interval.
Example of x0 before s_st and outside of the "interval overlapping" zone:
S1和S2在区间外
Specifying the target position and dividing over multiple zones:
A new target position can be specified in the entire interval. If the master position is located within a zone, then the compensation movement will start immediately. Otherwise, it is started when the next zone is entered. If the entire movement cannot be completed in one zone, then it is divided over multiple zones. If compensation is not active, then a new value can be specified again before the target position has been reached.
Examples of specifications outside and inside the zone and dividing over multiple compensation movements:
Parameter ID |
Abrv |
Access |
Data |
Value |
Init |
Unit |
Description |
name |
type |
range |
value |
||||
MPGEN_MODE |
m |
WR |
UI2 |
0,1,2,3,4,5 |
0 |
|
Function mode and activation |
|
|
|
|
|
|
|
5...Position coupling time optimized, setting movement parameters, compensation only within one zone |
MPGEN_SET_VALUE |
z |
RD,WR |
I4 |
|
0 |
units |
Target position (absolute position) at compensation end, or output value in Mode 0 |
(for mode 1,2,3,5) |
|||||||
MPGEN_SET_VALUE_PARID |
*z |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of target position, "pointer" on integer value |
(for mode 1,2,3,5) |
|||||||
MPGEN_MA_PARID |
*x |
RD,WR |
UI2 |
<ParID>,0 |
0 |
|
Parameter ID of the master position, "pointer" on position value |
(for mode 2,3,5) |
|||||||
MPGEN_MA_S_START |
s_st |
RD,WR |
I4 |
|
0 |
Units |
Master start position |
Coupling position for interval calculation |
|||||||
(for mode 5) |
|||||||
MPGEN_MA_S_IV |
iv |
RD,WR |
I4 |
> 0 |
230 |
Units |
Master interval |
(for mode 5) |
|||||||
MPGEN_MA_S1 |
s1 |
RD,WR |
R4 |
0..s2 |
0 |
Units |
Master starting position of zone in the interval |
s1 is changed as well, if s1 > s2 |
|||||||
(for mode 5) |
|||||||
MPGEN_MA_S2 |
s2 |
RD,WR |
R4 |
>= s1 |
0 |
Units |
Master end position of zone in the interval |
s2 is changed as well, if s1 > s2 |
|||||||
(for mode 5) |
|||||||
MPGEN_MA_V_MAX |
vx |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. master speed |
(for mode 2,3,5) |
|||||||
MPGEN_V_MAX |
vy |
RD,WR |
R4 |
> Eps |
1 |
units/s |
Max. y speed in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_A_MAX |
ay |
RD,WR |
R4 |
> Eps |
1 |
units/s2 |
Max. y acceleration in compensation movement |
(for mode 1,2,3,4,5) |
|||||||
MPGEN_VALUE_I4 |
yi |
RD |
I4 |
|
0 |
units |
Output as integer value (absolute position) |
MPGEN_VALUE_R4 |
yf |
RD |
R4 |
|
0 |
units |
Output as float value |
MPGEN_STATUS |
stat |
RD |
UI1 |
0,1,2 |
0 |
|
Status |
0...off |
|||||||
1...enabled, no compensation movement v=0 |
|||||||
2...enabled in compensation movement |
|||||||
3...enabled, no compensation movement v≠0, only for mode 4 |
|||||||
4...active, no compensation movement, target position not yet reached, only for mode 5 |
S_START=5000,S_IV=10000因此每周期范围的5000~15000;S1=6000,S2=7000
那么,虚轴位置在(5000+6000)~(5000+7000)~=11000~12000=1000~2000 这1000的范围内进行输出。
每次调节的最大时间T =(7000-6000)/6000=0.1667sec