Hello Guest it is May 29, 2023, 08:39:12 AM

Author Topic: PWM & Mach  (Read 4152 times)

0 Members and 1 Guest are viewing this topic.

PWM & Mach
« on: May 03, 2011, 10:47:51 PM »
I am having a heck of a time getting Mach to output a PWM signal. Now I have managed to get this to work before...but that was on a different machine.

 I have designed an Opto isolated PWM motor controller. and I designed a PWM signal generator. these are connected together with a switch so that a user can select Manual control (from the PWM sig generator) or from PC control (from the printer port).

 With the Manual control signal generator everything works fine. I am using 400hz as my PWM signal. so everything works perfectly stand alone.

BUT... when i try and get the PC to output a PWM signal is where i run into problems. I have setup mach to output a PWM signal on say pin 6 and have set up 400hz as my base frequency and i have 20% set as the minimum PWM. I have the pulley ratio set to 1 as my spindle is direct drive. I have set 5000rpm as my min and 30,000 rpm as the max (changing these settings doesn't make any difference).

when I turn the spindle on in mach, nothing happens. but if i then press reset the spindle runs at the minimum speed i set up under the spindle control. IE if i set it for 20% that's what it runs at. pressing the speed up/down buttons just stops the spindle.

 So im not sure whats going on...

 When i was designing the ISO/motor controller I used a different PC and it worked GREAT! i could change speeds from within mach and everything! but i dont remember if i had something set up differently or whats going on...
Re: PWM & Mach
« Reply #1 on: May 03, 2011, 11:20:06 PM »
 after reading this:

 I think i see some of my problem. I had read this when i built my motor controlled and used the settings listed.

The big problem i see is how i have the pulleys set up. he has it set for 0min and 100max and for PWm this equates to off and 100% power!! that's what i have wrong. with the pulleys set to 5000 and 30,000 the PWM controller doesn't know what to do. which is why it always defaults to the min PWM i have set in the spindle set up! AH HA!

 I will give these settings a try!
Re: PWM & Mach
« Reply #2 on: May 04, 2011, 06:17:01 PM »
ok well....plan b...this did not work. it doesn't matter what i set the spindle pulley settings to. the same thing happens. I turn the spindle on in mach. and nothing happens. but Mach says "PWM bumped to minimum settings" if i then press reset the spindle will run at whatever % i set the min setting at under spindle control.

So something is not working right. very frustrated.
Re: PWM & Mach
« Reply #3 on: May 05, 2011, 06:33:04 PM »
SWEET! I got this working!

 finally! what i was missing is that on the mach program run page under the spindle on/off button there was no speed listed. everything was at zero. i didn't know that you could click on the speed box and enter a number! so figuring my pulleys were setup for 0-100 i entered 50 into the speed box and hit enter and WALLA! spindle fired right up and now the up/down speed buttons work etc. so THAT was the missing step!!! I now have my spindle which is a modified Dremel tool running under PWM control!

Offline Tweakie.CNC

  • *
  •  9,037 9,037
  • Super Kitty
    • View Profile
Re: PWM & Mach
« Reply #4 on: May 06, 2011, 02:02:04 AM »
Well done.  ;)