Stepper Motor

Config

To apply any config changes make, sure to safely unmount the device and reboot the the device by sending a reset command, or powering the device off and on again

Motor Control Loop

# Stepper module configuration
microseconds_per_step_pulse                  1                # Duration of step pulses to stepper drivers, in microseconds
base_stepping_frequency                      100000           # Base frequency for stepping
  • base_stepping_frequency is the frequency the motor control loop is running at
  • microseconds_per_step_pulse is the pulse width of the stepper signal, only change this if external motor drivers are used and specifies a pulse longer than 1┬ÁSec

base_stepping_frequency effects system performance, changing it is not recommended.

Motor Translation

The motor position needs to be translated into steps, to be able to control the motors.

# Arm solution configuration : delta/ragnar arm configurations uses degrees not mm
alpha_steps_per_mm                       44.4444444444        # Steps per degree for alpha stepper
beta_steps_per_mm                        44.4444444444        # Steps per degree for beta stepper
gamma_steps_per_mm                       44.4444444444        # Steps per degree for gamma stepper
delta_steps_per_mm                       44.4444444444        # Steps per degree for gamma stepper

Steps per degree is calculated as follows

[STEPS_PER_REVOLUTION] * [MICROSTEPS] * [GEAR_RATIO] / 360

The default motors have 200 steps per revolution (1.8 deg per step), 1/16 Micro stepping and a gear ratio of 1:5

200 * 16 * 5 / 360 = 44.44_

Motor Control

Motor IO mapping, power and speed limits for each motor

IO are formated as [PORT].[PIN] a "!" indicates a NOT where signal is inverted

# Only needed on a smoothieboard
currentcontrol_module_enable                 true             
currentcontrol_idle_time                     180              # seconds of inactivity before switching to idle current to prevent overheating, comment out to disable 

# Stepper module pins ( ports, and pin numbers, appending "!" to the number will invert a pin )
alpha_step_pin                               2.0              # Pin for alpha stepper step signal
alpha_dir_pin                                0.5              # Pin for alpha stepper direction
alpha_en_pin                                 0.4              # Pin for alpha enable pin
alpha_current                                1.8              # Joint 1 stepper motor current
alpha_idle_current                           1.0              # Joint 1 stepper motor idle current comment out to disable
alpha_max_rate                               64800.0          # mm/min

beta_step_pin                                2.1              # Pin for beta stepper step signal
beta_dir_pin                                 0.11             # Pin for beta stepper direction
beta_en_pin                                  0.10             # Pin for beta enable
beta_current                                 1.8              # Joint 2 stepper motor current
beta_idle_current                            1.0              # Joint 2 stepper motor idle current comment out to disable
beta_max_rate                                64800.0          # mm/min

gamma_step_pin                               2.2              # Pin for gamma stepper step signal
gamma_dir_pin                                0.20             # Pin for gamma stepper direction
gamma_en_pin                                 0.19             # Pin for gamma enable
gamma_current                                1.8              # Joint 3 stepper motor current
gamma_idle_current                           1.0              # Joint 3 stepper motor idle current comment out to disable
gamma_max_rate                               64800.0          # mm/min

delta_step_pin                               2.3              # Pin for delta stepper step signal
delta_dir_pin                                0.22             # Pin for delta stepper direction
delta_en_pin                                 0.21             # Pin for delta enable
delta_current                                1.8              # Joint 4 stepper motor current
delta_idle_current                           1.0              # Joint 4 stepper motor idle current comment out to disable
delta_max_rate                               64800.0          # mm/min
  • currentcontrol_module_enable should always be enabled to protect motors and drivers
  • currentcontrol_idle_time the time before idle power is enabled, if this value is commented out idle power will be disabled. To disable idle power on motor basis comment out [MOTOR]_idle_current value instead and make sure currentcontrol_idle_time is set
  • [MOTOR]_step_pin the IO mapping for step pulse
  • [MOTOR]_dir_pin the IO mapping stepper direction
  • [MOTOR]_en_pin the IO mapping for power enable
  • [MOTOR]_current current limiter value, the maximum motor current for motor
  • [MOTOR]_idle_current current limiter value, the maximum motor current when idle, comment out to disable idle power for motor
  • [MOTOR]_max_rate set maximum rate for motor in deg/min

Actuator feedback [firmware april 2016+]

Actuator feedback enables the motors use closed-loop motor control, making sure the joints/axis hit their target even if stepper motors loses steps on the way.

Actuator feedback works on any joint/axis where an encoder has been attacted, see encoder on how to enable encoders.

# actuator feedback
actuator_feedback_on_idle                    true             # enable actuator feedback on idle
actuator_feedback_idle_max                   0.3              # the maximum allowed correction for idle process
actuator_feedback_on_block                   true             # enable actuator feedback on block finished
actuator_feedback_block_max                  0.1              # the maximum allowed correction for planner
actuator_feedback_linear                     0.0              # linear feedback
actuator_feedback_exponential                0.05             # exponential feedback
  • actuator_feedback_exponential enables position correction while system is idle (not moving)
  • actuator_feedback_idle_max limits the maximum position correction while idle example: 0.3 limits the total correction to 30% of the error
  • actuator_feedback_on_block enables position correction while system is moving
  • actuator_feedback_block_max limits the maximum position correction while moving
  • actuator_feedback_linear linear feedback is the linear element of the correction, and is good for adjusting when the correction should start
  • actuator_feedback_exponential exponential feedback is the exponential element of the correction, and is good for adjusting the agressiveness of the correction

Motor Drivers

M542T
  • Power Supply 24-48VDC max 50V
  • Microsteps supported 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/5, 1/10, 1/25 1/50, 1/125, 1/250
  • Current 1.5-4.5A
ST-6600
  • Power Supply 12-36VDC max 40V
  • Microsteps supported 1/1, 1/2, 1/4, 1/8, 1/16
  • Current 0.5-4.0A

Note: the driver ST-6600 driver has inverted direction, example of inverting direction for alpha motor, changing "0.5" to "0.5!"