Secondary PWM Output for LASER

More
06 May 2017 18:53 - 06 May 2017 18:55 #92753 by Askjerry
Replied by Askjerry on topic Update - Partiall Fix
I had an idea... it partially solves the problem...

net xenable => parport.0.pin-01-out => pwmgen.1.enable

The StainSmart board has the parport.0.pin-01-out tied to every ENABLE line... so I have it set as AMPLIFIER ENABLE.

When I tied the pwmgen.1.enable to it in the code above... pressing ESTOP kills it. The problem is... when I turn the ESTOP off... the pwmgen.1.enable returns... and the LED illuminates at the last given power setting.

I need to figure out how an ESTOP could set the motion.analog-out-00 go to ZERO...
I.E. the same as initiating a M68 E0 Q0.00 command.

Thoughts???
Last edit: 06 May 2017 18:55 by Askjerry.

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

More
06 May 2017 21:12 #92756 by rodw
Replied by rodw on topic Secondary PWM Output for LASER
Just and2 your estop-out and spindle-on and set your pwm enable with the resulting output instead of spindle-on directly.

Referencing your estop-out signal, the docs say it will be false when an estop exists so you should not need to invert the signal. See
iocontrol.0.user-enable-out on the link below:
linuxcnc.org/docs/html/man/man1/iocontrol.1.html

Also, if you look in the plasma and laser forum, this thread shows you how to use M68 to set multiple parameters from gcode which may be handy for you.
forum.linuxcnc.org/plasma-laser/32691-settings-from-g-code-file

Also consider using M64 & M65 to turn on and off the laser from Gcode (you will need a M64 P0 as well as M3 to turn it on). This lets you turn the torch off independant of the spindle. My plasma config only turns the torch on if the spindle is on and motion.digital-out-00 (set by M64/M65) is on. That lets my post processor turn off the torch before the end of the cut so the arc can die down. Probably not needed for laser.

I could not help but wonder if you could set the laser power with spindle speed (S command) if you ever need another pin.

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

More
06 May 2017 21:43 #92758 by rodw
Replied by rodw on topic Secondary PWM Output for LASER
Sorry, I missed your second post as it was on a new page.

Unfortunately, there is no way to write to motion.analog-out-00 that I could find (even via C code in a component). I did think of trying to decipher the Linuxcnc typedef syntax and creating a pointer that would allow me to override it.

I think that the way I would tackle it would be to write a component that had motion.analog-out-00 and iocontrol.0.user-enable-out as inputs and an output to set the PWM value.

When a change in estop state was detected that is an estop, zero the output.
When a change in motion.analog-out-00 state was detected and not in estop, set the output.

Just grab a simple example component from github source (like this one) as your source code template
github.com/LinuxCNC/linuxcnc/blob/master...omponents/mult2.comp

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

More
08 May 2017 16:36 #92834 by Askjerry
Replied by Askjerry on topic Fully Operational !
The LASER system is FULLY OPERATIONAL now!

I still have to install a physical ARM/DISARM switch in the machine... starting LinuxCNC with the unit connected can get interesting... the PARAPORT will momentarily click on/off during boot and/or when loading AXIS... so the LASER can momentarily pop on... at 100% power for a half second or so. :woohoo:

Currently I leave the connector removed until after setup... but I don't like plugging/removing it with power applied. Also... if you have been using the laser and remove the plug... the internal capacitor on the unit will cause it to fire briefly... like... a blue flashbulb going off... so I need to put a resistor in my ARM/DISARM switch to bleed it down. Minor stuff.

Anyway... I'm doing something that I have not seen anyone else on YouTube doing... having the LASER set it's own focus point. I installed a switch that triggers about 4 or 5mm from the face of the laser assembly... the focal length on this one is about 18mm. So I treat it like a touch probe... move in, back off, come in... then set the offset. It then moves to G0 A0 which is to say that it is perfectly focused above whatever surface is being engraved. I can experiment, then tweak my code to adjust the focal point down to .01mm or so.

Of course... custom panel switches were made... so I wanted you to have the files in the event you wanted to play with them or dissect them for your own use. I am also in the process of getting the spindle speed indicator to work... so at least for now there are 3 speed displays... the gauge, commanded speed, and returned speed. Once I get the thing where it isn't as glitchy... I'll pull the redundant gauge and make the AT SPEED indicator active. (But all that is another project, another video.)

I tried attaching the file... a bit large so I'll post it off-site along with the video when it's finished.
I'll update this post and include them within the next couple days.

Thanks for your help!
Jerry

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

More
08 May 2017 18:15 #92851 by andypugh
Replied by andypugh on topic Fully Operational !

I still have to install a physical ARM/DISARM switch in the machine... starting LinuxCNC with the unit connected can get interesting... the PARAPORT will momentarily click on/off during boot and/or when loading AXIS... so the LASER can momentarily pop on... at 100% power for a half second or so.


This sounds like an excellent time to consider the use of a charge-pump circuit.
Some BoBs have this built-in

Alternatively, you might well be able to find a parallel port pin which consistently doesn't do this.

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

More
08 May 2017 19:28 - 08 May 2017 19:31 #92867 by Askjerry
Replied by Askjerry on topic Fully Operational !
It's pretty tight... only one input pin left. I'll need to research this CHARGE PUMP... I've heard of it... not sure how to implement it yet.

As far as finding a pin that "consistently doesn't do this"... that is probably machine dependent... if I switched to another PC I would not want to have to re-code everything. An external solution is probably more viable... like an AND gate or similar.

Outputs
01 - Amplifier Enable
02 - X Step
03 - X Direction
04 - Y Step
05 - Y Direction
06 - Z Step
07 - Z Direction
08 - LASER PWM
09 - Spindle PWM
16 - A Step
17 - A Direction

Inputs
10 - ESTOP IN
11 - Probe
12 - All Home
13 - Spindle Phase A (RPM Indicator)
15 - Available (Possible Digital IN 0)

Jerry
Last edit: 08 May 2017 19:31 by Askjerry.

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

More
08 May 2017 19:53 #92870 by andypugh
Replied by andypugh on topic Fully Operational !
You would make Amp-Enable be a charge-pump output, and use that to enable the laser and the other drives.
The following user(s) said Thank You: Askjerry

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

More
08 May 2017 19:59 #92871 by Askjerry
Replied by Askjerry on topic More Study Needed
Ok... a quick search yeilded: wiki.linuxcnc.org/cgi-bin/wiki.pl?About_Charge_Pumps

I'll read through it and do some experimenting.

Thanks,
Jerry

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

More
08 May 2017 23:10 #92882 by andypugh
Replied by andypugh on topic More Study Needed
Being lazy, I think that if I wanted a charge-pump circuit I would just use one of the Arduino Nano's I have lying about. It's a waste of money, they cost £7, but I know I can plug one in to my PC, program it, and have the right behaviour in a few minutes.

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

More
08 May 2017 23:13 #92883 by tommylight
Replied by tommylight on topic More Study Needed
Also PCI add on cards do not output anything on any pins untill Linuxcnc takes control.
Making a charge pump control is easy, needs a 2 capacitors, resistor, transistor and a relay. Basicly a RC filter, Pin from the parallel port through a capacitor (1uF should do) to a resistor and another capacitor parallel with the resistor, resistor other pin to ground, point with both capacitors and resistor to the base of the transistor, emitter to gnd, colector to relay, relay other pin to + 12 ro 24V.
Been a long time since i built that but that should do it. A bit of experimenting with the resistor value (1KOhm should do ) and the second capacitor (also very smal value) until you get consistent On/Off when turning machine power on or off in linuxcnc. Requires only 1 output pin from parallel port ( amplifier enable could be left out and charge pump used for it also ).
I have still one such system working in an enclosure, but i can not get to it right now. Never fails, it actualy turns the mains power on for the entire machine, VFD incuded.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum