Realtime PWM mode added.

Discussions and file drops for Auggie
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: Realtime PWM mode added.

Post by Joakim »

Glenn:
You are right. The mA setting could be one of the PWM output. The only time I change this setting is between jobs or if a job has both vector graphics and cutting.
The 40W tube I have in my K40 has a usable range from 4 - 17mA and are not linear. The range from 17 - 20mA has very little effect on cutting but will wear the tube faster (red it on the net...).

Would be nice to program a function for the PWM output to have a control value from 0 to 100%.

- Joakim
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: Realtime PWM mode added.

Post by Joakim »

Art:

Just upgraded the firmware in the PoKeys57E, first to recovery mode and then to firmware 4.1.68.
Everything seems to be as before - Noticed that the backlash compensation is now enabled i motion control.

Viewed your YouTube video and got the explanation for the two sets of motion controlled axis (XYZA + 1234).
If I use two of the Free Axis for laser pulse and power there will still be two more axis for other uses.

A year ago, when I first experimented with pulse control, I found some tests on the K40 timing on the internet. As I recall the minimum pulse was about 1ms, optimal 2ms and above 3ms was more like constant on.
At 2ms the output power was twice the rated value of the tube (60-80W for a 40W tube) because some power build up in the ionized gas. This is just numbers from my memory, but pretty interesting to have that high power when pulsing the laser...  :)
If the pulse is too short the laser won't fire and too long it behaves like constant on.

My plan is to completely rewire the K40 with new end stops and replacing the flat ribbon cable (Y axis) - this will take some time before I am ready to do some tests. But will be fun to do...  :)

Is Auggie safe enough to connect to a real laser? I have only been playing around with Auggie without mechanics attached.

- Joakim
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

J:

>>A year ago, when I first experimen ted with pulse control, I found some tests on the K40 timing on the internet. As I recall the minimum pulse was about 1ms, optimal 2ms and above 3ms was more like constant on.
At 2ms the output power was twice the rated value of the tube (60-80W for a 40W tube) because some power build up in the ionized gas. This is just numbers from my memory, but pretty interesti ng to have that high power when pulsing the laser...  Smiley
If the pulse is too short the laser won't fire and too long it behaves like constant on.

    The ionization effect is short, typically it wont do much for you unless you run very slow.. but you timing seems short to me, my RF
laser runs about 5Khz ( most can run to 20Khz, but I limit mine to 5. Tweaky would be the expert there, but I cant see why we cant hook
your MA meter to an analogue pin on a pokeys and read the current for an onscreen DRO, then play with timing to see what the real parameters are.. I suspect only testing will tell the truth on each tube. Im not sure if a power supply tickle will allow the speed Id think
you should get or not, but I suspect you can get faster than 1ms..

>>My plan is to completel y rewire the K40 with new end stops and replacing the flat ribbon cable (Y axis) - this will take some time before I am ready to do some tests. But will be fun to do...  Smiley
>>Is Auggie safe enough to connect to a real laser? I have only been playing around with Auggie without mechanics attached.


  Im waiting on a ballscrew , a din rail and a few small things before mine gets hooked up but it wont be long before
I hook mine up. Certainly you can run the mechanics, but as with all experimental programs take it slowly, test each motion
and such. I may beat you to it, but if I dont let us know how your motion seems..Ive only been testing with stepper, but
servo is what Ill use in the laser. It is also possible to turn on lasing, but Id rather wait to explain that as I get mine working
as I often tweak system internals when I find a problem,...and I find problems by using it..

    We dont yet have any scaling or calibration functions, Ill be writing those as I calibrate mine..

Art
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: Realtime PWM mode added.

Post by Joakim »

Some time has gone... and I am finally ready...  :D

The K40 is rewired, motors are running X and Y (Ethernet requires 0 in delay in my config).

Reading forum posts, seeing videos and playing with Auggie, I am still not sure, how to connect the fire pin on the laser power supply to PoKeys57CNC to get real time PWM. Is it the Step/Dir on axis 8 or some other PWM pin?
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

Hi Joakim:

    YaNrNo is just hooking his up too, so we'll have more info shortly...

But as to what to do.. Turn on the laser Spindle Library, (Turn off any others..).

  You have to edit that library file by checking it out in the debugger and editing the PWM
number to use. Generally, youll use two signals depending on the laser power supply.

Most have "LaserOn" or "TTL" as the first, and PWM as the second. What you need to feed each depends on
the power supply. Some, simply leave the TTL float , ( which enables the power supply), and feed PWM into the
PWM input, this works fine. Others need to pull the TTL input high or low to enable the laser. I use relay #1 to
turn on my laser supply. You need to know what it takes turn on the TTL or LaserOn input. Wire up Relay1
to do that , and it should turn on or off with the "LaserOn" button on the main GUI beside spindle speed.

  The theory here is we enable the supply with that button, recoding the button script to turn on some
other relay or pin if required. Once on, the laser doesnt shoot because PWM will be at 1%
( or whatever PWM minimum is set to.). So long as the laser on button is active, the laser supply will be live.

  The PWM stays at PWMMin unless commanded, and it wont turn on without M3 being in effect.  The SetSpindleState
function in the laserSpindle library controls this from variables at the top.

global LaserAxis = p.GetInt("Axis",8);
global LaserMaxPower = 100;  //max power = 100%
global LaserPWMPeriod = p.GetFloat("Period",.0002); //for 5khz tickle 
global LaserPWMChannel = p.GetInt("Channel",4);

I wouldnt change LaserAxis, leave it 8 for now, I need to add some config changes to allow it to be changed,
but you may change the LaserPWMPeriod and LaserPWMPeriod to use whatever channel and period you like.
Its set for 5khz.. but if you need 20khz for a glass co2.. change it to look like this..

global LaserAxis = p.GetInt("Axis",8);
global LaserMaxPower = 100;  //max power = 100%
global LaserPWMPeriod = .00005; //for 20khz period 
global LaserPWMChannel = 4;  //for channel 4

  Just change those last 2 if you need to. You will typically hook the Pokeys 0 volt to the 0volt terminal,
and the pwm channel to the PWM input..

  We're working on this now, so within a few days Ill post more about how this works with hv lasers,
Ill have to issue an update as I just added scaling for lasers that dont turn on till they hit a
minimum limit..  Dan has his working so perhaps he can kick in on how he wired his as well.

Art

User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

Joakim:

  Update:

Dont change any script, I have added selection of PWMPeriod, channel and axis into the main planner config. Ill update tomorrow..

Thx
Art
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: Realtime PWM mode added.

Post by Joakim »

Great, I will wait with script changes.

My power supply is a real Chinese Style, open and have few markings on it. Earlier I did some measurements and wire following to get a schematics of the inner working (hand draft attached).

With Mach3 I had the laser fire working, attached to Z direction signal and it fires when pulled low.
The laser activation (Laser On) can be a relay simulating the switch I have today.
Laser power (mA) can be a PWM signal simulation a voltage between 0.9V and 3.5V - now it is a potentiometer 1k 2W.
Test switch will be in software (Auggie).

First test will be the real time PWM and get it working.
Laser On switch and mA control can follow when laser fire is working.
Attachments
P1060899 - Forum.jpg
P1060896 - Forum.jpg
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

Hi Joakim:

 Amazingly ( or not), yours is near identical to YaNvrNo's, who hooked up last night and will test shortly under Auggie.
Its always easiest to test with Pokeys software first when you hook up..

 So lets talk about the schematic, he hooked up different to you, but there are many ways to do it..

 OK, so lets talk about PWM first.. We disconnected the pot, and connected hte 0vdc line of the boards POT connector
to Pokeys Ground. This references the Pokeys to the board. We then used PWM Pin 20 on the TestIO connector
to the center POT pin. That pin, ioncidentally, has changed location, its on pin 14 in my board of the testIO connector,
and on Pin1 of YaNvrNo's baord. So check your board for version info if you decide to use Pin20.

  That connection will then supply the PWM. In Auggies Config/Planner, you will set a period of .00005 for 20Khz PWM
and channel 2 if you use the TestIO connector . ( I use Channel 4 here, pin 18 from the LCD connector).

That having been done, your PWM should now control the power.

 Now for LaserON, we used the Test Switch inputs, feeding  the positive side
of the test switch to OC2+ and the other to OC2-.  Also the Laser on was fed
to OC1+ and OC1-.

  On this board for some reason the test switch must be pressed for it to work.. I might add
his board is different than yours, a modification or revision Id think..

I use relay1 to control my laser on, so you may use relay 1 instead on an OC.. The
on, whether you use and OC or a relay, will have to be changed from what I use as
I use only the relay #1, and its triggered by the button on the screen , which has a
variable name that makes it trigger Relay1.

 So, if you get the OC's or relays you need turning on the LaserON or Test  button ( or both),
so long as the PWM is hooked up, the LaserSpindle script will automatically use the config/planner
settings to control the power.

  We're just getting YaNvrNo's working today, so Ill post updates as to where we were
wrong or add data to help you figure it out. He'll post if I have screwed up any
details, as he actually has the laser there.. I am viewing from a distance. :)

If confused, Ask away, we'll figiure it out together, but it looks like your well on
your way and very close to radiation..

Art


Last edited by ArtF on Mon Apr 25, 2016 1:05 am, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

J:

  OK, I have just uploaded a new version of Auggie. In its config/Planner you will find a setting for

PWMChannel -> This sets the PWM channel used, no need to edie the laserSpindle scripts, they load this value.
PWMPeriod-> I use 5Khz, ( 200us), but yours is High Voltage, I hear 20K is better, so set to .00005
PWMMin -> This , in your case should be set to 1. Its not really needed as this nortmally is the tickle pulse, and
                  I dont belive you need a tickle, but having it at , will allow you to see your freeaxis#8 count at 1000
                counts persecond when PWMRealtime is on. Its a good Diagnostic. For Tickle requirements, one can
                  set a tickle power here.
PWMMax - > I set mine to 97%. This keep sme from driving at 100%, not good for some lasers. For high voltage
                  lasers Id recomment finding the pwm for the max MA you wish to use and set it there.
PWMMinPower  ->This is a setting I set to 2 , to indicate its the turn on power of my laser. The program will scale its levels
                  from this level up, so if your laser doesnt turn on till a PWM of 20 or 40, set that here. If , for example it turns on
                  at 30% pwm, then Auggie will scaled 3d and photos from 30-maxpwm as 0-100% power..


  Ill post more as we figure out more from YaNvrNo's test site. He's a great tester and has tested most of Auggie over time,
so if we dont electrocute each other, we'll post details on success or failures. :)

  Let us know how it goes.

Art


User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

One more piece of data, ( because threads such as this exist for years and many tend to read them for info..)

The following photo shows the Pokeys57 revision 2 changed the PWM location on the TestIO connector. As indicated by the arrow..

Art
Attachments
mine.JPG
Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: Realtime PWM mode added.

Post by Ya-Nvr-No »

Here is a view of my wiring on the laser board, I tried to label the connections, but it turned out to be quite straight forward. That is other than the pot plug had to be removed for the pokies pwm to control it.

In my case I used the OC's you just have to provide the OC+ with the voltage source from the buttons (note where the +/- are) and when the pokies turns on that OC it closes the contacts just as if I pushed the button. I wired them so I can still use the buttons in a manual mode. I also added a remote Test button so I can fire if i need to walk around. (not necessary but it makes it nice for laser/mirror alignments)

So hopefully you can see on one side I send the signal over "TO" the pokies thru a terminal block then the pokies is connected OC- "FROM' back thru the terminal block. (more that you follow the logic then using this hardware)

And then the pwm test connector art showed in my photo above was just connecting my choice (Pin22 PWM2) back to the center tap of the pot with a common ground from both laser and pokies boards.

In my case it takes about 2volts to start to fire the laser, somewhere around 42% on the pwm slider. And that's what lead to the scaling routine Art created for your particular requirement.

Safety Note: stay away from the left side of the board if testing with button or firing laser. Take my word for it ;)

its pretty straight forward and damn cool to see in action.
Attachments
laserwiring.jpg
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: Realtime PWM mode added.

Post by Joakim »

Art:
I have summed it up for my board and have made a sketch (only handmade).

1) The power is controlled with PWM 2 on Encoders pin 9 and GND on pin 10. (It is the same as DB-25 connector or Test IO connector but without the version confuse).

2)  The Laser On/Off button is connected to OC1 on the Galvanically Isolated I/O.

3) The Laser Fire (Test Switch) is connected to OC2 on the Galvanically Isolated I/O.
This input bypasses the opto coupler on K40, but it makes sense as Pokeys has its own opto isolation and the delay will be less.

Ya-Nvr-No:
I made the drawing before I saw your post. Only difference i see is that we switched OC1 and OC2. I haven't made the physical changes yet so I will change to match your configuration.
What I don't understand is the PWM connection to the power pot. If I measure the voltage on the center pin it is about 1.22V. Switching it to ground will not give the correct voltage (0.9 - 3.5V) as the pot gives.

I will keep the manual switches as well - good idea.

Just a short status - I will be away this evening.
Attachments
P1060902 - Forum.jpg
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

J:

Looks good. As to the pot,  the center tap being connected to the pwm means it shoudl see from 0 - 5 as pwm goes up.
The 0volt line of the pot is connected to pokeys ground just to give it a referance for the pwm.. You do need to remove the pot
though.  You sould then be able to measure form 0-5 volts as you slide the pwm slider on the pokeys software..

If so, your good to go, we're runnign tests, so we'll tell you what to look for as we find weaknesses in setting up..

Art

GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: Realtime PWM mode added.

Post by GlennD »

I only unhooked/hooked the TTL line and the PWN line (sorry for the dark blurry photo).
I did that to just test it out.
I still have to hook in the water pressure switch and a door switch but it runs.
I am pulling the 24v off of this power supply to run the Pokeys as well.
The blue wire labeled 2 goes to the Relay OC1
The black wire with the label is using Pin20 for PWM(PWM2).  I have it run through a small 3.3v to 5v booster circuit.
I used encoder connector since it had a smaller foot print.

The bob I am using is shown as well.

I will post a picture, I got off of the google K40 site, over in the laser stories side.
It looks reasonable.

Glenn
Edit was removing some possible confusion with the pin number P20 is PWM Pin2 not pin2
Attachments
PSLaser.jpg
PoKeysBobR2.png
Last edited by Anonymous on Mon Apr 25, 2016 1:40 pm, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

Thx Glen:

  Looks like its all coming together..
  :)

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests