Machsupport Forum

Third party software and hardware support forums. => Galil => Topic started by: Lohmeyer on April 13, 2011, 06:58:15 PM

Title: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Lohmeyer 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Lohmeyer 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Lohmeyer 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Lohmeyer on April 15, 2011, 04:43:06 PM
Yes, the debug file. I should have tried that first.  Thanks much for your help.

Mike
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: NosmoKing 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.
 
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Lohmeyer 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
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: NosmoKing on April 18, 2011, 10:45:39 AM
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

Of course I just realized that the Galil JG works if using either a servo motor or an encoder on the VFD spindle motor or the spindle shaft, the JG command followed by the slew speed will automatically output the voltage required for the slew speed commanded.
The down side is though with a VFD with +10v only you would need the bridge to obtain reverse, but at least the drop would automatically be compensated by the Galil reading the slew speed feedback via the encoder.
On a Lathe, Constant Surface Feed CSF should be possible with this set up also.
 N.
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Lohmeyer on April 18, 2011, 06:02:14 PM
Yes, good point.  My spindle doesn't have an encoder, but I'm hoping to add one eventually for rigid tapping. 

With an encoder and the JG command, to make the Galil driver work without a diode on the output, it would have to change the encoder polarity using the MT command (MT 1 for forward, MT -1 for reverse polarity). 

Kenny, I assume the Galil driver use JG commands for spindles with an encoder, right?  If so, then in your update you sent me, we would have to add MT commands to the Custom Notify messages and M3/M4 macros as well for people with encoders.  But, your updated driver as is will still handle it.

I should mention, I don't like the diode because it creates a voltage drop which can skew the actual spindle speed (make it non-linear).  I know, maybe it's splitting hairs.  It depends on the current through the diode.  My VFD speed input is about 30K ohms, so at 10V, that's 0.33 mA at 10V.  A common diode will only drop about 0.1V at 0.33mA, so that's fine.  But VFD's with a lower input impedance (e.g. 5K or less will cause a 0.2V to 0.5V drop through the diode), and the voltage drop through the diode starts to become an issue for linearity (spindle speed will not be linear with respect to commanded voltage). 

But, using JG commands and an encoder on the spindle, this doesn't matter.  The Galil card will adjust the voltage to maintain the speed based on the encoder feedback.  That's useful. 

Mike
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch on April 18, 2011, 08:14:24 PM
Mike,
That's correct, when an encoder is fitted we use JG to set the spindle speed. There are so many possibilities for spindle control that I like using the macros and custom notifies to get systems working well as changes are then much easier to implement for a particular situation. I am very afraid of breaking something that is working for a user unintentionally. In this case, I am going to add a checkbox for 0 - 10V and +/- 10V selection and use the custom macros and custom notifies to get it working for your particular installation. When verified, we will update the plugin and manual so that others can benefit from these changes.
Kenny
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: TOTALLYRC on April 19, 2011, 06:01:32 AM
Nice to see that you will be keeping the +-10v for the spindle because if you are running a servo drive on the spindle it won't work any other way.

Mike
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Dr_Mark_Vaughan on August 08, 2011, 01:59:07 PM
It's now Aug 20111. Can I ask what state the spindle plugin is in.
For a simple spindle typical mach user with VFD running a 0 to 10V control without feedback, whats teh setup requirement?
Do we need to put an SM link on the Galil card?
I see no box to select -10V to +10V or 0 to +10V in the plugin configure screen.

Thanks Mark
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch on August 08, 2011, 02:57:54 PM
Mark, I know that I have been working on this for a long time, but you've jumped us by 18.100 years! I can send you a copy of the new plugin as soon as I get back to my shop. Steve and Brian have been updating Mach and there will be changes needed to the plugin so I have been holding off of the later releases.
The one that I will send has the checkbox for 0-10 volt, but will need some changes made to the M3, M4 and M5 macros in order to set up any needed outputs to control direction. I can help out with those.
Cheers,
Kenny
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Dr_Mark_Vaughan on August 08, 2011, 03:12:00 PM
Thanks Kenny
No immediate rush, I'm not quite there with it's install yet, just trying to cover possible problem areas before the conversion point of no return and avoid too much down time.  Thanks for the offer of help. I just need to get a 0 to 10V signal for VFD with M3 and M4 relays the same as many mach users operate. Actually just forward M3/M5 on/off spindle motion will do for now.
I did even wonder whether for spindle use, and to save some valuable outputs, whether the Galil was better confgured if possible to use the step/direction signal for spindle direction, and the enable signal to start the spindle. Easy enough then to wire the enable signal steered via a step direction relay to the CW/CCW inputs on a VFD. Not that I've read enough of the Galil stuff to know if that's viable, or viable to mach.

Regards Mark
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch on August 08, 2011, 03:44:44 PM
Dr. Mark. I would advise against the step direction using the Galil as I don't think that it is provided for yet. If you use output 3 for forward and output 4 for reverse, You would simply turn output 3 on with the M3 macro and turn both output 3 & 4 off with the M5 macro. Likewise set the m4 macro to turn output 4 on to reverse your drive.
Kenny
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: Dr_Mark_Vaughan on August 08, 2011, 04:08:45 PM
Yep that's OK and what I had planned to do, was just wondering if we could be crafty and save some standard IO, perhaps an idea for future. Not important though I have enough IO.
Thanks Mark
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: ionsignal on March 05, 2012, 12:03:09 PM
Hello Kenny,

I have a dmc-1830 that I am in the process of installing for a Bridgeport retrofit with servos.  Can we use outputs to generate pwm signal for 0-10v converter like we do with the parallel port?  That would be great since this board has only 3 axis.

Mark
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch on March 05, 2012, 04:22:32 PM
Sorry, but the Galil does not provide for that feature. You would need an additional axis to provide that function. You could add a RIO and use the analog output on that, but I think that another Axis would be cheaper.
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: ionsignal on March 05, 2012, 04:30:03 PM
Thank you for the reply,

I have purchased a used dmc-1830 that I can resell, but having manual speed control with a POT on a manual toochange machine is not too bad a thing.

Another thought though, could one write a script that outputs a binary coded decimal on some output pins for the S speed code?  One could have a DAC to read those pins and output the 0-10v for the vfd.

Mark
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: kcrouch on March 05, 2012, 05:10:18 PM
Yes, you could, but I would rather have the outputs available for other uses. You could possibly use 4 of them along with a digital to analog chip, but you would still need to isolate the converter and its ground from the VSD. I have let lots of smoke out that way.
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: ionsignal on March 05, 2012, 05:19:41 PM
Yes, smoke is not good when we have an expensive card like the galil!

I'll set up the wiring as though I have an 1840 card and keep my eye open for a good deal.

I am using an ACtech vfd, made next door in CT., and I think it has a serial control feature.  Maybe I can make use of that?

Thank you for your help.  If I make progress on this front I'll post it.

Mark
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: NosmoKing on March 05, 2012, 07:31:54 PM
ACtech show isolated I/O this may also apply to the 0-10v Analogue input, I have found  many VFD's have isolated input. It is easy to test.
Nosmo.
 
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: ionsignal on March 06, 2012, 08:42:47 AM
I read the ACtech manual last night and didn't see a reference to isolated inputs but I suspect that they may be.  I did drive the 0-10v input directly with an Ah-ha if16 motion card with no issues.  To check for isolation should I test for line voltage on the inputs with respect to chassis ground?  Also, the serial link in the ACtech drive is for the optional keypad so a no-go there.

Modbus is an option.  I need to find out if anyone has used modbus for i/o and spindle control while using dmc-18x0 for motion.

Mark
Title: Re: VFD Spindle control 0 to 10V (not -10 to +10V)
Post by: NosmoKing on March 06, 2012, 10:33:59 AM
First check with resistance  meter with power off from common terminal to either side of the power in and to ground.
Next, power up and  check ac voltage from any terminal to earth ground, you may see a reading with a high impedance meter, if you do see an odd reading, use a 1k -2k resistor from the terminal to ground, if the voltage collapses or reduces then it can be assumed that the voltage was due to leakage, reduce resistor value as necessary.
This test will tell if there is leakage that supports any kind of current.
I saw the mention of isolated I/O in one of the ACLenz description bulletins.
Nosmo.