kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.38k stars 997 forks source link

Replacement of Home XY button with Center XY button seems dangerous. Can crash axes if they have not been homed. #592

Closed kh90909 closed 6 years ago

kh90909 commented 9 years ago

I recently updated Printrun from github and clicked what (I later found out) used to be the home button. Before I realized what was happening, my Y-axis had crashed at the end of its travel!

On Pronterface startup, the X,Y position is assumed to be (0,0), so hitting center XY will move X and Y in the positive direction half way across their ranges. If the axes are not actually at (0,0), this could have bad consequences.

Digging into the code, I see this was changed in commit cb8cd25. Am I missing some new setting that mitigates this, or doing something else wrong? If not, it seems like there should at least be an option to disable this button. Better would be the ability to set the position this button goes to. If it's possible to catch all cases where the motors are turned off or the controller is reset, perhaps the best solution would be to prevent all moves until the printer is homed.

iXce commented 9 years ago

Yes, you can set bed size and bed offsets, which will properly define the appropriate center for your printer ! Otherwise, I'm not sure this is actually much different than moving wrongly by 10cm manually, is it ?

kh90909 commented 9 years ago

But having the center defined correctly won't help if you pull the build platform forward with the motors off to remove your print, then forget to home before clicking the center XY button, right?

I agree that this is similar to manually moving wrongly, but I think the difference is that the danger is much less obvious. To me at least, it's pretty clear that moving 10/100 mm in the positive direction will be dangerous if the axis is close to the end, but it's not so intuitive that center XY might cause a dangerous 10 cm positive move.

Also, with a single click, center XY starts a large move in two directions. There is very little chance to abort, and because the move is so large, the motors could be grinding for longer. With 0.1/1/10 mm manual moves, it's much more likely that you'd notice what's happening before crashing, and even if you do, the motors would grind for a shorter time.

There's a Marlin discussion on preventing dangerous moves, here, where it is mentioned that there are internal variables tracking whether the axes have been homed. I suggested exposing these via Gcode so that the host software could prevent dangerous moves until homing had been carried out.

iXce commented 9 years ago

I agree, but this is a tough decision I think. Preventing dangerous moves would indeed be the best. Not sure how to properly do the back communication from the printer in this instance.

kliment commented 9 years ago

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Or should we just home both axes before centering?

On 11/20/2014 08:22 AM, Guillaume Seguin wrote:

I agree, but this is a tough decision I think. Preventing dangerous moves would indeed be the best. Not sure how to properly do the back communication from the printer in this instance.

--- Reply to this email directly or view it on GitHub: https://github.com/kliment/Printrun/issues/592#issuecomment-63770141

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1

iQIcBAEBAgAGBQJUbaVLAAoJEC9FHFwEZzqV9UMQAJvynSb8nHdtXWyDSHt3i1wQ 5wtG1xqQrVzYuu37Ber3lO0S4ZgCVVVh/KJMcFhnENyTzj57qcGE8quglqLQ2Y+A jKh5fUDxdXoFBGh0r6xMXEfKxb31sdX7N30E140ZbZkXdU0/XhoAV6sareHLdcEW jzmEuN3i/NYGDP9Uqh2xevgqVaP8HAV0paSyawZ1s7F+Kt0V+HMP2wavfJF+4OKG prOwnGf2tXVqy5Z+NUJZI/ReIOVOfK4SxqrhJPkKxaChtyGXESCA2WhDfGSbpG5s UxKPC/SHmD41XJPT/d7MFcqrV0kL2UZ6/nXZnU30BVY4/ekRV0Bwlm5MhYvde+EY 9g31tULI/m69H8QLPWB4ICOzZiRFDNHsUMPWIO1GUUpzxQm9Q9/ZYdf5QyT9fpyE Gqz1H6bcQz7ETGdg2QxYMCVOkeGk+/Ch0FcIEvJZYjEZphtL0mLreA/Wx+1sG7DK 8SAZIULQ9aPPLiwPGtV5yY7+IXdicn3O124xwn6P+RyJD4s5TB96DkKdRCVOQ+9S 8payejH31hy+dGwisn72eJNSbgPV1lTW682Yom45m2uzg2h5Ua7Q3JjSzRJG9DIK xq74YD3IaCKgaJ1CDFEuRsETnLyz7PzdXOJublY6HLD5W8ONlMLQ6KbKNXP+K86/ hkkvSDnkxfnwy+MlrX95 =Eq9G -----END PGP SIGNATURE-----

iXce commented 9 years ago

This was kind of a propose behavior, but the people requesting the button basically said it would be useless for delta printers, while their goal was a simple centering button for delta printers.

kh90909 commented 9 years ago

@kliment why didn't I think of that? This seems like a simple change which would remove the danger without disabling any functionality. Also, if in future it's possible to query the firmware for the "homed" status, then the centering code could check this first and only home if necessary.

I don't have a delta printer so I'm not exactly sure what the issues are, but I guess it's the fact that homing will necessarily move Z to the top or bottom. If/when the firmware can report the "homed" status, this problem would be avoided. In theory, this centering operation could be dangerous for an un-homed delta printer too, if the axes are misaligned and too close to the ends.

I think this change from Home XY to Center XY is beneficial for delta printers, but negative for cartesian printers. Perhaps a more equitable solution would be to have a button for both, or the option to switch between them? I know it is painful to have to support variations of the UI for different printer types, but this is perhaps a case where it is worthwhile. Home X and Home Y have no meaning for a delta printer, and Home Z doesn't map very well either - does it zero all axes independently, or just raise Z until one axis hits an endstop?

@kliment, @iXce, the Marlin developers seem willing to consider adding the ability to query the "is_axis_homed" status via Gcode, but they are concerned about breaking host software. If you have a chance, it would be great if you could comment here on whether the proposed approach of returning this info via an M105 S<n> code would cause problems with Printrun.

kh90909 commented 9 years ago

@iXce I'm re-reading your comment that the delta printer users said the home XY "would be useless for delta printers". Is this because home XY does nothing on a delta printer? If so, then doing home XY before the center wouldn't have any negative effect for them, and it would remove any danger for cartesian printers.

kliment commented 9 years ago

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

No, it homes all axes. Maybe we need an option to home before centering?

On 11/20/2014 07:58 PM, kh90909 wrote:

@iXce I'm re-reading your comment that the delta printer users said the home XY "would be useless for delta printers". Is this because home XY does nothing on a delta printer? If so, then doing home XY before the center wouldn't have any negative effect for them, and it would remove any danger for cartesian printers.

--- Reply to this email directly or view it on GitHub: https://github.com/kliment/Printrun/issues/592#issuecomment-63859872

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1

iQIcBAEBAgAGBQJUbjuRAAoJEC9FHFwEZzqVcYIQALdot8O5lpsDNANBe99COKQr S1qKJfbutzXVtvyrufeB31oAV2CL4FvY7m0Oad9DiPDJtVQ3AfXkrj3/rSwZKMvx +cuWi8Zt2H0qNdrKOK7bnXLbA8lGpHa+TEpKL9FlODhuzJW2HMhg40gu6hkI7RLP aGbuxJd0ef7vrDsu6R7oZf59fc7MCx8vwKPlT3WmIYU2l/XV3mfY6J0a4o+OTtRB 9twTGlK1mD7FUNoiQdFHNewPtwcK1dKc2mKE9E70J6gcJO2/gd+5/fiGO2/5ljOP Lr6ALHzlZoLrild8hCpq3HCTd33+WrbpsotSFhTFlNUQkKuJ5h+vdvgcF51up03Y JJTrSBv/bxScIDzaW7kUnemtl9o0Nv3Fq3es/soV6aICjVkA60kd6n+YSlHvM/ic iKAg2nlsbW7l3DuEHFhh83TrrH5TkSRfobMSPKkG3Ijk/sr7XakNo4dlTQcqBMTh 7b5Kw3DoKDOWixyymFZsv5IeFMojG/qE0RXm0RhXmQFj3Re9e6XLPnPKKjQl3EFI 95IQnoRXcPk1VT2IuVe1CuVSxmCCdiGG7VY0t1lUMwfb7bc08BrkWLtQUmqUFMOp Nniqs+R80/V5PHJUaMY+HDnf46GFEKsfye6PZhJ9TMiyLdwVOO3QjOXvjAO2HYUS nkDJ8CDOTgVLI7JztvTt =0UHx -----END PGP SIGNATURE-----

iXce commented 9 years ago

@kliment: That's what I'd do too, I think !

kh90909 commented 9 years ago

Sounds good to me. Thanks.

nicksears commented 9 years ago

am I missing something, or why not have an option/setting that switches between delta and cartesian? center "homes" for delta, and "homes" AND "centers" for cartesian (at least until theres something implemented that checks if XY have been homed).

Also, it looks like Y and Z home buttons have been switched? I think it made more sense with X and Y at the top and Z down at the bottom near the Z-down buttons...an option for that would be nice as well.

gege2b commented 9 years ago

@kliment I think a more useful option could be to tell Printrun that we own a cartesian or a delta printer by adding a "Delta printer" checkbox (unchecked by default). The "home XY" button would change to "center XY" according to this option.

This way, even if a delta owner forget to set this option, the worst case would be his printer to home instead of center, and it change absolutly nothing for cartesian printer owners

And then everyone would be happy :)

gege2b commented 9 years ago

Well, it seems I didn't read the latest comment before ( sorry @nicksears ^_^ )

iXce commented 9 years ago

Will do it asap (hopefully this afternoon) :)

zenmetsu commented 9 years ago

Actually, the most useful option would be to have all of the UI buttons be configurable, like macros. As a delta bot owner, I don't want my delta to re-home prior to going to center. The whole idea is that the center X/Y button will do just that, move the print head to center X/Y while leaving Z unchanged.

It should be common sense that if you manually disrupt the printer's position... i.e. cause a motor to skip, move your print bed, or yank the effector around while the motors are not energized and holding position... that you need to re-home the printer to allow the software to re-learn where the print head truly is.

If all of the UI buttons were made configurable, someone could just ram a 'G28' before the 'G00 X0 Y0' and get the desired homing operation prior to centering X/Y.

zenmetsu commented 9 years ago

Also, if the manual move clamping actually worked, you will avoid unsafe moves assuming that you properly set up your build volume and the print head is actually where pronterface thinks it is.

a0s commented 9 years ago

For now I get last version of Printrun (git pull --rebase), press XY Home and .. almost broke my printer! WTF ?! :( I think need message box about changing of button functionality..

kliment commented 6 years ago

I'm closing this issue because of a lack of activity. Feel free to reopen if you encounter this problem again.