Can you compile smoothie to use 2 endstops for an axis?

So I’ve built a fairly large corexy printer running off a smoothie board and it works great. I have dual Z motors/leadscrews and I would love to have 2 Z endstops to ensure that the lead screws re in sync on every print. I’m wondering if there is any way to accomplish this in smoothieware.

Thank you

Imported from wikidot

There is no support for this in the firmware as-is.

Some users have implemented this using logic gates and the switch module to control them, using them to “cut” the path to the “step” pin of a given driver so that you can move only one motor at a time on the axis. It’s a bit of hacking, but it’s “possible” to do.

Thanks for the response. Can you point me in the direction of those who have done this or some info on the methods they have used. I get the concept of having one limit switch stop one stepper but I’m not sure where I would be able to make these changes.


So here is the basic idea.
First, you can use a Gcode to control a pin, read :
The basic idea is this :
You have two stepper motors for your Z, each stepper motor has a stepper driver. Both stepper driver’s step pin are controlled by a single Smoothie pin ( wired in parralel ).
Now if you home your Z, both motors will move in parralel at the same time.
The hack you can do is this : you use two additional pins on your Smoothieboard, and control each pin using custom Gcodes ( see switch module ).
You then wire each pin, using a logic gate, so that each pin can “cut” the path between the smoothieboard’s step pin and each driver’s step pin. So, when you send a specific gcode, only one of the drivers receives steps, and when you send another gcode, only the other driver receives steps.
This way, you can use Gcode to control which driver moves and which doesn’t when you home ( or move ).

Now, to do homing you have to do the following : 

  • Activate both motors using Gcode
  • Home both motors at the same time
  • Activate only the first motor
  • Home that motor
  • Back that motor up a bit
  • Activate only the second motor
  • Home that motor
  • Back that motor up a bit
  • Activate both motors, and use the machine normally

For this to work, you also need both endstops to be wired in parralel to a single input, so that if either of the endstops is triggered, smoothie sees them as a single endstop being triggered

Does this make sense to you ?

Everything makes sense except for how to use the additional two pins. I’m not sure how they should be wired or how to set up the logic gate. Forgive me, I’m brand new to smoothieware. I greatly appreciate you taking the time to help me with this.

So, you want an AND gate.

The way an and gate works is very simple : you have two inputs, and one output. the output turns on only if both of the inputs are on at the same time.

In this case, the way we would use this, is we would have the smoothie side step pin going into one of the inputs, and the smoothie side “control” ( controlled by a switch module ) pin going to the other input. And then the output goes to the step input on the stepper driver.
This way the stepper driver only receives a step if the smoothieboard sent a step *and* the control pin was activated ( using gcode ).

Makes sense ?

So essentially, I need to grab 2 free pins to make a switch and have the pins activate one of each of the steppers when powered and then cycle between them upon activation of each endstop. Does that sound about right?

Yes, about right. You’ll need two switch modules, one per free pin.