Best way to home a rotary valve for Duet controlled syringe pump?



  • Hi All,

    I'm trying to use a Duet Ethernet (1.18.1) to control a syringe pump with a rotary valve. I need help figuring out how I might write a homing routine for the valve, which has a segmented wheel which trips an optical sensor- sort of a 2-bit encoder with one wide slot (120 degrees of shaft rotation) and one narrow slot (about 3 degrees of shaft rotation).

    I have the optical sensors working as inputs to the endstops on the Duet.

    My issue is how to do a conditional IF statement to differentiate between the wide slot and the narrow slot? Would it be better to use move commands while checking sensors (G1 Xnnn Fnnn S1), or is there something using external triggers (M581) or Z sensors (M558) that would work better?

    Here's a graphic showing how the wheel and sensor work:

    One thought would be to do a large G1 "forward" (anti-Clockwise rotation) move looking for the sensor (S1), then a small forward move without checking (S0) just far enough to jump over the narrow slot. But then it seems like I would have to change the endstop configuration (M574).

    Any thoughts?

    Thanks in advance,

    -cmefryday


  • administrators

    That sounds reasonable to me. I don't think that changing the endstop configuration in the homing routine should have any adverse effects.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.