Using GPIO on duet 3



  • I wanted to know how to hook up a switch to the GPIO on a duet 3. In theory I am trying to nozzle probe and bed probe as two separate probes. With bed probing I am using an inductive sensor, for nozzle probing, I am experimenting with a simple push button.

    Hardware wise when the nozzle pushes on the push button it shorts the 5V pin to the Input of the GPIO. This will send a voltage high triggering the z-probe saving the height.

    As for firmware I have the following code in my config.g
    ; Z-Probe
    M558 K0 P8 C"io8.in" H4 F5000 T18000 I1 A3 ; Set Z probe type to switch and the dive height + speeds
    G31 K0 P950 X-20 Y-1 Z0.4 ; Set Z probe trigger value, offset and trigger height (lowering number raises nozzle)
    M557 K0 X20:380 Y40:430 S60 ; Define mesh grid

    ; Nozzle Offset
    M558 K1 P5 C"io1.in" H0 F5000 T18000 I1 A3
    G31 K0 P950

    Right now on the duet it triggers both z-probes as i trigger the inductive and nothing happens when I push the switch. Does anyone have any insight on how to tacklet this?



  • @jordna-le1299 said in Using GPIO on duet 3:

    I wanted to know how to hook up a switch to the GPIO on a duet 3.

    preferred method is usually a normally closed switch between ground and the input pin with pull up enabled.

    Right now on the duet it triggers both z-probes as i trigger the inductive and nothing happens when I push the switch. Does anyone have any insight on how to tacklet this?

    could you try to reformulate this? also see this thread https://forum.duet3d.com/topic/12457/connecting-multiple-z-probes-for-multiple-independent-z-axis/2 and in particular the link https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_motors



  • could you try to reformulate this?

    464f96d0-1698-4553-90f2-6169b08bf636-image.png

    This is what shows up currently config file. However, when I trigger the inductive probe and only the inductive probe this is what shows up

    3283cae4-e951-4c77-a99d-896aa7ac13cf-image.png

    It acts as the same probe even though they are seperate K's when declaring. And the switch does nothing to the z-probe itsef.

    preferred method is usually a normally closed switch between ground and the input pin with pull up enabled.

    as for this could I use a normally open switch and invert it in the config file making it
    C"^!io1.in"

    Finally with the links it doesn't seem to address how to declare the separate probes. With my current code am I doing it correctly or should something be changed?

    Thanks


  • administrators

    Which firmware version are you using?



  • @dc42 I am currently using RRF 3.1.1



  • @jordna-le1299
    Ok so I got the z-probes to work independently now. However, now when I probe and store into a point (P0) where can I use this value to put it into my nozzle offset?


  • administrators



  • @dc42 if I wanted to store the offset and use it as a variable instead how would I do so. The reason why is because rather than the button being at the bed it would actually be at some known height above it. Therefore I would be able to use that number and offset it from the true height.


  • administrators

    @jordna-le1299 said in Using GPIO on duet 3:

    @dc42 if I wanted to store the offset and use it as a variable instead how would I do so. The reason why is because rather than the button being at the bed it would actually be at some known height above it. Therefore I would be able to use that number and offset it from the true height.

    You could specify the button height as the trigger height of the probe, then it would be taken into account automatically.

    I don't think the Z probe last stop height is currently stored in the OM, but I could add it.



  • @dc42

    You could specify the button height as the trigger height of the probe, then it would be taken into account automatically.

    would this be done through the G31 command in config? Also to trigger it would I use the single z-probe command (G30)

    I don't think the Z probe last stop height is currently stored in the OM, but I could add it.

    Through a firmware update?


  • administrators

    @dc42 said in Using GPIO on duet 3:

    @jordna-le1299 said in Using GPIO on duet 3:

    @dc42 if I wanted to store the offset and use it as a variable instead how would I do so. The reason why is because rather than the button being at the bed it would actually be at some known height above it. Therefore I would be able to use that number and offset it from the true height.

    You could specify the button height as the trigger height of the probe, then it would be taken into account automatically.

    I don't think the Z probe last stop height is currently stored in the OM, but I could add it.

    I have added last stop height to the Z probe object model in the forthcoming RRF 3.2beta.


Log in to reply