Help with 6HC endstops



  • Im building a pick and place machine using the Duet3D6HC. I'm having a little trouble getting homing working. Can someone point me to documentation on how to create the homex.g, homey.g and homeall.g files?
    I hooked up limit switches to +X, -X, +Y and -Y and I may have made a mistake in using the 5V output on IO0,IO1,IO2,IO3. If I put 5V in to those inputs are they damaged now?

    I'm trying to follow the information on this page but the g-code seems to be for an older version of the firmware.

    Thank you for any help you can provide!


  • Moderator

    What kinematics?

    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_files

    You can also get a full config set from the online config tool.

    https://configtool.reprapfirmware.org/Start

    Post your current config.g and homing files.



  • It is a cartesian machine. I'm trying to make the front left be 0,0 and positive movements be to the right and toward the back of the machine. I had to invert the x and y motors to do that. I've attached my config and homex files.

    I tried to use xmin = io.0, ymin=io.1, zmin=io.2, xmax=io.3 ymax=io.4 but for now I've just got one switch set up on io.3. In the homex file I have prompts for the different steps and I only ever get the 'Step1' prompt. Another big concern is whether I inadvertently damaged io0,1,2 by running 5V through my limit switches.

    Thanks for your help!

    homex.g
    config.g


  • Moderator

    RRF doesn't really support min and max endstops. The endstops are only acting during homing moves (G1 H1). During normal operation the printer won't move unless homed, and once homed, will honor the axis limits setup in M208, so having min and max endstops is a bit redundant. You can configure the endstops to act as an estop in case there is an unexpected excursion from the limits, but that's pretty rare for anything other than CNC with powerful motors.

    @desertgreg said in Help with 6HC endstops:

    Another big concern is whether I inadvertently damaged io0,1,2 by running 5V through my limit switches.

    I believe the io pins are 30v tolerant. You'll have to try a lot harder to damage the Duet 3. 😁

    Nine I/O connectors with 3.3V output signal level and 30V-tolerant inputs
    https://duet3d.dozuki.com/Wiki/Duet_3_Mainboard_6HC_Hardware_Overview#Section_Features

    Your endstop is configured as if it were at the high end of travel, but your homing move is moving towards the low end of travel.

    M574 X2 S1 P"!io3.in" The X2 means high end. X1 would be low end.

    If the 0,0 is the front left corner, and -X moves to the left and +x moves to the right and the endstop is on the left side, then you would use M574 X1 and the homing move direction would be negative as you have.



  • Ok I figured out part of my confusion. If I try to configure all of the endstops, only the last one works per axis. So if I set up the configuration like this it doesn't work because the X1 and Y1 enstops get ignored.

    ; X,Y Endstops are normally open, connected to ground.
    M574 X1 S1 P"!io0.in" ; configure active-high endstop for low end on X via pin io0.in
    M574 Y1 S1 P"!io1.in" ; configure active-high endstop for low end on Y via pin io1.in
    M574 Z1 S1 P"io2.in"
    M574 X2 S1 P"!io3.in"
    M574 Y2 S1 P"!io4.in"

    However, testing with just the first two lines (just X1 and Y1) does work.
    Making progress! It should never happen of course but it would be nice to be able to use all of the endstops so the machine will stop if any mistakes happen.


  • Moderator

    Yes that's right. I only mentioned the X2 endstop because all the rest were commented out in your config, but I should have mentioned that you can only configure it one way at a time for the reasons I did mention about using only one endstop for homing.

    However, since RRF is configurable on the fly you can configure the endstops you want to use as homing endstops right in the homing file and then at the start of a job you can configure all of the endstops as estops.

    https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_RepRapFirmware_3_01RC2_and_later

    Though this is only really useful if you assume you will be getting missed steps. It's far better to spec hardware and tune for no missed steps at all. But it is an option.



  • Thanks a lot, I think I was posting at the same time you were so sorry for the redundancy. It all makes sense now! And my x-axis homing test works once I set the endstop to be a min endstop as you pointed out. Also io.0,1,2 are still working fine. Whew!



  • Oh yeah, one source of confusion for me was when I used the example homing g-code from this page:

    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_files

    It gives warnings that the G-code is invalid due to the obsolete 'S' parameter that needs to be changed to 'H'.


  • Moderator

    @desertgreg said in Help with 6HC endstops:

    It gives warnings that the G-code is invalid due to the obsolete 'S' parameter that needs to be changed to 'H'.

    Thanks for the heads up. I'll add a note about that. S1 was used in RRF2 and is now been replaced with H1. Reason being that G1 S1 is used by some laser software to control the laser, so when in laser mode the duet will use G1 S1 for laser control. And to avoid overlap, homing moves are now done with G1 H1.



  • Another question! I have X,Y,Z and 'all' homing working. I also have two steppers which rotate nozzles that do not need to be homed. I've gotten them working by adding a M564 S1 H0 at the end of homeall.g but I'd rather have a way to tell Duet that A,B are 'homed'.

    How do you suggest I handle the nozzle rotation axes?


  • Moderator

    @desertgreg said in Help with 6HC endstops:

    I've gotten them working by adding a M564 S1 H0 at the end of homeall.g but I'd rather have a way to tell Duet that A,B are 'homed'.
    How do you suggest I handle the nozzle rotation axes?

    You can use G92 to set the current position of an axis and mark it as homed.

    https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_G92_Set_Position


Log in to reply