Linear trajectory generator for robotic axes, with the ability to synchronize up to two speed profiles
Project description
Dynamic Axis Control
Linear trajectory generator for robotic axes, with the ability to synchronize up to two speed profiles, to maximize performance. Also perfect for calculating the trajectories of the CoreXY Axes.
Table of content
Installing
Installing with pip command
Documentation
Requirements:
asked to set a specific unit of measurement e.g.: (°, rad, metres, millimetres). The module requires the following dependencies:
- matplotlib
- random
- numpy
- time
The tested python systems are
Specification:
Description of The Function of Sync core X and Y axes: Here is a simple flow chart:
graph TD;
A(Convert mm to revolution)-->B;
B(Check the axis with the longest travel)-->C;
C(Recalculate the axis with the shortest travel)-->D;
D(Sync Speed and Acc/Dec);
The linear Axes Function use the same algorithmic without the convert from unit to revolution unit motor.
Functions:
ProfileGenerator:
generator = ProfileGenerator(2.0, 0.5, 2.0, 0.5, 38, 1000)
| VARIABLE | DESCRIPTION | TYPE |
|---|---|---|
| M1_Acc_Dec | Acceleration and deceleration of the first motor/Axis | FLOAT |
| M1_MaxSpeed | Maximum speed of the first motor/Axis | FLOAT |
| M2_Acc_Dec | Acceleration and deceleration of the second motor/Axis | FLOAT |
| M2_MaxSpeed | Maximum speed of the second motor/Axis | FLOAT |
| mm_per_revolution | M1 Kinematic position values {Trajectory Profile} | FLOAT |
| percentage_constant_speed | time in percentage of the time the constant speed of the axis remains | FLOAT |
| FactorGroup | Scale Factor to set in the driver motor | INT |
| modetype | "NOT USED" axis mode | STRING |
| acc_min | Minimum acceleration and deceleration of the first motor/Axis | FLOAT |
| vel_min | Minimum speed of the first motor/Axis | FLOAT |
| acc_max | Maximum acceleration and deceleration of the second motor/Axis | FLOAT |
| vel_max | Maximun speed of the second motor/Axis | FLOAT |
| FactorGroup | Conversion factor for sending the motor driver parameters | FLOAT |
SyncCoreXYAxis
The function synchronizes the speed of two motors to move a Core XY type Cartesian axis. The algorithm synchronizes the trajectories of two motors to determine their acceleration and deceleration times. The trajectories will so be executed diagonally. Synchronization necessitates slowing down the shortest axis to end at the same time as the first.
INPUT:
| VARIABLE | DESCRIPTION | TYPE |
|---|---|---|
| Xstart | Value Axis to start Trajectory X Axis | FLOAT |
| Ystart | Value Axis to start Trajectory Y Axis | FLOAT |
| X | X Axis Position Value End Trajectory (Absolute Movement) | FLOAT |
| Y | Y Axis Position Value End Trajectory (Absolute Movement) | FLOAT |
| GRAPH | Show Trajectory | BOOL |
OUTPUT:
| VARIABLE | DESCRIPTION | TYPE |
|---|---|---|
| Rev_MaxSpeedXAxis | Max Speed M1 Motor value {round at .00} | FLOAT |
| Rev_AccAxisX | Max Acceleration and Deceleration M1 Motor value {round at .00} | FLOAT |
| Rev_MaxSpeedYAxis | Max Speed M2 Motor value {round at .00} | FLOAT |
| Rev_AccAxisY | Max Acceleration and Deceleration M2 Motor value {round at .00} | FLOAT |
| PositionXAxis | M1 Kinematic position values {Trajectory Profile} | ARRAY |
| PositionYAxis | M2 Kinematic position values {Trajectory Profile} | ARRAY |
| TimeX | M1 Kinematic Time values {Time Profile} | ARRAY |
| TimeY | M2 Kinematic Time values {Time Profile} | ARRAY |
| M1_revToSend | M1 Value Position to send {Absolute Movement with Factor Group scale} | INT |
| M2_revToSend | M2 Value Position to send {Absolute Movement with Factor Group scale} | INT |
| M1_Block | Enable or Disable Motor 1 Movement | BOOL |
| M2_Block | Enable or Disable Motor 2 Movement | BOOL |
Example
VelX,AccX,VelY,AccY,TjX,TjY,TmX, TmY, M1_position,M2_position, M1Block,M2Block = generator.SyncCoreXYAxis( XSim[i-1],
YSim[i-1],
XSim[i],
YSim[i],
Graph=True)
SyncLinearAxes
The function synchronizes the speed of two motors to move a two axes type Cartesian. The algorithm synchronizes the trajectories of two motors to determine their acceleration and deceleration times. The trajectories will so be executed diagonally. Synchronization necessitates slowing down the shortest axis to end at the same time as the first.
INPUT:
| VARIABLE | DESCRIPTION | TYPE |
|---|---|---|
| Xstart | Value Axis to start Trajectory X Axis | FLOAT |
| Ystart | Value Axis to start Trajectory Y Axis | FLOAT |
| X | X Axis Position Value End Trajectory (Absolute Movement) | FLOAT |
| Y | Y Axis Position Value End Trajectory (Absolute Movement) | FLOAT |
| GRAPH | Show Trajectory | BOOL |
OUTPUT:
| VARIABLE | DESCRIPTION | TYPE |
|---|---|---|
| Rev_MaxSpeedXAxis | Max Speed M1 Motor value {round at .00} | FLOAT |
| Rev_AccAxisX | Max Acceleration and Deceleration M1 Motor value {round at .00} | FLOAT |
| Rev_MaxSpeedYAxis | Max Speed M2 Motor value {round at .00} | FLOAT |
| Rev_AccAxisY | Max Acceleration and Deceleration M2 Motor value {round at .00} | FLOAT |
| PositionXAxis | M1 Kinematic position values {Trajectory Profile} | ARRAY |
| PositionYAxis | M2 Kinematic position values {Trajectory Profile} | ARRAY |
| TimeX | M1 Kinematic Time values {Time Profile} | ARRAY |
| TimeY | M2 Kinematic Time values {Time Profile} | ARRAY |
Example
VelX, AccX, VelY, AccY, TjX, TjY, TmX, TmY = generator.SyncLinearAxes( XSim[i - 1], YSim[i - 1], XSim[i], YSim[i], Graph=True)
RealTimeAnimation
This function used for simulation trajectory.
INPUT:
| VARIABLE | DESCRIPTION | TYPE |
|---|---|---|
| TjX | Trajectory X Axis | TUPLA |
| TjY | Trajectory Y Axis | TUPLA |
| TmX | Point Time Trajectory Axis X | TUPLA |
| TmY | Point Time Trajectory Axis Y | TUPLA |
| MaxStroke Chart | MaxStroke Chart | FLOAT |
| AxisType | Type of Axis Use | STRING |
Example
generator.AxisSimulator2D(TjX, TjY, TmX, TmY, 100, AxisType="CoreXY")
Analysis
Features:
- Add some circular interpolation to get the simple G-Code command
- Export profile for the 3d Animation Studio
Bug:
Luckily no one yet :-)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file DynamicAxisControl-1.0.2.tar.gz.
File metadata
- Download URL: DynamicAxisControl-1.0.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5056f6476e462066cdf5e061fbc2f6c79ec466924de45ed3f8803362731068e1
|
|
| MD5 |
a5c91ae371b7d4d6b5cdb2b84226e7e0
|
|
| BLAKE2b-256 |
f8edb8ccdf6d38df3fe1b73f39886e1d580494f41122672f192c8144611476ea
|
File details
Details for the file DynamicAxisControl-1.0.2-py3-none-any.whl.
File metadata
- Download URL: DynamicAxisControl-1.0.2-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98acbdef5035cc2ad3ea55a9a0d6557155e3721aa8fe1ae2201818c4f3ff4979
|
|
| MD5 |
c4349a0d41bcdd9c3d0ad7523b6ab9d8
|
|
| BLAKE2b-256 |
b04f5c425c6e6e28854222d873d9387f07d576be782af9c80c45d33642be5b10
|