Endstop and closeloop encoder

44 views
Skip to first unread message

svetozar161

unread,
Sep 27, 2025, 2:25:43 PM (13 days ago) Sep 27
to OpenPnP
Hello, like-minded people. I'm going to switch to stepper motors with closed loops on all axes. On the Y axis there will be a Nema23 with a CL57 driver with an encoder, on the X and Z axes there will be external boards from MKS Servo42D. These boards have separate inputs for connecting the limit switch, which confused me. There is no such input on the "adult" CL57 driver. My higher controller board is based on the Octopus Pro. Related questions:
1. How does the encoder and driver determine the zero point after power on? Or is it reset after giving the G90 command? What is the algorithm?
2. Which HOME limit switches should I use? Which ones are on the Servo42D boards? Or on an Octopus Pro controller? In the first case, Open Pnp will not know that the limit switch has been triggered (there is no feedback from the program), and in the second case, will the driver encoder reset for sure or not?
In general, I'm confused and confused about how this system works. Please explain who can. Thanks for the reply.

Henrik Olsson

unread,
Sep 28, 2025, 8:27:59 AM (12 days ago) Sep 28
to OpenPnP
Limit switches blocks/stops the movement.
Home switches sets the reference point (machine zero). Sometimes a single switch can serve both purposes, depends on what it's connected to.

You will need home-switches connected to and setup in your Octopus Pro. OpenPnP then issues the G28 command which will drive the motors towards the home-switches to find the machines zero-position (or whatever you set it up to be). G90 is something else, it is used to tell the controller that positions you give it are to be interpreted as absolute coordinates (as opposed to relative, ie distance).

Limit switches aren't mandatory. Both the controller (at least Smoothie) AND OpenPnP has software limits you can setup in order to prevent user errors from running the machine off the rails. That, of course, doesn't cover cases where loss of position makes the controller drive the machine off the rails but with closed loop that really shouldn't be an issue. 

On my machine I have optical sensors for home/reference, connected to the controller board (Smoothieboard v1 in my case). This (and a homing fiducial) takes care of the homing. I do have limit switches on X and Y and these are wired straight into the servo drives for those axes. Mostly because these are 400W AC-servo motorn and IF I'd run those into a hard stop at full speed I'd certainly break something.

So, towards each end of X/Y travel I have: OpenPnP soft limit->Controller soft limit->Drive limit switch->Crash. In the event that I hit the actual limit switch OpenPnP will not be aware but I can live with that. On Z I don't have any limit swith, only home-switch and soft limits.

I think the above covers your second question. As for the first, your typical closed loop stepper drive (like the CL57) doesn't really have a zero point. Their "zero" is wherever it's powered up. The encoder is used to keep track of the motor shaft relative to input pulses, it's up to who's sending the input pulses to keep track of machine position. Now, something like the MKS might (I don't know) have more tricks up its sleeve, like built in indexer functions etc and for THAT they might need an external switch to set a zero point but for what you're doing it shouldn't be needed and the home/reference switch should go to the controller.

/Henrik.
Reply all
Reply to author
Forward
0 new messages