Dual Axis Motors with Smoothieware
Smoothieware does not support dual axis motors and they recommend you rewire the controller board to send the same signal to two drivers. That struck me as something I’d never want to do so I found a better way.
Why use dual axis motors?
Dual axis motors (two motors on a single axis) are common when the axis is heavy or wide. Marlin, for example, supports dual axis as part of the program. Smoothieware does not.
The workaround I wrote uses the axis remapping capability of Smoothieware. This was designed to support Delta and Scara robots, which require serious math to figure out motor location based on XYZ location. We can coopt it to support dual axis, though, kinda.
The above picture shows how the mapper works. Set the configuration in the standard config.txt file using axis_map_x and axis_slave_x (and y and z) with values from 0…Number of motors-1. The defaults are (0,1,2) and (n,n,n) where n=not defined.
This works by having the software asynchronously send both motors in the dual to the same position. That is not the same as sending the exact same pulse train to both motors at the same time. There can be small differences between the two pulse trains. In my testing it works well, but you may need to reduce speed on the dual axis and you almost certainly need identical motors and controllers as the dual motors.
The code is available on github. There are two files (the MappableCartesianSolution cpp and h files) as well as a diff file showing changes to Robot.cpp to include the additional solution.
Upgrade the firmware by adding the two files and modifying Robot.cpp then build it. The following config lines implement the dual motor scheme shown above.
# Arm solution configuration : MappableCartesian robot.
#Translates mm positions into stepper positions
# set up for dual Y using the B motor (X=0, Y=1, Z=2, A=3, B=4, C=5)
Update as of June 2018
While the code posted above worked on Cohesion’s version of Smoothieware, I wanted to work with the latest code. So, there’s a (tested by me) fork of a recent Smoothieware (with the dual motor changes) that works reliably on the Cohesion board.