Profile generator
Basic principle¶
It allows easy positioning from point to point and speed control of the actuator.
The output of the generator is a 64-bit position variable, which consists of two 32-bit variables APosAngle
and APosRevol
, as well as a variable ASpeed
determining the current speed setpoint.
The parameters of the generator are Acc
and Dec
, which determine the acceleration resp. deceleration of the drive, the Type
parameter determines the course of speed during acceleration and deceleration (see diagram below).
Another parameter is PosSpeed
, which determines the maximum speed during positioning, the DPosAngle
and DposRevol
parameters determine the target position and the Speed
parameter determines the speed setpoint.
The variables Mode
and Rdy
are used to control the generator itself.
The Mode
variable specifies the PG mode (value 0 indicates the speed mode, value 1 indicates the position mode).
If the positioning is successfully completed and the output position is the same as the setpoint, then this state is signaled by the value of the variable Rdy = 1
.
The generator works by calculating the current APosAngle
and APosRevol
position setpoint and the current ASpeed
speed setpoint in each period based on the parameters (Acc, Dec, Type, PosSpeed, DPosAngle, and DPosRevol
) and the status of the Mode
and Speed
variables.
The calculation of the generator is performed with the internal resolution given by the BitsPerRevol
parameter. This parameter then specifies the internal number of increments per revolution.
- (a) position mode
- (b) speed mode
- (c) type of ascending and descending ramps
The following parameters work with this resolution:
Parameter | Unit |
---|---|
Acc, Dec | [Inc/s²] |
ASpeed, DSpeed, Speed | [Inc/s] |
The position parameters are 64-bit and consist of two 32-bit registers:
- The Angle register indicates the position within one revolution with a resolution of 32 bits
- The Revol register is an extension of 32 bits (number of whole revolutions):
- DPosRevol, DPosAngle
- APosRevol, APosAngle
These built-in functions can be used in the user program to simplify work with the profile generator:
- Relative positioning - this is a position transition: int PosRel(int axis, int Acc, int Dec, int Speed, long long Pos, int AddGear);
- Absolute positioning - this is the approach to the absolute position: int PosAbs(int axis, int Acc, int Dec, int Speed, long long Pos, int AddGear);
- Speed crossing - the drive spins at a given speed. int RunSpeed(int axis, int Acc, int Speed, int AddGear);
Description of parameters: axis - 0 - axis 1, 1 - axis 2 Acc,Dec - in the same sense as the PG parameters described above Speed - Maximum position crossing speed or speed crossing speed AddGear - not implemented yet (will determine cooperation with the Gear module)
Examples of motor control via Profile Generator¶
The following tables provide examples of using a generator profile that is set to different motor control modes. The Basic Groups column lists the page name. Switching between individual pages is allowed in the upper left corner of the TGZ graphical user interface.
Note
In the first step, it is important to set / load the correct drive parameters. Uploading parameters is possible using the blue envelope in the upper right corner (LOAD PARAMETERS FROM FILE), see TGZ GUI Manual
Motor position control via TGZ GUI¶
Step | Basicgroups | Parametr | Value 1 | Desription |
---|---|---|---|---|
1 | - | - | - | Loaddrive parameters. |
2 | Drive | D-mode | 7 | Profilegenerator - position mode. |
3 | Command | K-Command | 1 | SW enable. It can also be turned on using the enable button for the respective axis on the bottom bar. The motor generates torque. |
4 | PG | Acc | 5 000 0001 | [inc/s²] Required acceleration. |
5 | PG | Dec | 5 000 0001 | [inc/s²] Desired deceleration. |
6 | PG | PosSpeed | 1 000 0001 | [inc/s] Desired speed of movement in position mode. |
7 | PG | Mode | 1 | Position mode. |
8 | PG | Type | 1 | Required ramp type. |
9 | PG | DPosAngle | 0 | [inc] Desired position within one revolution. After entering the value and pressing the Enter key, the motor rotates to the desired position. |
10 | PG | DPosRevol | 201 | [inc] Desired position within the multi-turn range. After entering the value and pressing the Enter key, the motor rotates to the desired position. |
Motor position control via UDP¶
D-mode
Description: Servo amplifier mode setting: Profile Generator - position mode.
Telegram: Request | ||||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x03 | 0x03 | 0x07 | 0x00 | 0x00 | 0x00 |
Telegram: Response | ||||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | (Byte 6, 10 = 0 : no error) | ||
0x47 | 0x54 | 0x02 | 0x03 | 0x03 | 0x00 |
PG – Acc, Dec, PosSpeed, Type, Mode, DPosAngle, DPosRevol
Description: Setting of required acceleration, deceleration, ramp type (see fig.), Generator Profile mode and zero position setpoint (initial state).
Telegram: | Request | |||||||||||||||||||||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 | ||||||||||||||||||
0x47 | 0x54 | 0x04 | 0x19 | 0x00 | 0x02 | 0x40 | 0x4B | 0x4C | ||||||||||||||||||
Byte 9 | Byte 10 | Byte 11 | Byte 12 | Byte 13 | Byte 14 | Byte 15 | Byte 16 | Byte 17 | ||||||||||||||||||
0x00 | 0x40 | 0x4B | 0x4C | 0x00 | 0x02 | 0x19 | 0x07 | 0x40 | ||||||||||||||||||
Byte 18 | Byte 19 | Byte 20 | Byte 21 | Byte 22 | Byte 23 | Byte 24 | Byte 25 | Byte 26 | ||||||||||||||||||
0x42 | 0x0F | 0x00 | 0x02 | 0x19 | 0x0B | 0x01 | 0x00 | 0x00 | ||||||||||||||||||
Byte 27 | Byte 28 | Byte 29 | Byte 30 | Byte 31 | Byte 32 | Byte 33 | Byte 34 | Byte 35 | ||||||||||||||||||
0x00 | 0x02 | 0x19 | 0x09 | 0x01 | 0x00 | 0x00 | 0x00 | 0x04 | ||||||||||||||||||
Byte 36 | Byte 37 | Byte 38 | Byte 39 | Byte 40 | Byte 41 | Byte 42 | Byte 43 | Byte 44 | ||||||||||||||||||
0x19 | 0x04 | 0x02 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | ||||||||||||||||||
Byte 45 | Byte 46 | |||||||||||||||||||||||||
0x00 | 0x00 | |||||||||||||||||||||||||
Telegram: | Response | (Byte 6, 10 = 0 : no Error) | ||||||||||||||||||||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 | ||||||||||||||||||
0x47 | 0x54 | 0x04 | 0x19 | 0x00 | 0x00 | 0x02 | 0x02 | 0x19 | ||||||||||||||||||
Byte 9 | Byte 10 | Byte 11 | Byte 12 | Byte 13 | Byte 14 | Byte 15 | Byte 16 | Byte 17 | ||||||||||||||||||
0x07 | 0x00 | 0x02 | 0x19 | 0x0B | 0x00 | 0x02 | 0x19 | 0x09 | ||||||||||||||||||
Byte 18 | Byte 19 | Byte 20 | Byte 21 | Byte 22 | Byte 23 | |||||||||||||||||||||
0x00 | 0x04 | 0x19 | 0x04 | 0x00 | 0x02 | |||||||||||||||||||||
K – Command
Description: SW enable.
After entering this command, the motor is under torque and rotates to the desired position from the previous request.
Telegram: | Request | ||||||||||||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 | |||||||||
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x01 | 0x00 | 0x00 | 0x00 | |||||||||
Telegram: | Response | (Byte 6, 10 = 0 : no Error) | |||||||||||||||
Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | ||||||||||||
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x00 |
Motor speed control via TGZ GUI¶
Step | Basic groups | Parameter | Value | Description |
---|---|---|---|---|
1 | - | - | - | Load drive parameters. |
2 | Drive | D-mode | 7 | Profile generator - position mode. |
3 | Command | K-Command | 1 | SW permission. It can also be turned on using the activation button on the bottom bar. The motor generates torque. |
4 | PG | Acc | 5 000 0001 | [inc / s²] Required acceleration. |
5 | PG | Dec | 5 000 0001 | [inc / s²] Desired acceleration required. |
6 | PG | Mode | 0 | Speed mode. |
7 | PG | Type | 1 | Required ramp type. |
8 | PG | PosSpeed | ±1 000 0001 | [inc / s] Desired speed of movement in position mode. After entering the value and pressing the Enter key, the motor will rotate at the desired speed. |
Motor speed control via UDP¶
D-Mode
Description: Servo amplifier mode setting: Profile Generator - position mode.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x03 | 0x03 | 0x07 | 0x00 | 0x00 | 0x00 |
Telegram: | Response | (Byte 6, 10 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | |||
0x47 | 0x54 | 0x02 | 0x03 | 0x03 | 0x00 |
PG – Acc, Dec, PosSpeed, Type, Mode
Description: Setting of the required acceleration, deceleration, speed, ramp type (see fig.) and Generator Profile mode.
The sign at speed PosSpeed determines the direction of rotation of the motor.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x04 | 0x19 | 0x00 | 0x02 | 0x40 | 0x4B | 0x4C |
Byte 9 | Byte 10 | Byte 11 | Byte 12 | Byte 13 | Byte 14 | Byte 15 | Byte 16 | Byte 17 |
0x00 | 0x40 | 0x4B | 0x4C | 0x00 | 0x02 | 0x19 | 0x08 | 0x40 |
Byte 18 | Byte 19 | Byte 20 | Byte 21 | Byte 22 | Byte 23 | Byte 24 | Byte 25 | Byte 26 |
0x42 | 0x0F | 0x00 | 0x02 | 0x19 | 0x0B | 0x01 | 0x00 | 0x00 |
Byte 27 | Byte 28 | Byte 29 | Byte 30 | Byte 31 | Byte 32 | Byte 33 | Byte 34 | |
0x00 | 0x02 | 0x19 | 0x09 | 0x00 | 0x00 | 0x00 | 0x00 | |
Telegram: | Response | (Byte 5= 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x04 | 0x19 | 0x00 | 0x00 | 0x02 | 0x02 | 0x19 |
Byte 9 | Byte 10 | Byte 11 | Byte 12 | Byte 13 | Byte 14 | Byte 15 | Byte 16 | Byte 17 |
0x08 | 0x00 | 0x02 | 0x19 | 0x0B | 0x00 | 0x02 | 0x19 | 0x09 |
Byte 18 | ||||||||
0x00 |
K – Command
Description: SW enable.
After entering this command, the motor is under torque and starts turning in the desired direction at the desired speed.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x01 | 0x00 | 0x00 | 0x00 |
Telegram: | Response | (Byte 5 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | |||
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x00 |
Software limits for motor speed control in TGZ GUI¶
Step | Basic groups | Parameter | Value | Description |
---|---|---|---|---|
1 | - | - | - | Load drive parameters. |
2 | Drive | D-mode | 7 | Profile generator - position mode. |
3 | Command | K-Command | 1 | SW permission. It can also be turned on using the activation button on the bottom bar. The motor generates torque. |
4 | PG | Acc | 5000000 1 | [inc /s²] Required acceleration. |
5 | PG | Dec | 5000000 1 | [inc /s²] Desired deceleration. |
6 | PG | PosSpeed | 1000 000 1 | [inc /s] Desired speed of movement in position mode. |
7 | PG | Mode | 1 | Position mode. |
8 | PG | Type | 1 | Required ramp type. |
9 | PG | DPosAngle | 0 | [inc] Desired position within one revolution. After entering the value and pressing the Enter key, the motor rotates to the desired angle. |
10 | PG | DPosRevol | 0 | [inc] Desired position within the range of multi-turn motion. After entering the value and pressing the Enter key, the motor rotates to position 0. Wait for the motor to rotate. |
11 | PG | PosSpeed | 0 | [inc /s] Desired speed of movement in position mode. |
12 | PG | Mode | 0 | Speed mode. |
13 | PG | PosLimitAnglePosit | 0 1 | Positive position limit within one revolution in the range from -216 to 216. |
14 | PG | PosLimitRevolPosit | 20 1 | [± speed] Upper limit of the position within the speed in the range from -216 to 216. |
15 | PG | PosLimitAngleNegat | 0 1 | Negative position limit within one revolution in the range from -216 to 216. |
16 | PG | PosLimitRevolNegat | -20 1 | [± number of revolutions] Lower limit of the position within the speed in the range from -216 to 216. |
17 | PG | PosSpeed | ± 5000 000 1 | [inc /s] After entering the value, the motor will rotate at PosSpeed to PosLimitRevolPosit or PosLimitRevolNegat . The direction of rotation is given by the sign of the PosSpeed parameter. |
Software limits for motor speed control (UDP)¶
D-Mode
Description: Servo amplifier mode setting: Profile Generator - position mode.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x03 | 0x03 | 0x07 | 0x00 | 0x00 | 0x00 |
Telegram: | Response | (Byte 6, 10 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | |||
0x47 | 0x54 | 0x02 | 0x03 | 0x03 | 0x00 |
PG – Acc, Dec, PosSpeed, Type, Mode, DPosAngle, DPosRevol
Description: Setting of the required acceleration, deceleration, speed and type of ramps of the Generator Profile.
In the last step, the zero desired position is entered (default state).
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x04 | 0x19 | 0x00 | 0x02 | 0x40 | 0x4B | 0x4C |
Byte 9 | Byte 10 | Byte 11 | Byte 12 | Byte 13 | Byte 14 | Byte 15 | Byte 16 | Byte 17 |
0x00 | 0x40 | 0x4B | 0x4C | 0x00 | 0x02 | 0x1A | 0x07 | 0x00 |
Byte 18 | Byte 19 | Byte 20 | Byte 21 | Byte 22 | Byte 23 | Byte 24 | Byte 25 | Byte 26 |
0x00 | 0x00 | 0x00 | 0x02 | 0x19 | 0x0B | 0x01 | 0x00 | 0x00 |
Byte 27 | Byte 28 | Byte 29 | Byte 30 | Byte 31 | Byte 32 | Byte 33 | Byte 34 | Byte 35 |
0x00 | 0x02 | 0x19 | 0x09 | 0x01 | 0x00 | 0x00 | 0x00 | 0x04 |
Byte 36 | Byte 37 | Byte 38 | Byte 39 | Byte 40 | Byte 41 | Byte 42 | Byte 43 | Byte 44 |
0x19 | 0x04 | 0x02 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 |
Byte 45 | Byte 46 | |||||||
0x00 | 0x00 | |||||||
Telegram: | Response | (Byte 6, 10, 14, 18, 22 = 0 : no Error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x04 | 0x19 | 0x00 | 0x00 | 0x02 | 0x02 | 0x19 |
Byte 9 | Byte 10 | Byte 11 | Byte 12 | Byte 13 | Byte 14 | Byte 15 | Byte 16 | Byte 17 |
0x07 | 0x00 | 0x02 | 0x19 | 0x0B | 0x00 | 0x02 | 0x19 | 0x09 |
Byte 18 | Byte 19 | Byte 20 | Byte 21 | Byte 22 | Byte 23 | |||
0x00 | 0x04 | 0x19 | 0x04 | 0x00 | 0x02 |
K – Command
Description: SW enable.
After entering this command, the motor is under torque and rotates to the desired position (i.e., to position 0).
It is necessary to wait until the motor turns.
Telegram | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x01 | 0x00 | 0x00 | 0x00 |
Telegram | Response | (Byte 5 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | |||
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x00 |
PG – PosSpeed
Description: Set the desired speed to zero.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x19 | 0x07 | 0x00 | 0x00 | 0x00 | 0x00 |
Telegramm | Response | (Byte 5 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | |||
0x47 | 0x54 | 0x02 | 0x19 | 0x07 | 0x00 |
PG – Mode
Description: Setting the Generator Profile to speed mode.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x19 | 0x09 | 0x00 | 0x00 | 0x00 | 0x00 |
Telegram: | Response | (Byte 5 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | |||
0x47 | 0x54 | 0x02 | 0x19 | 0x09 | 0x00 |
PG – PosLimitAnglePosit, PosLimitRevolPosit, PosLimitAngleNegat, PosLimitRevolNegat
Description: Setting of position limits within one revolution and within multiple revolutions.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x04 | 0x19 | 0x04 | 0x02 | 0x40 | 0x4B | 0x4C |
Byte 9 | Byte 10 | Byte 11 | Byte 12 | Byte 13 | Byte 14 | Byte 15 | Byte 16 | Byte 17 |
0x00 | 0x40 | 0x4B | 0x4C | 0x00 | 0x04 | 0x1A | 0x04 | 0x02 |
Byte 18 | Byte 19 | Byte 20 | Byte 21 | Byte 22 | Byte 23 | Byte 24 | Byte 24 | |
0x42 | 0x0F | 0x00 | 0x02 | 0x19 | 0x0B | 0x01 | 0x01 | |
Telegram: | Response | (Byte 5,10 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x04 | 0x19 | 0x04 | 0x00 | 0x02 | 0x04 | 0x1A |
Byte 9 | Byte 10 | Byte 11 | ||||||
0x04 | 0x00 | 0x02 |
PG – PosSpeed
Description: SW enable.
After entering this command, the motor is under torque and rotates to the desired position from the previous request.
Telegram: | Request | |||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x01 | 0x00 | 0x00 | 0x00 |
Telegram: | Response | (Byte 5 = 0 : no error) | ||||||
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | |||
0x47 | 0x54 | 0x02 | 0x11 | 0x00 | 0x00 |
Extended description of Profile Generator parameters¶
Parametername | Description |
---|---|
Acc | Required drive acceleration |
Dec | Required drive deceleration |
APosAngle | Current drive position within one revolution |
APosRevol | Current drive position within the speed |
DPosAngle | Required drive position within one revolution |
DPosRevol | Required drive position within the speed |
ASpeed | Current drive speed |
PosSpeed | Required speed of movement in position mode |
Speed | Required speed of movement in speed mode |
Mode | Generator profile mode. 0 = speed, 1 = position, 2 (only read) = deceleration ramp signaling in position mode |
Rdy | Signaling the completion of the drive movement. 1 = Position reached |
Type | Velocity profile type 0 = harmonic unbalanced, 1 = harmonic symmetrical, 2 = fully harmonic, 3 = trapezoidal |
BitsPerRevol | Number of bits per revolution for the generator profile |
RotaryMode | Special positioning mode within one revolution with a shorter path - use for direct motors. 1 = Rotary mode, 0 = Standard mode |
PosOffsetAngle | Position offset within one revolution |
PosOffsetRevol | Position offset within the speed |
PosLimitAnglePosit | Positive position limit within one revolution in the range from -216 to 216 |
PosLimitRevolPosit | Positive position limit within the number of revolutions in the range from -216 to 216 |
PosLimitAngleNegat | Negative position limit within one revolution in the range from -216 to 216 |
PosLimitRevolNegat | Negative position limit within the speed in the range from -216 to 216 |
DPosAngleRotary | In "RotaryMode = 1", this parameter determines the desired position within one revolution |
AccMaxCurrentFeedForward | Current pre-correction |