Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only move toward endstop if position is unknown. #461

Open
whosawhatsis opened this issue Jul 26, 2014 · 14 comments
Open

Only move toward endstop if position is unknown. #461

whosawhatsis opened this issue Jul 26, 2014 · 14 comments

Comments

@whosawhatsis
Copy link

Some machines have more physical failsafes than others. It would be good to have a configuration option (should probably be per-axis) to only allow an axis to move in the direction of homing (with endstop always enabled) whenever its position is not known. The position of an axis is not known when a machine first starts up and hasn't homed, or when the stepper is disabled allowing the motor to turn freely.

@wolfmanjm
Copy link
Contributor

I'm not even sure how this makes things safer... if limit switches are disabled then moving towards home won't stop anything bumping into the end as endstops are only used for homing.
If limit switches are enabled they can be on both sides so moving in any direction will stop movement if the limit switch is hit. What am I missing?

@whosawhatsis
Copy link
Author

If position is unknown (axis has not been homed since the last time it was powered up), the endstops have to be enabled and the machine has to be restricted to moving toward an endstop. In the strictest form, no motion other than homing would be allowed, but if a cartesian machine has both min and max endstops, it could be allowed to move in either direction, but the endstops would have to stay enabled until the position was known (this would not work for a delta).

On a related note, does Smoothie even have software endstops? I hit Z -10mm after homing the other day when I meant to retract filament and, well, I wouldn't be telling this story if the machine had just sat there and done nothing because Z was already at zero...

The ideal solution would be to have a series of options on the spectrum, with software endstops and nothing but homing allowed until the position is known on one end, and willy-nilly endstops-are-only-for-homing on the other.

@wolfmanjm
Copy link
Contributor

if limit switches are enabled they are on all the time and will protect each axis all the time. I see no reason to only enable them if position is unknown, basically position can be unknown at any time especially of steps are skipped at some time, which is actually why I just implemented h/w limit switches, my new bot was skipping steps and crashing into the ends because it no longer knew where it was.

We don't currently have software endstops. However I think they could be relatively easily added using the same hack I used for hardware limit switches. However I won't be doing that myself due to my unreasonable hate for s/w endstops ;)

@whosawhatsis
Copy link
Author

Even if hardware endstops are enabled all the time, they won't protect you if you only have min endstops, start up at Z100 (thinking you're at Z0) and try to go to Z200 without homing.

@whosawhatsis
Copy link
Author

Actually, in the current system there's nothing stopping you from trying to go Z400 or Z-400 on 200mm tall machine, even if you have min and max endstops.

@whosawhatsis
Copy link
Author

Oh, and it's perfectly reasonable for open-loop firmware to assume that it has been properly configured to prevent skipped steps when it has not hit a hard stop. Having the option to make endstops always active to avoid collisions is a nice failsafe, but a machine needs to be able to trust the person who configured it, even if it can't trust the person who is operating it.

@wolfmanjm
Copy link
Contributor

not sure I understand that comment if you have min and max limits enabled and any endstop triggers while moving it will stop dead. so you will be protected from Z400 or Z-400 it doesn't really care where it is, if an endstop triggers while moving the system will freeze. Total protection is to have min and max endstops on all axis, then you are covered. In fact you only need to use 3 endstop connectors as you can wire min and max endstops up in series wired normally closed to ground.

@whosawhatsis
Copy link
Author

Or in parallel, wired normally-open. Except they don't protect you from anything at all if they're only enabled for homing.

@wolfmanjm
Copy link
Contributor

so enable them as limit switches and you are protected :)
i agree s/w endstops would help some people. maybe someone will step up and implement them.
in the meantime h/w limit switches work fine if you enable them.

@sareph
Copy link

sareph commented Jun 22, 2016

so enable them as limit switches and you are protected :)

Yes, but this is problematic overkill. If limit switches are enabled, and You execute G1 X0 Y0 printer will go to 0x0, hit endstops and everything will stop until M999 or reset. For random god's sake, why? 0x0 is perfectly within limits.
If You don't enable limit switches, you can happily execute G1 X-15 (what I did, because I copied end gcode from my other printer where this is allowable), smoothie will be very happy to smash into endstop, and break it. Aaaarghhh.
If endstop is triggered, header under any circumstances should not move toward that endstop, without halting everything else.

@pelrun
Copy link

pelrun commented Jun 24, 2016

Yeah, I was pretty flabbergasted when I found I had to disable the limit switches because going to X0 Y0 would kill everything.

@Zaaphod
Copy link
Contributor

Zaaphod commented Jan 3, 2017

if going to X0 Y0 is killing everything, then you didn't set up or configure your machine correctly.

Machines should be configured with limits both limits always active, then simply set alpha_min -5 for example... now when you home the machine, X=-5 now do a G0 X0 Y0 and your X is 5mm away from touching the limit switch and returning to X0 at any speed will never trigger the limit switch.
you don't need to even home off the min limit switch, you could home from the max switch and set alpha max to say 105, now when you home your X=105 and moving to a maximum of X100 would never hit the switch. Any good machine design would have the physical limits slightly outside the boundaries of the work table, so you would use alpha_min, alpha_max, beta_min, beta, max, gamma_min, and gamma_max as needed depending on your desired home direction to set your position after homing such that X0Y0Z0 is precisely in on the correct position on the machine table. You don't move the limit switch to a position so that when it homes it's at 0... you move the switch so it's behind 0 so you can get back to 0 without hitting it.

I think the reason everyone is confused by this is they think that since they set a retract distance of say 5mm, that it will set it to 0 after it does the retract, but it sets the axis before the retract happens, so if you have a retract of 5mm, then alpha_min should be -5 if you want it to be 0 after it gets done homing... but most machines would need to be something other than -5 because setting the position of a limit switch accurately is just a waste of time. It's very difficult and not necessary. Just put the switch well outside the work area, home the machine, now jog the machine until you get it to where you want 0 to be then set alpha_min to the negative distance you moved it, so if you moved it 13.412mm set alpha_min to -13.412 now home it again and go to 0 and you will be precisely at 0 and not hitting the switch.

@LucaBertuolo
Copy link

LucaBertuolo commented Sep 15, 2017

Thanks Zaaphod, very interesting...
I'm sill havin same issue on a corexy...

If i follow your council i will solve the problem when homing and got negative value on gcode...
But how can we solve the fact that if we have only min endstop, and X length of 300mm, and after homing i send a G0 X400 this will be very dangerous...
There is some way to set a max_alpla_lenght?

I've always use this parameter in other firmware like marlin or repetier...
With this limit, after homing the carriage will never go over max_alpla_lenght and this will no destroy my printer...

@wolfmanjm
Copy link
Contributor

There is a PR #1149 that has soft endstops, if you want that feature give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants