Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: benha on July 23, 2013, 01:05:32 AM

Title: VFD Help
Post by: benha on July 23, 2013, 01:05:32 AM

I've nearly got my Mach / CNC router setup complete, but I'm missing one critical piece.  I haven't been able to get the spindle set up correctly under Mach's control.  There are a ton of threads on this, I know, but I haven't been able to get where I need by reading them.  I'm hoping someone can provide the "ah ha" I need.

First off, the equipment is as follows:
UgraCNC 2.2KW spindle.  This maxes out at 400Hz.
Fuji Frenic-Mini FRN0031S-7U VDF.
Gecko G540

I've got the Frenic listening to the Gecko, and the Gecko talking to the Frenic, but I can't figure out the appropriate set of parameters.  Whenever the VDF is activated by Mach, it immediately goes to 400Hz (the max frequency for the drive and the Frenic) and the spindle goes to its max rev regardless of what rev I've asked it to go to in Mach 3.  I'm assuming that what's happening is that due to either a PWM-Hz translation issue, or perhaps a "ratio" issue in the pulley configs, that any target rev is inducing a Hz count of >400, which is the max for the VFD, and so I'm always going to that value.  I've messed around a fair bit and haven't found a fix, though.  Obviously I'm 90% there given that the spindle speeds up and shuts off at Mach's control.  I just need to figure out how to configure things so that when I say "I want 5000 RPM" I get 5000 RPM.

Can anyone point me in the right direction?

Title: Re: VFD Help
Post by: benha on July 24, 2013, 09:49:21 PM
I've continued reading / experimenting and have a bit more to add:

First, as I understand things now, the way this works is that Mach outputs a PWM signal for spindle speed. The Gecko g540 interprets that signal, and based on the duty cycle of the pulses it sets the voltage of the control pin to an appropriate voltage based on the range between the high pin and the common pin.  (There are three VFD pins on the g540 - high, common, and signal.)

If that's not the correct understanding, I'd love to be corrected :-)

So... What I've managed to figure out now is that any time I F5 the spindle into action, the voltage on the signal pin goes all the way to "max".  Presumably this means that the duty cycle on the pulses that are being output by Mach is 100%, right?

So... That presumably implies that the problem is a misconfiguration of Mach's spindle parameters.  I'm just at a loss for what they _should_ be.  I've tried loading the default g540 XML.  I've Googled high and low.  I'm stumped.

Anyone understand the configuration well enough to give some pointers to the various things I need to check/set to make Mach output the right things such that the g540 will do the right thing? 

Title: Re: VFD Help
Post by: benha on July 26, 2013, 07:48:10 PM
Okay, now I'm COMPLETELY confused.

I've googled around and noted some posts that included settings where the Disable Spindle Relays box was checked.  I noticed that mine was unchecked.  When I checked that box, the spindle stopped coming on altogether.  <Scratch Head>

The clockwise spindle relay is controlled by Output 1.  Checking the outputs tab, I note that's on Pin 17.  Is it possible that when Pin 17 comes on to controll CW rotation that's being interpreted by the G540 as 100% duty cycle on for Spindle PWM and it's outputting full rev??? Seems unlikely given that pin 17 should do NOTHING for the G540 as best I can tell.  But in the interest of trying the unlikely when I've exhausted other options, I went to the Motor Outputs tab and changed the Spindle Step Pin to 17.  And lo... It started "working."  Mind you the motor "surges" some (ie: Unstable at a given rev), but the RPM is now changing in response to S*********X commands.  WTF?!?!

I'm completely baffled at this point.  All the documentation says that the G540 should be looking for a PWM input on Pin 14.  Why is this working when I say to use Pin 17???  Why is the motor surging?  And why is it that when I set a speed on the spindle, the DRO for Spindle Speed indicates that the rev ramps up to that speed and then back to zero, even though the motor stays at the set speed.

Please help!!!

Title: Re: VFD Help
Post by: ger21 on July 27, 2013, 08:02:23 AM
Disable Spindle Relays does just what it says. It disables the spindle when it's checked. Leave it unchecked.

Pin 17 should be set to Output 1. This turns the spindle on and off. Make sure Output 1 is assigned to Clockwise (M3).
Under Motor Control, check Use Spinle Motor Output and PWM Control.

Pin 14 controls the rpm, via PWM, and should be assigned to the Spindle Step Pin.

Male sure in Config > Spindle Pulleys, that you have Min Speed set to 0, and Max Speed set to 24,000. This allows Mach3 to send the correct voltage for a given RPM.

(There are three VFD pins on the g540 - high, common, and signal.)

The manual says Ground, Output, and +10V.

Make sure your getting +10V from the VFD.

The set the spindle speed to 24,000 and make sure your getting 10V on the output. (Pin 8?)
Then set the speed to 12,000 and see if you get 5V on the output.

I don't have a G540 and VFD, so can't help you with wiring or VFD Settings. Having all the correct VFD Settings is also very important.

You might want to post your .xml here so someone can take a look and see if anything obvious is set wrong.

Title: Re: VFD Help
Post by: benha on July 27, 2013, 09:43:03 AM
Thanks for the reply, ger...  I'm away from the machine now, but I'll post the xml when I get back.

What's weird is that pin 14 is presently doing nothing.  Things "work" when I disable the relays and use pin 17 as the PWM pin.  If I leave it in the default position, the pin 17 relay output seems to be interpreted as 100% duty cycle PWM.
Title: Re: VFD Help
Post by: ger21 on July 27, 2013, 10:05:58 AM
Sounds like you have the G540 wired to the VFD incorrectly.

You mentioned three pins from the G540 to the VFD. Those three are for controlling the RPM. Pin 17 is NOT one of those three pins. It should be used in addition to those three, connected to control start and stop on the VFD.
Sounds like you have pin 17 wired to where pin 14 should be??
Title: Re: VFD Help
Post by: benha on July 27, 2013, 10:13:22 AM
Sorry, I'm being confusing.

The VFD is connected to the G540 using the screw terminals on the underside of the G540.  Common, Signal and V+ are "pins" 7, 8 and 9 respectively.  Those are connected to the requisite terminals on the VFD.

Pins 14 and 17 are part of the DB25 parallel cable that connects the computer running mach to the G540.  According to the manual from Gecko, in this DB25 pin 14 is "VFD PWM (50hz)" and pin 17 is "OUTPUT 1".

(Note:  The gecko is supposed to receive PWM on Pin 14 and turn it into a variable voltage output on the screw terminal Pin 8.)

So what's odd is that sending a PWM signal on the Parallel cable's Pin 14 doesn't do squat, whereas once Mach is configured to send that same signal on Pin 17, the Gecko starts spinning the spindle.  Very odd given that Gecko thinks Pin 17 is a pin it should use for talking, not listening.

Title: Re: VFD Help
Post by: ger21 on July 27, 2013, 10:32:34 AM
I think I got a little confused myself?

Are you sure the parallel cable is straight through?
Title: VFD Help
Post by: benha on July 27, 2013, 02:05:21 PM
I've tried two cables, both sourced from cnc components companies. Haven't put a meter on the pins, but I'm pretty sure they're right.
Title: Re: VFD Help
Post by: Stuboy on July 27, 2013, 09:12:56 PM
I think i can help a little here, I've just spent 3 days setting my Siemens Micromaster420 to work with a new Chinese Breakout board and mach3.

There are several pit falls i have come across.

1) Its easy to get pins confused, excel spread sheets are your friend! Write all your parallel board breakout pins down and check your mach 3 assignments to them and your feeds to VFD and drivers etc.

2) I spent ages fiddling in PORTS & PINS before realising I had to configure this lot


Step Pin (to pin one in my case) that's the pin your PWM signal will come out of your parallel port on.
Step Low Active
Step Port (1) for most people with a single Breakout board


Relay control un-ticked
Clockwise output 1
CCW       output 2

Motor Control 
tick    use spindle motor output
tick PWM control


output 1 enable, port one, pin 2 (2 In my case to operate one of my Breakout board relays that connects to my VFD for forward direction of spindle)
output 2 enable, port one, pin 3 (3 In my case to operate another of my Breakout board relays that connects to my VFD for reverse direction of spindle)

This should get you on the right path, two slip-ups i made were not assigning the spindle to "parallel port one" & and forgetting to select active low for my PWM output. If you forget this your spindle will get a full 10v regardless of your speed setting!

The problem i now have is my PWM to voltage converter doesn't appear to be linear on my Breakout board! Or am i still missing something?

I assume as i have a VFD I don't touch the spindle setup in the motor tuning page, that's just for stepper type spindles?
The same goes for pulleys, its a 1 to one from the VFD so that should be left alone also.

I will post separately regarding my linearity problem!

Hope the above is some help to you :-)