Hello Guest it is March 28, 2024, 11:32:01 AM

Author Topic: VFD Spindle control 0 to 10V (not -10 to +10V)  (Read 21962 times)

0 Members and 1 Guest are viewing this topic.

VFD Spindle control 0 to 10V (not -10 to +10V)
« on: April 13, 2011, 06:58:15 PM »
I have a VFD drive on my spindle, controlled through the W axis on the Galil card. I set my direction using outputs 5 and 6, and the spindle speed is set using an absolute value (0 to 10V), regardless of direction.

What I see, however, is for reverse spindle (M4), speed control works fine (10V = max RPM, 0V = spindle stopped).  For forward spindle (M3), the spindle runs, but at a constant RPM (about 500 RPM) regardless of the set spindle speed.  I assume this is because the Galil controller is using -10V to +10V where negative is spindle CW, and positive is spindle CCW. How can I force it to output positive voltages regardless of the spindle direction.

I saw this discussion:  http://www.machsupport.com/forum/index.php/topic,13901.0.html 

If I have to create a special Galil program to do it as suggested in that topic, I will, but I assume I'm missing something.  There must be a way to tell Mach3 to do what I need without a custom Galil program, right?

Also, how is the Galil driver controlling the spindle?  Is it using SH to enable the output, then OF commands to set an offset voltage, and MO to turn off the spindle?  Or does it use another method.

Thanks,
Mike

Offline kcrouch

*
  •  193 193
  • In way too deep!!!
    • View Profile
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #1 on: April 13, 2011, 09:09:38 PM »
Mike,
You may need to fit a jumper in the SM location for the spindle axis. That enables magnitude and sign output. Yes that is also the step motor jumper but the motor is still configured as a servo. You may also need to fit a diode bridge to the Galil output to prevent the voltage reversal. You connect the direction bit to the sign output. It is described (but not well) in the Galil manual.

Kenny
Having way too much fun! Something must surely be wrong.
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #2 on: April 14, 2011, 06:40:16 PM »
Thanks.  Unfortunately, it doesn't quite work.  The DMC-18x2 manual says.

Quote
For each axis, the SM jumper selects the SM magnitude mode for servo motors or selects stepper motors. If you are using stepper motors, SM must always be jumpered. The Analog command is not valid with SM jumpered.

According to Galil Support, The SM jumper doesn't apply an absolute value function to the output (e.g. like a diode bridge).  It compresses the -10V to +10V into 0 to 10V, with 5V as the center.  Max reverse RPM would be 0V, max forward would be +10V, and 0 RPM would be 5V, and that assumes the analog output even works - which according to the manual it does not ("The analog command is not valid with SM jumpered.").



I'm assuming the Mach3 Galil driver is using OF (offset) commands to output 10V for max forward spindle motion, and -10V for max reverse spindle motion. What I need is to always get 0 to +10V regardless of spindle direction (0V = spindle stopped, +10V = spindle max RPM).

A diode bridge sort of works, but issues with the diode drop are problematic.  Besides I hate to use electronics to do what software should be able to do much easier. 

In this forum post (http://www.machsupport.com/forum/index.php/topic,12652.0.html) from Sept 2009, Smuph suggests that more such options need to be added to the Galil driver to make this kind of spindle control possible. I'm hoping those options were added and I'm just missing it. 



I should point out, my machine is a Camsoft to Mach3 conversion. The spindle in Camsoft works fine. It's handled using SHW and OFW commands to enable and set the spindle voltage. All OFW commands are 0 to +10V, not negative. 

If the Galil driver doesn't do this, I'll try writing a Galil built in program that monitors the spindle voltage and converts any negative voltages to positive voltages (if _OFW < 0, OFW = @ABS(_OFW) sort of thing).  This only works if the Galil driver does not monitor the _OFW value.  I hate to mess with the Galil driver like this without knowing exactly how the driver handles this. 

Thanks,
Mike

Offline kcrouch

*
  •  193 193
  • In way too deep!!!
    • View Profile
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #3 on: April 14, 2011, 08:38:26 PM »
Sorry, but the spindle options aren't improved yet. Steve has been very busy at work and I am working on lathe threading at the moment. You should try and make do with the diode bridge for now and compensate with the spindle calibration. When I get threading working, I'll take a look at it. Steve and I have discussed this several times and have an understanding of what the various spindle setups are. but implementing them all is another story.

Kenny
Having way too much fun! Something must surely be wrong.
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #4 on: April 14, 2011, 10:19:24 PM »
Understood. Thanks.

Can you confirm how the Galil driver sets the spindle speed?  Does it use SH to enable the axis, and OF commands to set the speed?  Does it check the result after the fact (i.e. read back the OF result or just blindly write it)?  My program will read the OF value, and if negative, change it to positive. But, if the Galil driver fights me and changes it back to negative, it won't work.  Also, this assumes the Galil driver only changes the OF value when the speed changes. If OF is updated constantly (even if the speed doesn't change), then it won't work very well.

I might be able to do it with Custom Notify too.

But, yes, if all else fails, I'll use a diode bridge. The VFD input only draws 0.3mA, so the diode drop won't be a huge concern. I don't have a spindle sensor, so Spindle Calibration won't help me. No feedback.  But as long as the diode drop is small, it will work fine.

Thanks,
Mike

Offline kcrouch

*
  •  193 193
  • In way too deep!!!
    • View Profile
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #5 on: April 15, 2011, 07:24:43 AM »
Mike,
The SH and OF commands are active. I am not sure at this time, but I think that the OF is applied only when the spindle is started or to change speeds. There are several resets that happen during the various program stages, so you would want to BP your program and  activate it with the #AUTO label to get it to start automatically. The plugin does not act in the usual manner for Galil. You can see the train of commands that are sent if you enable and look at the GalilDebug.txt file after running.

I will eventually get to the spindle control though. There are also other options such as modbus for spindle control, but you already have most of it worked out already.

Kenny
Having way too much fun! Something must surely be wrong.
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #6 on: April 15, 2011, 04:43:06 PM »
Yes, the debug file. I should have tried that first.  Thanks much for your help.

Mike
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #7 on: April 16, 2011, 02:56:22 PM »
Why can't you use the M3 command to only pick up the REV input on the VFD? and always issue a spindle command using the Jog+, this way you can always output a +analogue and switch the VFD direction over using the FWD/REV inputs?
N.
 

Offline kcrouch

*
  •  193 193
  • In way too deep!!!
    • View Profile
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #8 on: April 16, 2011, 02:59:52 PM »
N.
I have built a test plugin and sent it off to Mike. If it works, I'll need to add the checkboxes for configuration and release it.
Kenny
Having way too much fun! Something must surely be wrong.
Re: VFD Spindle control 0 to 10V (not -10 to +10V)
« Reply #9 on: April 18, 2011, 12:42:39 AM »
Kenny, thanks for the test plugin.  Kenny set the driver to output 0-10V instead of -10 to +10V to test the idea.  He's got a few minor changes to make, and add the check boxes to enable/disable it, but it should work great.

NosmoKing, I'm using outputs 4 and 5 for reverse and forward control of the VFD, as you say.  I enabled them in the "Relay Control" box of the Ports & Pins dialog.  But, what do you mean by using the Jog+.

Mike