I’m looking at the code and realized it doesn’t seem to natively support two motors on one axis without using something like an external hex inverter.
I’m thinking that adding a Y2STEPBIT & Y2DIRECTION_BIT on the ports would work, as long as the step direction is inverted, right?
i.e. in cpu_map.h:
#define XDIRECTIONBIT 7 // MEGA2560 Digital Pin 30
#define YDIRECTIONBIT 6 // MEGA2560 Digital Pin 31
#define Y2DIRECTIONBIT 5 // MEGA2560 Digital Pin 32
#define ZDIRECTIONBIT 4 // MEGA2560 Digital Pin 33
#define DIRECTIONMASK ((1<
To get the Y direction inverted for Y2, that seems a bit trickier as I’m not super familiar with the code base. Setting NAXIS in nutsbolts.h to 4 and modifying getdirectionpin_mask() in settings.c to:
if ( axisidx == YAXIS ) { return((1<
seems like it might work, but I wanted to see if anyone had some thoughts or sees a glaring deficiency in my approach.
#1 – chamnit 于 2016-11-15
@markwbrown : The easiest way to make a second y axis stepper to move the opposite direction of the first is to flip the leads on one of the windings. So if one coil is wired + to -, the other motor would be – to +. This will make the second stepper rotate in the opposite direction.
True. Having a setting to do this for you would be nice but I’m a little busy and this method has worked for years. It’s standard wiring practice on all Grbl-based machines.