Software axes limits (soft-endstops)

662 views
Skip to first unread message

Marek T.

unread,
Oct 20, 2017, 10:29:36 AM10/20/17
to OpenPnP
Hi Jason and Everybody

Just today I've downloaded and compiled the repository of experimental Smoothieboard firmware with added "soft-endstops".
It's available here: https://github.com/Smoothieware/Smoothieware/pull/1149/files

Tested and found working very good as for me. Finally don't have to care when hit with axes into "stoppers"...

If the "soft_endstop.halt" is enabled the Smoothie blocks and wait for M999 gcode restart.
I have preffered to leave it disabled. Effect is that when Smothie gets coordinates sending axis to the out of limit just don't realize it but send unusable notification to the host (note we also get OK for M400 unfortunately), and waits for the next commands.
Sample: limit X is 500. We send X from 400 to 510 and axis stays at 400 (but Openpnp thinks that is at 510). Next we send X-20 and axis goes to 490.


You must add declarations to the config:
+soft_endstop.enable true # enable soft endstops
+soft_endstop.halt true # HALT when soft endstop triggered (safest) when set to false the entire move will just be ignored
+soft_endstop.x_min 0.0 # minimum X
+soft_endstop.y_min 0.0 # minimum Y
+#soft_endstop.z_min 0.0 # minimum Z NOTE leave commented out to disable checking for this axis
+soft_endstop.x_max 500.0 # maximum X
+soft_endstop.y_max 500.0 # maximum Y
+#soft_endstop.z_max 40.0 # maximum Z NOTE leave commented out to disable checking for this axisAttached openpnp.log and firmware.bin.

Attached firmware to flash and openpnp.log if you would like to analyze - maybe some idea how to serve it better from Openpnp eventually. Maybe useful for someone else.
NOTE: remeber it's experimental firmware. I have played with this few hours and have no noticed any problems but some bugs there are still possible.

cheers
M.


firmware.7z
OpenPnP.log

Jason von Nieda

unread,
Oct 20, 2017, 4:53:42 PM10/20/17
to OpenPnP
Very interesting! For reference, you may be able to use COMMAND_ERROR_REGEX to see when the soft limits are hit and notify the user.


Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e827b5e1-a07e-449b-9210-d49e0fc0b2d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karl Zeilhofer

unread,
Oct 20, 2017, 5:11:00 PM10/20/17
to OpenPnP
With the TinyG we are also using soft limits.
It helps to avoid crashes with the endstops, but the controller has to be resetted afterwards anyway. It doesn't reply with the typical stat:3 statement. So we get a timeout in OpenPnP.

Marek T.

unread,
Oct 20, 2017, 6:55:34 PM10/20/17
to OpenPnP
Here you can choose what you wan to have, to block controller and need to reset it manually or just go further. For plays with machine tuning the blocking is irritating.
While normal working if there are no errors in PCB job or feeders all this is not very important at all. But could be good to get some info that endstop break event has occured maybe.
Thx for regex reminding Jason. Something like that I've meant telling about some better idea how to serve this feature :-).

SMdude

unread,
Oct 20, 2017, 8:10:28 PM10/20/17
to OpenPnP
Hi Marek,

What head setup are you running?

Jason had a custom smoothie firmware for use with the Peter Betz style head, to make homing Z work properly.

Hope we can get soft-endstops working across the board, there is no feeling more dis-satisfying  than watching your machine hit the end at full speed.


Marek T.

unread,
Oct 20, 2017, 8:17:21 PM10/20/17
to OpenPnP
Hi Michael

What do you mean as the head setup? My heads are pneumaticaly moved up/down (it's retrofited Philips' machine).
Attached firmware works well with XY axis soft endstops. I just haven't tested it with Z because my heads don't use it.  But there is Z icluded as you se so probably it also works like xy - it means properly.

SMdude

unread,
Oct 20, 2017, 9:26:05 PM10/20/17
to OpenPnP
Hi Marek,

If you take a look at videos of smallsmt machines, you will see how the head is set up. There is one Z motor and 2 nozzles.

Jason forked smoothie and made some small changes to allow this type of head setup to home correctly.
It was a case of :
if Z endstop is active move nozzle 1 down,
if z endstop is not active, move nozzle 1 up

Well that is the basic gist of it anyway.

Oh, software limits on Z would be nice too ;) Oh the pain I feel when I jog Z 100mm!



Marek T.

unread,
Oct 21, 2017, 5:36:45 AM10/21/17
to OpenPnP
Hi Michael,

It's crazies craziness how many times I've hit into stoppers while jogging. Now I can f* it :-). Comfort is excellent no need to explain.

I've head with 3 nozzles set up/down independently by turning on/off some pressures, no motors for this. Only for rotating there is one common motor for 3 nozzles, C-share (have customized openPNP for this). Each nozzle has one switch telling that nozzle is up (N/C is up, N/O is down). I'm using them to know if may perform the axes moving, to don't move with lowered nozzle.

To control it I'm using my small controller controlled by gcodes, it's connected as main driver to openPNP (Smoothie is as subdriver). It has 8 inputs and 8 outputs. It is also controlling pick pressures read status and on/off it, and gives signal to set nozzle up or down.

I'm not powerful to dig in Smoothie code. I've only downloaded modified source and compiled as it is. Because they don't publish bin files compiled from coded not qualified as final version. Then put it here for others...

Karl Zeilhofer

unread,
Oct 21, 2017, 5:50:30 AM10/21/17
to OpenPnP
I still dont understand, why softlimits are not implemented in openpnp. Jason said it is the responsibility of the cnc contoller, but it would be stll very nice to have an independent stage which everyone could configure without needing spetialized firmware. Also the exceptionhandling would be much better when done directly in java.

Just my 2 cents

Marek T.

unread,
Oct 21, 2017, 7:17:33 AM10/21/17
to OpenPnP
Yes Karl nobody understand it but Jason :-). Frankly speaking it is on the Jason's requests list if remember well. Probably it's mainly problem of his time and priorities, many other things are still more important in fact.
So I've decided to use what is available on the moment, better worse solution than nothing :-).

Jason von Nieda

unread,
Oct 21, 2017, 10:19:24 AM10/21/17
to OpenPnP
https://github.com/openpnp/openpnp/issues/308

It’s not done because no one has done it. It’s as simple as that :)

Jason
On Sat, Oct 21, 2017 at 6:17 AM Marek T. <marek.tw...@gmail.com> wrote:
Yes Karl nobody understand it but Jason :-). Frankly speaking it is on the Jason's requests list if remember well. Probably it's mainly problem of his time and priorities, many other things are still more important in fact.
So I've decided to use what is available on the moment, better worse solution than nothing :-).

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Marek T.

unread,
Oct 21, 2017, 11:08:13 AM10/21/17
to OpenPnP
Hi Jason,

Sorry I'm not some expert and probably make some stupid mistake as effect that don't understand something...

I have set for
Default COMMAND_ERROR_REGEX definition ^error:.*
and sending just error text to the driver. I see that got it in the log but get not some expected message thrown. Where is my mistake?

Jason von Nieda

unread,
Oct 21, 2017, 11:17:04 AM10/21/17
to OpenPnP
Hi Marek, make sure what you send fully matches the regex. If the regex is ^error:.* you should send something like "error:there was an error". Just sending "error" will not match.

Jason


Marek T.

unread,
Oct 21, 2017, 11:41:02 AM10/21/17
to OpenPnP
It was not this. I've already got the message but still something is strange probably (for me).
So I have connected two controllers and configured as Driver and Subdriver (it's Smoothie). I have set two identical regex definition for both of them and it is:

^WARNING Soft Endstop Y was exceeded - entire move ignored.*

And I'm sending by RS following string:
WARNING Soft Endstop Y was exceeded - entire move ignored

If I'm sending it to the Subdriver it works as it probably do, but exactly the same string sent to the main driver does not give any response.

Generally important for me is to get a response from the subdriver so it's not problem for me, now it realize what I need, but only surprised why main driver does not realize this regex.

Jason von Nieda

unread,
Oct 21, 2017, 11:57:01 AM10/21/17
to OpenPnP
That's odd. Please double check your config and report back if you can't get it working. It could be a bug, but I'm pretty sure I've had this working in the past. 

Jason


Marek T.

unread,
Oct 21, 2017, 12:30:05 PM10/21/17
to OpenPnP
Forget it Jason, everything is ok with the code.
It was a problem of my synchronization with Openpnp. Just when Openpnp finishes communication with the first driver and goes to the Subdriver service then no longer analyzes messages incoming to the first driver. And otherwise doesn't read messages sent to subdriver when is still stuck at unfinished communication with main driver.
So everything is probably ok and sorry for the confussion.

Generally this experimental firmware + error_regex using gives final effect just perfect :-).

Jason von Nieda

unread,
Oct 21, 2017, 12:30:53 PM10/21/17
to OpenPnP
Glad to hear it!

Marek T.

unread,
Aug 30, 2018, 10:20:01 AM8/30/18
to OpenPnP
Loaded today the newest edge-firmware of Smoothieboard, instead of my previous experimental self compiled code.
It's officially supporting soft-endstops now (well, I don't know how long time already, but rather not very long).

Since I use it never happened to get onto the limiters hiting - what was quite often before.
Reply all
Reply to author
Forward
0 new messages