On Fri, 2008-06-06 at 11:11 -0500, Jon Elson wrote:
> Kirk Wallace wrote:
> > On Thu, 2008-06-05 at 21:19 -0500, Jon Elson wrote:
> > ...snip
> > 
> >>If you have a spindle encoder, you could make HAL read the encoder 
> >>velocity and add a correction to the PWM output.
> >>
> >>Jon
> > 
> > 
> > It was talked about before, but I don't remember the outcome. The
> > software encoder has a velocity output pin, but ppmc and other hardware
> > drivers don't?
> > 
> The PPMC driver does have "delta", which is velocity in encoder 
> count units.  For a spindle, I guess it would be scaled from 0.0 
> to 1.0, but my driver doesn't do this.  It could be added fairly 
> easily.  There might be glitches in delta when the spindle syncs
> to the index pulse.  Clamping the value of delta to some 
> reasonable maximum for the RPM and pulse count would be a good 
> thing to do.  I'll have to do some experiments with this, I am 
> going to be setting up a spindle speed control to demo at the 
> CNC Workshop.
> 
> Jon

Thinking aloud, there might be three elements; motion.spindle, pid.X and
ppmc.X.encoder/pwm.

Connecting the enable signal should be fairly simple:
net SpinEN motion.spindle-on => pid.X.enable ppmc.X.pwm.X.enable

Connecting the speed command (RPM):
net SpinSpCmd motion.spindle-speed-out => pid.X.command

Then pid.X.out would be scaled/converted to a number between 0 and 1
corresponding to the percentage of commanded spindle speed and fed to
pwm.X.value?. This would be inversely proportional to the feedback
encoder counts per base/servo period. I seem to recall encoder count
wrapping and/or resetting is an unresolved issue.

Feedback would start with ppmc.X.encoder.X.delta? Is encoder delta reset
to zero and at what event? This would then be scaled/converted to RPM
and fed to pid.X.feedback and possibly a speed display.

It looks like there is still some magic that needs to conjured before
this will work.

-- 
Kirk Wallace (California, USA
http://www.wallacecompany.com/machine_shop/ 
Hardinge HNC/EMC CNC lathe,
Bridgeport mill conversion, doing XY now,
Zubal lathe conversion pending
Craftsman AA 109 restoration
Shizuoka ST-N/EMC CNC)


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to