Author Topic: Spindle Issues with SuperPID  (Read 4698 times)

Jarhead

  • Posts: 16
    • View Profile
Spindle Issues with SuperPID
« on: November 22, 2015, 05:28:17 PM »
I'm using Mach4 .2803 with a 410 and plug-in .159.
Windows 7 Pro 32bit.
Mach to 410, to G540, to SuperPID.
I can turn spindle on and off with the Spindle CW button.
Spindle comes on and goes to correct RPM when running Gcode.
The problem is the timing that the spindle comes on. It takes a long time to start and the tool is already in the material by the time it does. Obviously, it never did this with Mach3. I don't know what is causing it since I threw Mach4, PMDX, and the G540 all into the mix at the same time.
The other thing is the spindle won't turn off if I press the stop or reset button. It goes to the lowest RPM and stays running.
Kinda hard to pin-point since I can't take any of the pieces out of the mix.

So the gcode tells Mach to start the spindle, does the 410 have any control over this or does it just go to the G540?

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Spindle Issues with SuperPID
« Reply #1 on: November 22, 2015, 11:32:19 PM »
Quote
I can turn spindle on and off with the Spindle CW button.
Good.  When you turn on the spindle this way, does it take  the same amount of time to spin up to speed as it does when turned on via GCode?  How long does it take to spin up?

You can tell mach4 to delay after turning on or off the spindle before it executes the next line of GCode.  Go to the Configure menu and select "Mach...".  Then click on the "Spindle" tab.  Put non-zero values in the "Accel Time" and "Decel Time" columns for line "0" (zero), presuming that is the only spindle range  you are using.

*NOTE* Mach4, at least in build 2803, appears to delay for only HALF of the value in the accel or decel time fields.  For example, I put 10 seconds in the "Accel Time" and 5 seconds in "Decel Time.  I then ran this program:
   S5000 M3
   G0X2
   M5
   G0X0
After the M3 turned on the spindle, I saw a delay of approx 5 seconds, not the 10 that I had entered.  And after the M5 turned off the spindle, I saw a delay of about 2.5 seconds instead of 5.  So it appears that (for now) you need to set these delays to twice the actual spin up/down times.

***EDIT***
After talking to the Mach people, it turns out the Mach4 treats the accel and decel times as "accel time to max RPM" and "decel time from max RPM".  If the target speed is less than the max RPM, Mach4 estimates the time needed by:

    estimated accel/decel time = (target RPM /  max RPM) * accel/decel time

Since my max speed was 10,000 RPM and my target speed was 5,000 RPM, Mach4 used 1/2 of my given accel/decel times.
***END EDIT***

Quote
The other thing is the spindle won't turn off if I press the stop or reset button. It goes to the lowest RPM and stays running.
Yet when you stop it using the "Spindle CW" button it does stop entirely, correct?

In my experiments just now, the PMDX-410 is claims that it is turning off the PWM when the "Stop" button is pressed (to stop running a GCode file or MDI command sequence).  I can't verify that the PWM it actually turned off, that will have to wait until I'm in the office on Monday.

I need to know how you have the SuperPID wired to your G540.  And it would help to have your Mach4 profile. See:
     http://www.pmdx.com/PMDX-Forums/index.php?topic=74.msg224
in the "But an Even Better Way" section.  You can email it to me at bob at this domain.com.

Bob
« Last Edit: November 23, 2015, 11:32:07 PM by Bob at PMDX »
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

Jarhead

  • Posts: 16
    • View Profile
Re: Spindle Issues with SuperPID
« Reply #2 on: November 23, 2015, 05:14:55 PM »
ok, the Accel time took care of the turning on problem.

As for the turning off... Yes, the Spindle button does stop it completely.
I have it wired exactly as shown on page 25 of the SuperPID manual, with the exception of another ground wire run to the ground pin of the 410. I do not have any "external" controls, meaning manual knobs and switches, on the SuperPID. It will only ever be controlled by software.

You already have my entire config there... you're still working on my error 7 issue.

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Spindle Issues with SuperPID
« Reply #3 on: November 24, 2015, 12:17:57 AM »
Quote
ok, the Accel time took care of the turning on problem.
See my edits to the previous post that explains why the accel/decel delays were less than expected.

Quote
You already have my entire config there... you're still working on my error 7 issue.
Some people try making various changes to their configuration when trying to get something to work. I want to make sure you haven't changed any of the configuration since the version you sent me earlier - aside from changing the accel and decel times.

Quote
I have it wired exactly as shown on page 25 of the SuperPID manual, with the exception of another ground wire run to the ground pin of the 410.
Looking at your Mach4 config, it looks like you have the SuperPID "RUN" input connected to pin 5 on the G540 connector (which in turn is driven by pin 17 on the parallel port/SmartBOB).  And for now I have to presume that this is indeed the case, since you are able to stop the spindle by clicking on "Spindle CW" button.

The behavior you describe sounds like the RUN input on the SuperPID is not going high when you click on the "Stop" button in Mach4.  The SuperPID manual says that it limits the lower speeds to 5000 RPM minimum.   Which I interpret to mean that if the PWM goes away (zero volts as the control voltage), but the RUN input is still low, the SuperPID will keep the spindle running at the minimum speed.  Why this happens for the "Stop" button and not for the "Spindle CW" button I cannot yet explain.  And I cannot replicate this here in the lab.

So please run this test and send me the resulting log file:
(1) Exit Mach4 and delete any PMDX-SmartBOB-USB.log in your profile directory.

(2) Run Mach4 with your profile and Enable the debug log if it not already enabled in our plug-in configuration dialog (device = file, level = debug).

(3) Display the SmartBOB real-time display.  Go to the Diagnostics menu and select PMDXSmartBOB, then click on the real-time display.  You can move the real time display off the main Mach4 window it your screen has enough room.

(4) Start the spindle using the "Spindle CW" button.

(5) While the spindle is running, verify the real-time display shows pin 17 green and pin14 as yellow.  Measure the voltage between the RUN and GND terminals on the SuperPID (it should be close to zero volts)

(6) Click on the "Spindle CW" button again to halt the spindle, verify the real-time display shows pin 17 as red (pin 14 should be red or green but not yellow). Also measure the voltage between RUN and GND (it should be close to +5V).

(7) Open the GCode file that has been having trouble with the spindle.  Start running the file.  After the spindle is running, verify that the real-time display shows pin 17 as green and pin 14 as yellow.

(8) Click on the "Stop" button.  Verify that the real-time display shows pin 17 as red and pin 14 as red or green but not yellow.  When the spindle reaches its lowest RPM, measure the voltage from  RUN to GND on the SuperPID.

(8) Go to our plug-in configuration and restore the debug log setting to their defaults values.

(9) Exit Mach4 and send me the log file from your profile directory and tell me what your voltage measurements were.

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

Jarhead

  • Posts: 16
    • View Profile
Re: Spindle Issues with SuperPID
« Reply #4 on: November 24, 2015, 05:42:11 PM »
(5) While the spindle is running, verify the real-time display shows pin 17 green and pin14 as yellow.  Measure the voltage between the RUN and GND terminals on the SuperPID (it should be close to zero volts)

17 is Green, 14 stays red. All voltages are good.

Quote
(6) Click on the "Spindle CW" button again to halt the spindle, verify the real-time display shows pin 17 as red (pin 14 should be red or green but not yellow). Also measure the voltage between RUN and GND (it should be close to +5V).

17 goes red. 14 stays red. voltage good.

Quote
(7) Open the GCode file that has been having trouble with the spindle.  Start running the file.  After the spindle is running, verify that the real-time display shows pin 17 as green and pin 14 as yellow.

17 green. 14 yellow.

Quote
(8) Click on the "Stop" button.  Verify that the real-time display shows pin 17 as red and pin 14 as red or green but not yellow.  When the spindle reaches its lowest RPM, measure the voltage from  RUN to GND on the SuperPID.

17 red. 14 red. voltage good. Funny thing, the spindle is stopping as it should now. I just disabled some plugins but didn't change anything else. Maybe it was one of them??