-----Original Message-----
From: Michael Jones [mailto:[email protected]] 
Sent: Wednesday, March 16, 2011 7:59 PM
To: 'Enhanced Machine Controller (EMC)'
Subject: Re: [Emc-users] Spindle speed control through G540 VFD output



-----Original Message-----
From: Kirk Wallace [mailto:[email protected]] 
Sent: Wednesday, March 16, 2011 3:35 PM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Spindle speed control through G540 VFD output

On Wed, 2011-03-16 at 21:05 +0000, andy pugh wrote:
> On 16 March 2011 20:50, Michael Jones <[email protected]> wrote:
> 
> > And yes, the pot is isolated as you've said.
> >
> > Does this mean that this upgrade is a "not recommended" or possibly
> > hazardous direction, or just that there's more I need to do besides just
> > hooking up the VFD output pins from the G540 to make it work
> > correctly/safely without breaking something?
> 
> It should be fine, but you need to know how "isolated" the VFD output is.
> I had a KBIC speed controller and the low side of the pot was held at
> +Motor voltage (100V)
> The VFD output has it's own GND terminal, which is a good sign.
> 
>
http://www.cnczone.com/forums/gecko_drives/88165-g540_vfd_output_floating.ht
ml
> Has a comment from Mariss (who is Mr Gecko) saying that it will be OK.
> 

"The analog output is optically isolated from both the G540 and the PC.
- Mariss"

This quote doesn't instill much confidence, but it seems that the G540
terminals 7 Ground, 8 Output, 9 +10V are isolated from the Gecko circuit
and float. I am guessing these terminals are implying a potentiometer
like function in the G540. The +10V terminal is were you would connect
the +10V output from the KBIC to a potentiometer. Ground connects to the
ground from  KBIC potentiometer terminal for the far end of the
potentiometer from the +10V. Then the output terminal (8) and an EMC2
digital PWM signal go to the potentiometer wiper.

Current
KBIC
---------------
GND  Wiper  +10
 |    |      |
 |    V      |
 +-----------+
 Potentiometer

New
KBIC
---------------
GND  Wiper  +10
|    |      |
|    |      |
GND  OutP  +10V
 7    8     9
    G540
      ^
      |
Parport 14

The wiper will be controlled by the EMC2 PWM on parallel port pin 14 VFD
PMW (50Hz). See here for the EMC2 HAL setup:
http://linuxcnc.org/docs/html/examples_spindle.html#r1_2 

The PWM frequency will be determined by the thread rate that the PWM
component is loaded in - usually the servo thread or 1kHz (?). The G540
doc hints at 50Hz, but I think it will work anyway. This is off the top
of my head, so check the above for yourself.

I suspect you could wire the terminals directly, but there is a
possibility that current limit resistors might be needed somewhere.


-------------------------------------------


Thanks VERY much for the input everyone.   I'm thinking I'm going to try
setting it up this weekend.  I'm thinking I'll put a switch on the center
leg of the potentiometer so that I can switch between EMC controlled and
manual mode when needed. 

And JUST as I'm going to start looking at the configuration, HAL files and
the like.. the machine boots into "busybox CLI " mode.. Arrrrgh!

.. mutter mutter mutter.. 







Ok.. so now that my EMC machine is back on its feet again and I actually had
some time to mess with it today: 

The following is my .hal file.   I set it up according to the spindle
control examples on the EMC web site.. but something is still not right.
Not knowing exactly how everything in the HAL goes together is probably most
of the issue here as I can't diagnose what's right/wrong in the HAL.  :(
I've tried tweaking values from some of the clues I've run across.. but
again.. I don't "know" what they're for so I should stop before I let out
the magic smoke.. 
        
Maybe someone here can help me with it?  What am I missing?

Here's my setup: 

I have a KBIC board controlling the spindle speed.  This is currently set up
with a pot on the p1, p2 and p3 pins, but for testing I set up the G540
connected as seen here: http://pminmo.com/g540-vfd (the version straight
from the G540 to the KBIC board)  I have a spindle on/off relay set up on
parallel pin 17 for start top (works just fine).

What I would like to do is press the start button for the spindle (I'm using
Axis by the way), have the spindle start at a slow speed and I can press the
+ and - buttons from here to control the actual RPM of the spindle, or even
enter a value into a field to command a specific RPM.   I'll do this in the
Gcode later on.. but this is just for testing right now.   

I'd also like to have a display in Axis that shows the "commanded" RPM as
well for reference (later I'll attach a Tach that will send data back to the
HAL from an Arduino controller). 

What happens now....   I press the spindle start (the little circular
arrow), the spindle starts at a slow speed.  I can press the + and - buttons
in the interface all I want and nothing changes.   I've looked at the HAL
configuration and pins while I'm testing and since I'm not sure what I'm
looking for, or what I'm missing.. I don't know if it's right or wrong. 

Help?

Thanks lots, 

Michael

#---------------------------------
# Generated by stepconf at Sun Mar 20 17:50:34 2011
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD
servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x378 out  "
setp parport.0.reset-time 2000
loadrt stepgen step_type=0,0,0
loadrt charge_pump
net estop-out charge-pump.enable iocontrol.0.user-enable-out
net charge-pump <= charge-pump.out

loadrt pwmgen output_type=0

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf charge-pump base-thread
addf pwmgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread

addf pwmgen.update servo-thread

#net spindle-cmd <= motion.spindle-speed-out

net spindle-on <= motion.spindle-on
net coolant-mist <= iocontrol.0.coolant-mist
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-14-out
setp pwmgen.0.pwm-freq 50.0
setp pwmgen.0.scale 3500
setp pwmgen.0.offset 0.114285714286
setp pwmgen.0.dither-pwm true

net coolant-mist => parport.0.pin-01-out
setp parport.0.pin-02-out-invert 1
net xstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
setp parport.0.pin-03-out-invert 1
net xdir => parport.0.pin-03-out
setp parport.0.pin-04-out-invert 1
net ystep => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
net ydir => parport.0.pin-05-out
setp parport.0.pin-06-out-invert 1
net zstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
setp parport.0.pin-07-out-invert 1
net zdir => parport.0.pin-07-out
net charge-pump => parport.0.pin-16-out

net spindle-on => parport.0.pin-17-out
#net spindle-pwm => parport.0.pin-14-out

net both-home-x <= parport.0.pin-10-in-not
net both-home-y <= parport.0.pin-11-in-not
net both-home-z <= parport.0.pin-12-in-not
net estop-ext <= parport.0.pin-15-in-not

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 22967
setp stepgen.0.dirsetup 22967
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
net both-home-x => axis.0.home-sw-in
net both-home-x => axis.0.neg-lim-sw-in
net both-home-x => axis.0.pos-lim-sw-in

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 22967
setp stepgen.1.dirsetup 22967
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
net both-home-y => axis.1.home-sw-in
net both-home-y => axis.1.neg-lim-sw-in
net both-home-y => axis.1.pos-lim-sw-in

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 22967
setp stepgen.2.dirsetup 22967
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable
net both-home-z => axis.2.home-sw-in
net both-home-z => axis.2.neg-lim-sw-in
net both-home-z => axis.2.pos-lim-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare =>
iocontrol.0.tool-prepared


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to