Connecting the servo of a dual switching hotend
-
Hi. Trying to connect a Dual Switching hotend v2.1 (Makertech) to a Duet3 6HC gives me issues. The change of hotends is managed by a servo. This 5V servo is advised (by Makertech) to go by the accompanied relay switch. This results in 6 wires, of which 2 are 'signal'. Connecting to the PWM as suggested is straightforward. The PWM should be combined with the Io-9, with only 2 wires.
This is beyond me, but critical for the workhorse I'm constructing.
Has anyone suggestions to tackle this?
Appreciated.
-
@TomVisser To wire it as they recommend, you need two control pins; one to turn the relay on and off (that powers the servo), and one to send the PWM control signal to the servo. So:
- Use the 'out9' pin on the '5V PWM' header (for VFD/Laser/Servo) for the servo signal
- Use any other IO out pin, eg io3.out on the IO3 header (it does not need PWM capability), to provide the signal to the relay. Note that this pin switches to GND, it doesn't provide +3V or +5V. This should work for the relay, but if it doesn't, you may need to contact the manufacturer to check if the relay works with this, or needs a different signal.
- Connect +5V and GND from either connector (ie '5V PWM' or 'IO3') to the relay and the servo. You can use either, or both, whatever works neatest for your wiring.
- For configuration, set the relay pin as a GPIO pin, and the servo pin as a... servo pin, with M950, eg:
Note that the io3.out pin may need inverting, eg C"!io3.out" to get the relay to work the correct way.M950 P0 C"io3.out" ; create output/servo port 0 attached to io3.out M950 S1 C"servo" ; create servo port 1 attached to servo
- For operating the servo, you need to send the command to turn on the relay before setting the servo position. And give it time to finish that move before turning off. eg
M42 P0 S1 ; turn on relay M280 P1 S170 ; move servo to 170 degrees G4 S1 ; wait for servo to reach position M42 P0 S0 ; turn off relay
Alternatively, if you don't want to wire in the relay, you can just wire the servo to the '5V PWM' connector, and turn the servo off with M42. eg:
M280 P1 S170 ; move servo to 170 degrees G4 S1 ; wait for servo to reach position M42 P1 S0 ; turn off servo
As they say in their instructions, this may be more susceptible to picking up interference from motor or heater wires, and moving unexpectedly.
See https://docs.duet3d.com/en/User_manual/Connecting_hardware/Motors_servos for more details on running servos, particularly the note stalling motors by commanding them beyond their working range:
Be very careful not to command the servo beyond its working range; often small, cheap servos have a working range of 10° to 170°, so sending M280 P# S0 or M280 P# S180 will result in a stall.
Let me know if that helps.
Ian
-
@droftarts Thank Ian, this gives me enough to find a solution! Since the wiring (of 2 dual switching hotends) is still under construction, it might take a while till testing. I'll report results. Maybe there are more lunatics to try printing with 4 hotends like this .....
-