RepRap Configuration - 5V Relay
-
Hi,
I am connecting a 5V Relay to 5V PWM Pin which is located in between the out9 and temp3 pin for controlling the ON & OFF operation of an plasma torch. I am not able to configure this in the RepRap config Tool. Does this has to be done manually in config.g file?
-
What are the G Codes to configure and is there any example of the same to recreate for this operation?
-
And where should be these G Codes placed? Like in the Config.g file or someother files
-
Could the ON & OFF Operation be controlled by DWC?
-
-
It sounds like you want to switch an IO pin.
See M42 and M950
M950 to create the pin and its roll, and M42 to switch it on and off.
https://docs.duet3d.com/User_manual/Reference/Gcodes#m950-create-heater-fan-spindle-or-gpioservo-pin
https://docs.duet3d.com/User_manual/Reference/Gcodes#m42-switch-io-pin
@SANJR said in RepRap Configuration - 5V Relay:
And where should be these G Codes placed? Like in the Config.g file or someother files
M950 would go in config.g usually and M42 would be used to control it.
@SANJR said in RepRap Configuration - 5V Relay:
Could the ON & OFF Operation be controlled by DWC?
You could create a macro with the M42 commands and control it that way. There is also an extension to DWC called BtnCmd that lets you do more complex button creation.
-
Have tried creating a G-Code for the ON & OFF Operation of a Torch as follows,
M950 P3 C“5V PWM“ ; allocate GPIO port 3 to 5V_PWM (vfd/laser/servo)
M42 P3 S1 ; set 100% PWM on GPIO port 3
The M950 Command pin name "5V PWM" refers to the pin used for VFD/LASER/SERVO, which is positioned between Out9 & Temp 3 pin.
In the G Code M950 Command- Is the name "5V PWM" mentioned is correct?
- And at the last is it necessary to mention (vfd/laser/servo)?
- Q is not mentioned because there is no speed change only ON & OFF the relay?
In the G Code M42 Command - The Pin value is set as S1 to perform ON operation. Will the OFF operation value 0% will be considered automatically?
Request to provide feedback whether the G-Code suffice or if it has corrected?
-
@SANJR is it a bare relay, or a relay board? It makes a big difference.
-
@dc42 Hi,
Planning to use an Keyes SR1y relay module, image of the same shown below.
The Hardware Wiring of the same is as follows
-
@SANJR said in RepRap Configuration - 5V Relay:
Is the name "5V PWM" mentioned is correct?
No. It would be out9.
-
@Phaedrux Thanks
Would the pin name be "out9" (or) "out9,laser,vfd"?
Because the out9 refers to the two pin while the pin trying to use is a 4 pin which is next to the out9. -
Let's start from the top. Which board are you using exactly?
-
@Phaedrux Thanks
I will be using an Duet 3 Mainboard 6HC for building an DIY Research Project. I am planning to install and 5V Relay module for Switching ON and OFF a torch. Planning to control this Relay Module by 4 Pin Laser/VFD/Servo which is between the out9 and Temp3 pins.
Wiring of the same is shown below for reference
Certain set G-Codes would be required to control this operation. I am unable to find a example or reference for this purpose. Requesting support from members..........
-
LASER/VFD v1.0 and later boards only. This provides 5V power and a 5V level signal for a TTL-compatible input to a laser controller, a PWM-to-0 to 10V converter (for variable-frequency drives), or a servo. The control signal for this output is shared with OUT9, so don't use OUT9 if you use this connector.
OUT 7, OUT 8, OUT 9 These are intended for fans. Maximum recommended current 2.5A each when supplied by VIN.
Note: These outputs are protected by a flyback diode connected to V_OUT_LC_2. Do not mix loads connected to V_OUT_LC_2 with the jumper set to 12V and loads connected to V_FUSED on the same bank.OUT7-OUT9_SelectV The positive supply to the OUT 7, OUT 8 and OUT 9 connectors is the centre pin of the 3-pin jumper block labeled OUT7-OUT9_SelectV. A jumper in the top position will power them from the fused VIN supply. Alternatively you can connect a 3-terminal buck regulator to the 3-pin jumper block to supply the required voltage to the centre pin.
The pin name is still out9, but you can also use laser, or VFD.
In your case I'm not sure if it makes sense to use VFD or laser. What mode of operation will you be running in normally? If you just need to switch the relay, out9 seems to make sense to me.
Perhaps @DC42 has better advice though.
-
@Phaedrux Thanks for Your Feedback.
I have got some clarity the name of the pin is out9. I would be doing a simple ON & OFF Operation.
The Relay module is a simple 5V relay. This is my first time doing an DIY project so wanted it to as simple as it could be. That's the main reason of using an "5V PWM".
If I could use any other with a simple plug and play similar to that of an stepper motor would be of a great help. However in certain cases need to customize or change as required.
Request the users to support for a simple hardware wiring and to validate the G-Code Macro as per the trailing.
-
Have you reviewed the M950 and M42 commands? Do you require more examples?
-
Yes. I have gone through commands M950 and M42. Tried to write this ON & OFF program as shown below
M950 P3 C“out9“ ; allocate GPIO port 3 to OUT_9 (fan output),
M42 P3 S1 ; set 100% PWM on GPIO port 3In the M950 line G-Code have removed the the Q parameter since the speed is not going to be varied.
Would the above program suffice the Relay Module ON & OFF? Requesting your feedback.
-
That looks ok, except the quotes around out9 don't look correct.
C“out9“
versusC"out9"
-
@Phaedrux Thanks for the feedback would be changing the quotes.