Welcome! Log In Create A New Profile

Advanced

adding axis stop/homing switches to Z and X

Posted by rayhicks 
adding axis stop/homing switches to Z and X
January 15, 2014 05:46AM
I'd like to be able to use a microswitch on the X axis for homing, rather than using the IR sensor - would this require firmware changes, or is there a g-code that would allow this behaviour? Similarly, for Z I'd like a switch that would stop the axis dropping if I stupidly hit the wrong button and tell it to move -100 or -10 when I meant it to go up this would be more of an emergency stop than a homing switch I guess.


Ray
Re: adding axis stop/homing switches to Z and X
January 15, 2014 06:23AM
@Ray, yes good features to have, I want them too! smiling smiley


Ormerod #007 (shaken but not stirred!)
Re: adding axis stop/homing switches to Z and X
January 15, 2014 06:56AM
On switching on the machine, it doesnt know where it is. I was planning to rig up a startup "Guard" mode in which no moves were allowed until x, y and z had been homed.

On trying to move without all three axes being homed, you should get some message e.g "Guard on - Please home your axes before requesting moves. Press 'H' to run the homing script, or type "Naff off"" to turn off the guard"

Once the 3 axes are homed then any out of range moves can be disallowed.

OK - talk is cheap.. Action by me on this is in progress but results are some way off!

regards
Andy


Ormerod #318
www.zoomworks.org - Free and Open Source Stuff smiling smiley
Re: adding axis stop/homing switches to Z and X
January 15, 2014 07:28AM
Can I make another suggestion to this as well. I always home my X and Y when I start up the machine while the bed starts to heat up. But because of my computer/machine setup I sometimes get confused as to positive or negative X and Y movements. (This is because I am sitting behind the machine). This means that sometimes I tell the machine to move off the end of the table - making it try to go to -x100. Surely the firmware can stop this from happening? In my other CNC machines if you give it a command off the bed it pops up an error saying movement is out of bounds or it will move to the limit and stop. It would be better if the reprap would do something to stop it running the motors against the endstops.


Ormerod 313
Re: adding axis stop/homing switches to Z and X
January 24, 2014 10:07AM
After dc42's information in another thread: [forums.reprap.org] , I've tested homing X using a microswitch rather than the IR sensor, and it does indeed work as I'd hoped and as dc42 helpfully explained (briefly, remove M558 P1 in config.g, add a microswitch wired in the same manner as the Y microswitch - using the two end pins on the switch, wiring into a 3 way 0.1" connector on the two end pins, then plugging it into the X-Axis stop position next to the X axis motor pins on the duet ). I haven't altered the Z behaviour yet (in homez.g), since I generally set z's home manually.

I'm posting the information here not because of a deficiency in the standard way of homing X, but because it's a useful alternative for self-builders, and for those who (like me) may not be currently using the IR sensor, and it doesn't seem to be a documented option (even though there's a mounting point for an X microswitch on the X motor bracket)

Ray
Re: adding axis stop/homing switches to Z and X
January 24, 2014 11:50AM
Quote
tracyb
Can I make another suggestion to this as well. I always home my X and Y when I start up the machine while the bed starts to heat up. But because of my computer/machine setup I sometimes get confused as to positive or negative X and Y movements. (This is because I am sitting behind the machine). This means that sometimes I tell the machine to move off the end of the table - making it try to go to -x100. Surely the firmware can stop this from happening? In my other CNC machines if you give it a command off the bed it pops up an error saying movement is out of bounds or it will move to the limit and stop. It would be better if the reprap would do something to stop it running the motors against the endstops.

I guess the reason is that the firmware is designed to work in different or modified machines with larger printing areas. Still, if the maximum limits were to be set up in the startup file, the firmware could easily be modified to refuse or truncate any moves that are out of bounds.

Dave
(#106)
Re: adding axis stop/homing switches to Z and X
January 27, 2014 07:17AM
Agreed - You could set your max limits up once off, I cant tell you how bad I feel each time I give a -x100 instead of a +x100
Re: adding axis stop/homing switches to Z and X
January 28, 2014 08:26AM
Quote
rayhicks
I'd like to be able to use a microswitch on the X axis for homing, rather than using the IR sensor - would this require firmware changes, or is there a g-code that would allow this behaviour? Similarly, for Z I'd like a switch that would stop the axis dropping if I stupidly hit the wrong button and tell it to move -100 or -10 when I meant it to go up this would be more of an emergency stop than a homing switch I guess.


Ray

what is wrong with the current way X is homed?
Re: adding axis stop/homing switches to Z and X
January 28, 2014 08:28AM
Quote
tracyb
Can I make another suggestion to this as well. I always home my X and Y when I start up the machine while the bed starts to heat up. But because of my computer/machine setup I sometimes get confused as to positive or negative X and Y movements. (This is because I am sitting behind the machine). This means that sometimes I tell the machine to move off the end of the table - making it try to go to -x100. Surely the firmware can stop this from happening? In my other CNC machines if you give it a command off the bed it pops up an error saying movement is out of bounds or it will move to the limit and stop. It would be better if the reprap would do something to stop it running the motors against the endstops.

was is wrong with the home all axis button on the GUI?
Re: adding axis stop/homing switches to Z and X
January 28, 2014 08:37AM
Quote
arnaud31
Quote
rayhicks
I'd like to be able to use a microswitch on the X axis for homing, rather than using the IR sensor - would this require firmware changes, or is there a g-code that would allow this behaviour? Similarly, for Z I'd like a switch that would stop the axis dropping if I stupidly hit the wrong button and tell it to move -100 or -10 when I meant it to go up this would be more of an emergency stop than a homing switch I guess.


Ray

what is wrong with the current way X is homed?

Read the bit you quoted - I don't want to use the IR sensor for homing X.
Re: adding axis stop/homing switches to Z and X
January 28, 2014 09:08AM
Quote
arnaud31
Quote
tracyb
Can I make another suggestion to this as well. I always home my X and Y when I start up the machine while the bed starts to heat up. But because of my computer/machine setup I sometimes get confused as to positive or negative X and Y movements. (This is because I am sitting behind the machine). This means that sometimes I tell the machine to move off the end of the table - making it try to go to -x100. Surely the firmware can stop this from happening? In my other CNC machines if you give it a command off the bed it pops up an error saying movement is out of bounds or it will move to the limit and stop. It would be better if the reprap would do something to stop it running the motors against the endstops.

was is wrong with the home all axis button on the GUI?

I have no problem with the homing buttons - but after the machine is homed the firmware should not allow you to perform a movement that would drive the motor out of limits. For example if your x is at 80mm a button press to decrease x by 100 should take it back to the zero and no further. It could be added into the firmware and configured for the bed size of your machine.


Ormerod 313
Re: adding axis stop/homing switches to Z and X
January 28, 2014 09:22AM
Quote
tracyb
Quote
arnaud31
Quote
tracyb
Can I make another suggestion to this as well. I always home my X and Y when I start up the machine while the bed starts to heat up. But because of my computer/machine setup I sometimes get confused as to positive or negative X and Y movements. (This is because I am sitting behind the machine). This means that sometimes I tell the machine to move off the end of the table - making it try to go to -x100. Surely the firmware can stop this from happening? In my other CNC machines if you give it a command off the bed it pops up an error saying movement is out of bounds or it will move to the limit and stop. It would be better if the reprap would do something to stop it running the motors against the endstops.

was is wrong with the home all axis button on the GUI?

Your post implies you home by hand. Hence my question on not using the home button!
Again, just conscious that to the untrained eye there seem to be yet another issue when really there isn't.
Re: adding axis stop/homing switches to Z and X
January 28, 2014 10:34AM
Quote
tracyb
I have no problem with the homing buttons - but after the machine is homed the firmware should not allow you to perform a movement that would drive the motor out of limits. For example if your x is at 80mm a button press to decrease x by 100 should take it back to the zero and no further. It could be added into the firmware and configured for the bed size of your machine.

I'll take a look at this next time I work on the firmware. The M208 command to set the axis lengths is already supported. Looks like it just needs some flags to remember whether the axes have been homed, and to use the stored axis lengths as limits if so.

Edited 1 time(s). Last edit at 01/28/2014 10:35AM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: adding axis stop/homing switches to Z and X
January 28, 2014 10:43AM
Quote
dc42
Quote
tracyb
I have no problem with the homing buttons - but after the machine is homed the firmware should not allow you to perform a movement that would drive the motor out of limits. For example if your x is at 80mm a button press to decrease x by 100 should take it back to the zero and no further. It could be added into the firmware and configured for the bed size of your machine.

I'll take a look at this next time I work on the firmware. The M208 command to set the axis lengths is already supported. Looks like it just needs some flags to remember whether the axes have been homed, and to use the stored axis lengths as limits if so.

I'd be happy to beta test this if you make any progress dc42 - I still have errors of intent (though becoming rarer now with familiarity and caution) where I try to drive past the end of the axis rather than towards the beginning (less disruptive now that my Y belt is held better, but still probably not good for the machine in the long run).

Ray
Re: adding axis stop/homing switches to Z and X
January 28, 2014 10:54AM
This needs a specification to start from. I'm thinking along the following lines:

1. Remember which axes have been homed. At power up or reset, none of them have been homed. [But this doesn't allow for automatic save/restore of position in EEPROM when power is cycled, which I am considering adding.]

2. If z-homing is being done with an IR sensor, then if a command is given to home Z but either X or Y has not been homed, do not execute the command but report an error. Likewise, refuse a G31 command if X and Y have not both been homed. [Do we also need to have homed Z for G31 to work properly?]

3. If an attempt it made to move to a negative location, or a location beyond the end of an axis, and that axis has been homed, truncate the move to the appropriate limit, and report that this has been done. Except that if homing is being done on that axis, don't apply a limit.

4. Add an extra variable in the JSON response so that the web interface knows which axes have been homed.

Have I missed anything?



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: adding axis stop/homing switches to Z and X
January 28, 2014 12:09PM
@dc42, looks comprehensive to me... I have no idea if G31 requires Z be homed (though I suspect it was more a mental note than a question smiling smiley).

Does point 2 need to be conditional on homing method? If homing with a Z endstop rather than the IR probe, it doesn't seem unreasonable to have X and Y homed first so you know where Z is homing to in the XY plane so I'd suggest it could work unconditionally.

Ray
Re: adding axis stop/homing switches to Z and X
January 28, 2014 07:07PM
I've implemented this in the firmware build at [dl.dropboxusercontent.com]. I also made doing a G92 command set the appropriate "axis has been homed" flags.

I'm not certain that enforcing Z=0 as the minimum height is a good idea, because it means that after homing Z, if you put the head over the bed at a point where the bed is lower, you can't drop the head any more unless you do e.g. a G92 Z1 first. Maybe I should allow Z to go down to e.g. -1mm?



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: adding axis stop/homing switches to Z and X
January 29, 2014 03:57AM
This really needs ability for Duet to issue a prompt. E.g consider the calssic example of typing something into a wordprocessor app and then quitting the app. You get a "Do you want to save work before exit?" prompt.

Dunno if its possible though.

regards
Andy


Ormerod #318
www.zoomworks.org - Free and Open Source Stuff smiling smiley
Re: adding axis stop/homing switches to Z and X
January 29, 2014 08:36AM
Quote
dc42
I've implemented this in the firmware build at [dl.dropboxusercontent.com]. I also made doing a G92 command set the appropriate "axis has been homed" flags.

I'm not certain that enforcing Z=0 as the minimum height is a good idea, because it means that after homing Z, if you put the head over the bed at a point where the bed is lower, you can't drop the head any more unless you do e.g. a G92 Z1 first. Maybe I should allow Z to go down to e.g. -1mm?

I can think of future applications that may want to print in a way that is not simply layer-by-layer, which could need the head to dynamically drop below the zero set-point. As an experiment, I recently printed a logo onto a part in a different colour, and to do so I set the Z zero point as the surface of the part I wanted to print the second colour onto. It worked better than I thought it would. The part I printed onto was a simple flat disk (to make a coaster - using plastic that changes colour with temperature), but so long as there is sufficient clearance around the hotend, there is no reason why you could not print onto a part that is not perfectly flat.

Dave
(#106)
Sorry, only registered users may post in this forum.

Click here to login