Hello Guest it is January 13, 2025, 03:29:07 PM

Author Topic: How do I control Start/stop of spindel if relay is occupied  (Read 13703 times)

0 Members and 1 Guest are viewing this topic.

How do I control Start/stop of spindel if relay is occupied
« on: January 07, 2024, 11:44:17 AM »
Hi. I have recently bought Mach3 and I am trying to find a solution to start/stop the spindel. My BOB is a 5 axis board. I have a slave-stepmotor on my y-axis and it is connected to pin 16 & 17 and assign to B. I want to use a 4th rotational axis and it will be assign to A (pin 8 and 9). My board has one relay but it is controlled by pin 17, wich I already have assign to the B-axis DIR. I have tried to use pin 14 to control the DIR of the B-axis, but it does not seem to work. The direction does not change so I think that pin 14 might not be suitable to set as DIR för an axis, or am I wrong. So, now I am searching a way to start/stop the spindel using pin 14. But I am uncertain that I can connect a 5 V relay directly to the pin 14. The relay draws around 70 mA, and it may be to much for the pin14. Does anyone have a suggestion how I can find a solution. Pin 1 is used for PWM.

Best regards
Claus
« Last Edit: January 07, 2024, 11:46:39 AM by Idefixer »
Re: How do I control Start/stop of spindel if relay is occupied
« Reply #1 on: January 08, 2024, 03:45:37 PM »
Hi. I have recently bought Mach3 and I am trying to find a solution to start/stop the spindel. My BOB is a 5 axis board. I have a slave-stepmotor on my y-axis and it is connected to pin 16 & 17 and assign to B. I want to use a 4th rotational axis and it will be assign to A (pin 8 and 9). My board has one relay but it is controlled by pin 17, wich I already have assign to the B-axis DIR. I have tried to use pin 14 to control the DIR of the B-axis, but it does not seem to work. The direction does not change so I think that pin 14 might not be suitable to set as DIR för an axis, or am I wrong. So, now I am searching a way to start/stop the spindel using pin 14. But I am uncertain that I can connect a 5 V relay directly to the pin 14. The relay draws around 70 mA, and it may be to much for the pin14. Pin 1 is used for PWM.

Best regards
Claus

I now have a solution, that is simple, cheap and work fine.

With one 5 volt relay, one transistor BC 337 and one resistor 20 kohm.

If anyone is interested, I can send drawing and picture on the device

Offline MN300

*
  •  305 305
Re: How do I control Start/stop of spindel if relay is occupied
« Reply #2 on: January 09, 2024, 11:08:35 AM »
When the transistor turns off the falling current in the relay coil creates a reverse voltage spike. This is typically several times your applied voltage and can damage the transistor. Normally a diode is placed across the coil, cathode to positive. When the voltage reverses the diode conducts and the resistance of the coil absorbs the energy that was stored in the coil's magnetic field.
As the breakdown voltage of the BC337 is 50 VDC you appear to be getting away without the diode, so far. If you were using a 12 volt relay you may not be so lucky. Small diodes are cheap and good insurance against that type of failure. A 1N4148 is a commonly available diode as is any one from the 1N4001 to 1N4007 series. The difference in the 1N4000 series numbers is the voltage rating but they are all high enough for this use.
Re: How do I control Start/stop of spindel if relay is occupied
« Reply #3 on: January 09, 2024, 11:29:54 AM »
Thanks, I was not aware of that but I do see why and I am gratefull that You gave me feedback. I will keep that in mind for future buildings