Trajectory Generator¶
The trajectory generator of the PiMotion™ is impemented in hardware. A hardware implementation provides precise and repeatable timing.
There are two modes of trajectory generation, the position and the velocity mode. Which mode works best completely depends on the application.
Servo based on Position¶
In position mode the trajectory generator will constantly output the target position. The PID Algorithm then operates on the position error, derived from the difference between the actual position and the target position.
Servo based on Velocity¶
In velocity mode, the trajectory generator will constantly output the target velocity. A velocity based profile utilizes the difference in the target velocity and the actual velocity generating a velocity error. This velocity error is then provided to the PID filter. In velocity mode the servo is only concerned with maintaining a velocity and not the particular position.
Trajectory Generator Table¶
The trajectory generator table consists of 100 segments. Each segment has a segment time, target velocity and target acceleration (with extra fields for extended functionality).
# Bits | Type | Name | Description |
---|---|---|---|
32 | R/W | tg_options | Options field. |
64 | R/W | tg_t_ec | Time of this segment in electrical cycles. |
64 | R/W | target_v | Target velocity in electrical cycles per second. |
64 | R/W | target_a | Target acceleration in electrical cycles per second per second. |
64 | R/W | target_x | Target position |
32 | R | tg_repeat_count | Current repeat count. Can be used to monitor the progress of the repeat. Read only. |
Trajectory generator tg_options field is a 32 bit number with bit position representing particular functions for that segment.
Bit(s) | Type | Name | Description |
---|---|---|---|
31 | R/W | tg_op_finished | Last segment in the table. |
30 | R/W | vel_mode | Servo with velocity or position. |
29 | R/W | fix_acc_sign | Automatic correction for acceleration sign. |
28 | R/W | RESERVED | |
27:16 | R/W | tg_jump | Segment to jump to. |
15:0 | R/W | tg_repeat | If non 0, jump to segment defined in tg_jump by this many times. |