On Sat, 2008-09-20 at 12:18 +0100, [EMAIL PROTECTED] wrote:
> I read with interest the recent thread on Spindle Speed in the hope it
> would answer my question, but it didn't quite get there!
> 
> I'm converting a Boxford 190VMC mill to use EMC. I have everything
> basically working but I have been unable to figure out how to get
> closed
> loop control of the spindle speed. The spindle has a 50ppr encoder and
> is driven by a variable speed drive that wants a 0-10V signal to span
> the range up to 3500rpm. The voltage/speed relationship is quite
> non-linear.
> 
> I've hooked up a counter to give me a speed readout via pyvcp. At the
> moment I'm driving the spindle open loop using a lookup table
> implemented with the linear8 Hal component.
>  
> But how would I implement closed loop speed control? Is there some
> documentation I've missed, or can someone give me some pointers
> please?
> 
> Steve

Basically, you need to connect your spindle encoder to a HAL encoder
input. Then in HAL, connect the encoder signals to the motion.spindle
inputs, then motion.spindle outputs to a DAC (digital to analog
converter).

My lathe setup is like this:
...
### Connect spindle encoder ###
# Set counts per revolution
setp ppmc.0.encoder.03.scale [SPINDLE]INPUT_SCALE

# report rev count to motion controller
net spindle-pos motion.spindle-revs ppmc.0.encoder.03.position
net spindle-index-enable motion.spindle-index-enable \
ppmc.0.encoder.03.index-enable (this and previous line are one line)
#(See: http://www.linuxcnc.org/docview/html//man/man9/motion.9.html )

### Connect spindle DAC ###
# connect DAC's enable pin
net SpindleDACen or2.0.out parport.0.pin-17-out

# connect spindle DAC, set scale value to match spindle
# RPM at +10 V on VFD (ex. 3000 rpm = 10 V * 300 rpm/V)
setp ppmc.0.DAC8.00.scale [SPINDLE]DAC_SCALE
net spindle-speed motion.spindle-speed-out ppmc.0.DAC8.00.value
...

The complete config is here:
http://www.wallacecompany.com/cnc_lathe/HNC/emc2/configs/
http://www.wallacecompany.com/cnc_lathe/HNC/

Of course, your setup will be different, but similar. This probably
isn't enough information, but should get you started.

Kirk



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to