On Wednesday, March 09, 2011 10:14:39 AM Tony Zampini did opine:

> Hi all,
> 
> I'm attempting to set up EMC2 to generate a PWM
> signal for spindle speed control. I put a DVM on the
> PWM parallel port pin in hopes to see an average
> voltage of the PWM signal. But all I see is about 90mV,
> and it never changes.
> 
> I tried MDI commands like:
> 
> M03 S100
> and
> M03 S2000
> 
It is my finding that the line sequence counts.

IOW:

S100
M3

or
S2500
m3

Always works.  You must set the speed at least a line prior to issuing the 
M3 command.

You will also need to set the pwm generator up in your .hal file, which in 
my case (I'm using a 4 axis xylotex/pmdx-106 interface to the speed 
controller that was in the gear housing of my mill, but which now lives in 
a box with the pmdx-106)

loadrt pwmgen output_type=0

addf pwmgen.make-pulses base-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread

net spindle-cmd <= motion.spindle-speed-out => pwmgen.0.value
net spindle-enable <= motion.spindle-on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm

setp pwmgen.0.pwm-freq 100.0
setp pwmgen.0.scale 3833.33333333
setp pwmgen.0.offset 0.173913043478
setp pwmgen.0.dither-pwm true

net spindle-ccw <= motion.spindle-reverse
net spindle-ccw => parport.0.pin-14-out
net spindle-pwm => parport.0.pin-16-out

This is the order they occur in my file, but there may be other non-spindle 
related items intermixed.  A side comment that could be called a bug exists 
in my setup with the above scale factors because the pwmgen is designed to 
run at say 1% duty minimum, to maybe 98% maximum, but because the pmdx-106 
uses the activity of the signal as its enable, asking the pwngen for a 100% 
duty cycle leaves it sitting high, so the activity sense is lost and my 
spindle drops out and stops.  At a spindle speed over ride of about 105%.


> I'm fairly new to EMC2. Can someone tell me
> what is required to activate the PWM output?
> 
> Thanks!
> Tony
> 
HTH, Tony, and welcome to the list.
 
> ------------------------------------------------------------------------
> ------ Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
<http://tinyurl.com/ddg5bz>
We prefer to speak evil of ourselves rather than not speak of ourselves at 
all.

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to