Skip to main content

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)

SyncCoreXYAxis

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)

SyncCoreXYAxis

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")

SyncCoreXYAxis

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DynamicAxisControl-1.0.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DynamicAxisControl-1.0.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file DynamicAxisControl-1.0.1.tar.gz.

File metadata

  • Download URL: DynamicAxisControl-1.0.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for DynamicAxisControl-1.0.1.tar.gz
Algorithm Hash digest
SHA256 03844837dc4b88a2fe027e7fd7737205c4e908a560838754af458e9ee7cf21d5
MD5 20f814d178a93b05832b02e8bbfc46fe
BLAKE2b-256 06bad8ae5c9aebf89ff69e3e0c9a252d92a4ef0e3fc0ecce89a45870c3a4e381

See more details on using hashes here.

File details

Details for the file DynamicAxisControl-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for DynamicAxisControl-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4af2653a8fc5bb1e03d1a38d36ec06bcd768a6085121f7142511e3389e5530c
MD5 201bb7b3ad63ddccab8b07d163fc367e
BLAKE2b-256 a7abf68d987772a42bda02ee52907bc3142fd871d62902f130968aa11721a118

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page