Author Topic: Understanding PWM Spindle Control  (Read 4531 times)

pedio

  • Posts: 13
    • View Profile
Understanding PWM Spindle Control
« on: February 19, 2016, 02:18:25 PM »
I have a laser connected to my CNC as a spindle and use PWM control from pin 16 on a PMDX-132 with a PMDX-422 as a motion controller.

Question 1 - How do I set up the controls to get maximum power out of the laser. I have the spindle set up as a 0-100 with a max speed of 100. I set my tool at 100. The slider override is 0-300% with a default at 100. I would think the with the slider at 100 it would set the laser at full power, however, that does not seem to be the case. If I set the slider at 300 the laser appears to be more powerful.

Question 2 - The spindle speed indicator DRO on wxMach does not seem to work. Is there anything I need to do to get this to work.

Question 3 - How can I test the PWM output with a meter?

Question 4 - This is weird. When cutting out a pattern Mach 4 (or SmartBob) occasionally changes the power output for the laser for individual items. I have even generated a different G Code file that uses a different order of cutting so the item is in another position; however, the item still has a lower power. If I reboot Mach 4 this problem goes away. Told you it was weird.

Thanks in advance,
Peter

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Understanding PWM Spindle Control
« Reply #1 on: February 19, 2016, 05:30:37 PM »
Question 1 - How do I set up the controls to get maximum power out of the laser. I have the spindle set up as a 0-100 with a max speed of 100. I set my tool at 100. The slider override is 0-300% with a default at 100. I would think the with the slider at 100 it would set the laser at full power, however, that does not seem to be the case. If I set the slider at 300 the laser appears to be more powerful.
If you mean that on the Configure->Mach dialog, "Spindle" tab, the first line (labeled "0") has MinRPM=0 and MaxRPM=100, then you should never be able to get more than 100 RPM, and 100 RPM should correspond to maximum PWM duty cycle (100% or pretty darn close to it).  When I try this on my system, and set the spindle speed to 100 RPM and then slide the SRO slider up above 100%, the RPM stays at 100.

Quote
Question 2 - The spindle speed indicator DRO on wxMach does not seem to work. Is there anything I need to do to get this to work.
That DRO shows the "actual reported RPM", which is what the plug-in tells Mach4 is the actual spindle speed.  By default our plug-in does not provide that feedback.  Go the our plug-in configuration dialog and click on the "Spindle Config" tab.  You will see a checkbox labeled "Report calculated spindle RPM to Mach4 as actual spindle RPM".  Check that and click on OK.  Our plug-in will then read the current PWM duty cycle from the SmartBOB and calculate what RPM that corresponds to.  For example, if the actual PWM is 75%, then the RPM will be (100 * 0.75) = 75 RPM, and that will show up in the DRO.

Quote
Question 3 - How can I test the PWM output with a meter?
On the PMDX-132, put the ground probe of your volt meter on J9 pin 6, labeled "GND", and put the positive probe on J9 pin 4, labeled "16".  The voltage should vary linearly between roughly 0 and +5V based on RPM.  100 RPM should be 5V, 50 RPM should be 2.5V.

Quote
Question 4 - This is weird. When cutting out a pattern Mach 4 (or SmartBob) occasionally changes the power output for the laser for individual items. I have even generated a different G Code file that uses a different order of cutting so the item is in another position; however, the item still has a lower power. If I reboot Mach 4 this problem goes away. Told you it was weird.
You are right - that IS weird.  Try this with the plug-in reporting calculated RPM back to Mach4 (see above), then look at the spindle DRO and see if it changes during that segment.

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

pedio

  • Posts: 13
    • View Profile
Re: Understanding PWM Spindle Control
« Reply #2 on: February 21, 2016, 11:07:54 AM »
Thanks - I can now see the Readout.

I had another pattern that would drop the laser out at a certain segment (when it started a corner - arc). It was repeatable. I changed the plugin so I can read the spindle speed. It was steady at 100 throughout the pattern. The laser dropped out at the same spot. If I click on the Spindle CW button (disable) the spindle and then click on it again (to enable the spindle) the laser comes back on.

I have played with the laser a little. The PWM signal seems to stay at 5V even when the laser goes off. I tested the 12V side of the laser to see if I was getting a short. With the meter on the 12V side the laser stays on when it would go off before. Perhaps I have a short in the laser / wiring. The 12V and the 5V share a ground out of the laser so it might be a problem. I will play with the laser a little more to isolate the problem.

pedio

  • Posts: 13
    • View Profile
Re: Understanding PWM Spindle Control
« Reply #3 on: February 21, 2016, 08:54:19 PM »
I tested the laser and found it was not working correctly. Worked with the manufacturer and found it had a bad board. I should get a new one in a few days. The problem was it was not recognizing the quick change of states in M4.

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Understanding PWM Spindle Control
« Reply #4 on: February 21, 2016, 09:03:24 PM »
Well that's good news that there is *some* explanation for the strange behavior.  Lets hope the new board really does fix this.

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

pedio

  • Posts: 13
    • View Profile
Re: Understanding PWM Spindle Control
« Reply #5 on: February 29, 2016, 04:50:21 PM »
New laser works MUCH better.