How to use software based endstops?

I am experimenting with alternative uses of the openFlexure hardwares.
Already had one breaking on me by putting weird numbers into the serial port.

how can i use the the software based “endstops”?

1 Like

The are a couple of other threads discussing hardware end indicators or position indicators.
Home / Limit switch - Contributions - OpenFlexure Forum
and
An absolute position encoder for the Openflexure Microscope - Contributions - OpenFlexure Forum
Other than that it is hard to have a reliable software end-stop. The current position in motor steps is supposed to be non-volatile, but it is susceptible to being wrong from missed steps or software reset.

I’m afraid I’ve never used any of the endstop options myself - but I have had a few close calls where I’ve accidentally started a long move, both on this and on other microscopes. The most recent iteration of the Sangaboard firmware allows moves to be interrupted, but we’ve not yet had time to update the Python module to take advantage of this. That doesn’t solve the endstop issue, but it would help a lot if you make a long move by accident and realise in time.

If the software endstops are still in the Sangaboard firmware repository, I think it’s a matter of figuring out the right precompiler flags and building the firmware yourself - I am afraid I don’t believe there’s much if any documentation other than the source code.

1 Like

Slowly digging into the firmware…

Wondering if someone could give me some directions…
i think i can send via serial “max 1000 2000 500” something like this.
but not sure if the software based “axes” is really breaking the motion.

Well spotted - I have also just had a quick look. I think the max 999 999 999 command sets the maximum value, but it doesn’t actually enable the endstops. That needs to be done with precompiler - I think if you #define ENDSTOPS_SOFT at the top (I think you don’t need to define ENDSTOPS_MIN or ENDSTOPS_MAX, in fact if you do I suspect odd things will happen!).

If it’s working, the board should respond to modules? on serial including a line that looks like Endstops: soft.