Guys , Do you see any reason way I can not use pwm to

Guys , Do you see any reason way I can not use pwm to control the high voltage relay one side of it to turn on the spindle and the other side of the relay to turn on my shop vac ? The high voltage relay is rated for 10amp per relay.

Its an ac motor right? From my experience pwm and ac pulsing mains is not advisable. Unless I misunderstand you.

Yes , it is a ac motor, I know that I can

Riley is correct. There are two possible issues with your setup: it looks like you’re using mechanical relays and they’re not suited for rapid switching. PWM systems can pulse from 500Hz to many thousand times per second and only a solid state relay is designed for that type of fast switching.
Next, PWM of a DC motor is simple because you only have to account for voltage and time (aka the duty cycle). For AC motors, you have to account for voltage, time, and frequency. Without taking frequency into account, a PWM AC system is unreliable.

Kurt, I apologize, I explained what wouldn’t doesn’t work without explaining what does: if you replace the relay with a SCR or Triac circuit then you’ll be able to PWM the gate of the SCR/Triac and that will effectively control the speed of the AC motor. I have a 40A solid state relay from SparkFun and the data sheet mentions that you can create an AC variable resistor by controlling the trigger angle of the Triac.

I have used the ‘coolant’ output to drive a solid state relay to switch the AC for my vacuum cleaner. Works really well, but you need to add the code for ‘Coolant ON/OFF’ to your GCode generator template. I also added a manual overrided (basically a switch in parallel with the relay) to be able to turn on the vacuum outside of software control.

Marco. Switching on or off slowly is fine and what the tinyg output line are for.

Could I not just set pwm at 100% and it stay on 100% of the time the file is running?

I want it to stay on 100% of the time that file is is running, and after the compete’s it goes to 0 .

Why don’t you use @Ben_Delarre ​’s gpio server? There is a widget inside ChiliPeppr already and you can use it to toggle relays from cp.

I have no idea how to use widgets? I do not know where to find that kind of info to learn that. sorry if you could point me in the right direction to learn ?

@johnlauer That assumes he is using a RPI to drive cp. Also, unless I misunderstood he want to use the PWM to trigger a relay to toggle an AC spindle’s RPMS. This will not work. Again I might be understanding his issue wrong.

Yeah I only meant for basic toggling like a vacuum.

I just want it to be like a light switch , on or off

oh then just use the coolant or spindle on or spindle direction pin on tinyg?

Look here:

Specifically the M3 M4 and M5 commands. They will toggle the PINS respectively.

Kurt, just to save you from a potentially dangerous test, the answer to your question is no, 100% PWM is NOT the same as the circuit being on 100% of the time. Typically the PWM is clocked at some speed and the percentage is the amount of time the circuit is on, but there is always a transition to off and back on again, so 100% is the maximum time it’ll stay on while still having a duty cycle. This would make a relay unhappy at best. One of the solid state options tied to one of the tinyg pins is the way to go…

I am a bit confused by “sides” of the relay.
You have a double pole, single throw, is that what you mean?
The Spin On/off is 3.3v Logic and can drive such a relay.
Not the PWM, just Spin On/Off.
There is also the coolant lead, also 3.3V logic On Off

Gcodes M7 and M9 would control the coolant lead

Sorry, I did not see your picture or prior suggestions, so most of mine are redundant.
But, now seeing the relays you are using (I have similar in my drawer), I caution you to look not at the Amp rating on the relays, rather their HP rating. Some small relays cannot handle motor start surges well. The 10A relay I just checked has no HP rating, so ? Just be aware it may not last long.
I also feel compelled to comment on Neal’s SCR/Triac idea - yes, could be done but would be a non trivial circuit to ensure safety and isolate tinyG from AC mains.
The best solution likely a SSR https://www.sparkfun.com/products/10636 is an example, not necessarily a recommendation

Well i got a raspberry pI 2 today , so that will be fun to play with and try to start understanding programming a little bit more .but back to what i posted about this project and it sounds like i need to use the cool pin on the control board to control the spindle and the shop vac . So I have been using cut2d to create the files so is there a setting that i could build into the file to turn on the cool ?