Open drain/open collector pin option?
-
Hi there, I'm looking at transitioning the cnc plasma at work from a smoothieware controller to reprap firmware, but have a few questions. On a plasma cutter the torch height controller needs to be able to "hijack" the z axis motor while cutting to keep the cut height constant.
The way I've done this so far is have the height controller provide a high signal on the step/dir pins which are set to open drain. That way the control board can run the z motor as normal, but the height controlller can take over when cutting. I can't seem to find if its possible to do this on a duet. I can see the documentation for inverting pins and the pullup resistors but nothing about using the pins as open drain. There are some hacky ways of achieving the same outcomes using gcode but they are prone to malfunction, so I'd rather do it properly. If anyone could point me to the appropriate documentation that would be helpful, I might be using the wrong words.
-
@trakyanapart the microcontrollers used in Duets to not provide a true open drain output option. You could set the step and direction pins to be inputs instead.
Have you see the experimental height following mode that is supported on some Duets? See https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m594-enterleave-height-following-mode and https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m951-set-height-following-mode-parameters.
-
@dc42 I could be wrong but wouldn't setting them as inputs not let them function as step/dir signals? Would they be able to pull the step /dir pins low and let the height controller pull them high?
I hadn't seen the height controller module, and it seems useful, but the issue for my case I think is that the target value changes for different cuts. What I currently do is probe the z axis to find the material, move to a pierce height, fire the torch, move to cut height, here the height controller recieves an "on" signal and starts a timer, the x/y axis start moving, (here I think the biggest issue lies) the timer runs out after some xy travel so the arc voltage has a chance to stabilize away from the pierce point, then the height controller takes a few dozen readings and averages them to make up for a noisy arc voltage, and sets that as the target.
I'm guessing the dynamic setting of the arc voltage target, the sample averaging and especially the starting midway through a random xy move are going to be easier to do on an external microcontroller. The mcu that does the height controller also doubles with some error handling like pausing the cut if the arc doesn't fire, the reading is too high (sign of worn consumables), etc. I think these will be easier to do off board.
-
@dc42 Hi, I'm just still wondering if setting the pins as inputs would let another microcontroller run the stepper driver instead. If so, this isn't something I can find in the documentation. Alternatively is it possible to temporarily delete/free up the Z axis for the height controller to work, and re establish it when it's needed again?