2.9-pre, not able to configure pwm signal

More
26 Jun 2019 15:33 #137908 by llamatrails
linuxcnc 2.9.0-pre0-135-g71bbc3c

I'm trying to configure the spindle control with a pwm signal to control my laser. Been Googling and searching here, without much luck.

The pc parallel port is wired to a Gecko G540, so I am using the pc pin 1 which shows up on the G540 as terminal 6.

When I measure the frequency on the Gecko terminal 6, it is about 900 kHz with the spindle off, and drops to about 600 kHz when I start the spindle. The M68 command is working, and the laser-pwm parameter is toggling according to the hal meter.

What voltage should I see on the pin when the spindle is on?

Appreciate some insight into what I'm missing here ...

TIA,
Rick

Here are the hal lines, with the files attached.
# laser pwm output
loadrt pwmgen output_type=0
# cycles per second
setp pwmgen.0.pwm-freq 100.0
# min/max value of 1.0 = 100%
setp pwmgen.0.min-dc 0
setp pwmgen.0.max-dc 0.99
setp pwmgen.0.dither-pwm true
setp pwmgen.0.scale 1000
setp pwmgen.0.offset 0.0
setp pwmgen.0.enable TRUE

addf pwmgen.make-pulses base-thread
addf pwmgen.update servo-thread
net analogout motion.analog-out-00 => pwmgen.0.value
net laser-pwm pwmgen.0.pwm => parport.0.pin-01-out
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Jun 2019 17:19 #137913 by pl7i92
hi what parameter did you set to analog-out
OR how doe you control the intensety of your laser
by S100 M3 to S1000 M3
or did you put a SCALE DIAL to a GUI widget that drives the VALUE of the LASER

as if of Spindle SPEED control to laser intensety you need to put the value of the RPM to the pwm

linuxcnc.org/docs/html/examples/spindle.html
loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
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-09-out
# Set the spindle's top speed in RPM
setp pwmgen.0.scale 1800

Please Log in or Create an account to join the conversation.

More
26 Jun 2019 19:02 #137923 by llamatrails
Thanks for the info. I've been using the M68 to set the pwmgen.0.value otherwise I've already got the rest set. I'll try using the motion.spindle-speed-out or whatever the equivalent is for 2.9.

Please Log in or Create an account to join the conversation.

More
26 Jun 2019 22:59 #137938 by llamatrails
I’ve moved the laser off the G540 to a second parallel port and now I can see +5 and the pwm duty cycle when I start the spindle. Progress !!

Will post after more testing.

Rick

Please Log in or Create an account to join the conversation.

More
27 Jun 2019 22:53 #138041 by andypugh
For laser it might actually be better to use M67 than spindle or M68.

An M67 value is applied the instant that the next axis movement starts. That's probably what you want for a laser.

You would still use M68 to turn it off, as M67 does not do anything without a motion command.

Please Log in or Create an account to join the conversation.

More
27 Jun 2019 23:16 #138047 by llamatrails
Appreciate the comments. I've been using the M68 to test with since it is immediate and I can monitor the values in the hal meter while my multimeter is on the wire.

Now that I've moved it off the G540, all seems to be well. I've dialed in the min-dc and max-dc watching the duty cycle values on the multimeter. Have yet to get time to run a laser test, but I'm confident that it will work.

Yes, I will be using the M67 in my gcode along with the spindle on/off as redundant safety checks.

Thanks again all for the replies, it all has helped.
Rick

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum