Variable power laser

jacque

New Member
Hi guys,

Been a while since i was last on here. I have a general enquiry which im hoping some of you Picaxe genius can please help me with. I am looking to use a picaxe to drive between a 250mw and 5w laser using the onboard pwm. I guess for the bigger laser's I will need some additional circuitry to handle the current requirements. I would also like the same picaxe to read a rotary encoder and based on the output of this vary the laser power with the PWM.

My question before i purchase and begin development is;

Is this achievable with a PIcaxe and if so will there be any limitations using this system over an alternative? or put another way am i going to limit the performance of the system by using a Picaxe (i.e if I need high resolution from the encoder 16bit and its travelling at high rpm etc) is the PWM switching going to be fast enough to get max power from my laser etc?

I would really appreciate your thoughts on this!

Thanks

Anthony
 

premelec

Senior Member
Please give more information with regard to actual speeds / timing. Also note you likely will need a gate driver for a switched MOSFET if you use that to switch current [overcomes gate capacitance lag].
 

jacque

New Member
Please give more information with regard to actual speeds / timing. Also note you likely will need a gate driver for a switched MOSFET if you use that to switch current [overcomes gate capacitance lag].
Hey thanks for taking the time to reply. I have had a look around at encoders and I think a quadrature 1024 ppr would be more than ample for my application. I calculate 27238 pulses per sec output maximum for my application speed. I need to be able to control the laser power depending on the rotational velocity of the encoder with as small of a lag as possible. Do you think the picaxe is suitable?

Thanks
Anthony
 

hippy

Technical Support
Staff member
I calculate 27238 pulses per sec output maximum for my application speed ... Do you think the picaxe is suitable?
That rate of pulses would be one pulse every 36us so the PICAXE is going to struggle to keep up with it, especially if it is doing anything else as well as monitoring the rotary encoder.
 

jacque

New Member
That rate of pulses would be one pulse every 36us so the PICAXE is going to struggle to keep up with it, especially if it is doing anything else as well as monitoring the rotary encoder.
Hi thanks for the feedback. What about if I were to use an external resonator with x2 hardware?

Thanks
Anthony
 

hippy

Technical Support
Staff member
What about if I were to use an external resonator with x2 hardware?
I had taken that possibility into account.

The PICAXE uses an interpreter system which executes tokenised commands. The basic 'HIGH pin' type commands take around 250us at 4MHz; that works out at roughly 125us per token. At 64MHz that's about 8us per token.

A simple 'IF pinX.Y = level GOTO label' command uses about 5 tokens so that's around 40us. Doing something when a pin change is detected will add to that.

The PICAXE can handle rotary/quadrature encoders but not at extremely high rates of change, which it seems is what you have.

Given that PWM only has 1024 possible duty values it may be worth detailing how your system is intended to work, how the encoder is used and determines the PWM. It's not currently clear why there would be such a high pulse rate or why that's needed. There may be some other way to achieve what you want.
 

jacque

New Member
Thanks for the explanation Hippy very much appreciated. I think I can get away with a lot less pulses in reality but I was trying to future proof and get an understanding of the limitations of picaxe. All I need is to determine the speed of a fibre spooling off a reel (encoder attached to reel) and adjust the laser power depending on this speed so the fibre is always heated to the same temperature. The speed would vary from 0 to 1.4 m/s.

Thanks
Anthony
 

mikeyBoo

Senior Member
hi jacque,
Since you’re not dealing with extreme speed, you should probably send your tach through a frequency to voltage convertor. This will give the Picaxe an analog (voltage) signal to work with that is directly proportional to the thread speed.

What you need to know is the tach frequency (in Hz) at the highest thread speed, this will let you know what type of freq-to-voltage convertor you need. Most are scaleable.

The next thing you need to know is how much current is to be delivered to the Laser at various thread speeds. If it’s a linear relationship to the speed, then it’s pretty simple. If not, you need to make a speed versus current chart.

I don’t think the PWM frequency is going to be a big deal, since you are going to be controlling the Laser current via the PWM duty cycle. You will need to know the max Laser voltage & current.

You might be able to just use a PWM to current convertor if that’s compatible with your laser. See the following post which illustrates a simple piece of hardware for doing that (albeit I only show 1W & 3W units, they come in beefier sizes). I suppose you could parallel two 3W units.

https://picaxeforum.co.uk/threads/host-board-for-constant-current-hi-intensity-led-drivers.30705/

Your project seems to be a simple follower, so I don’t see why a Picaxe would not work just fine.
Hope this gives you some ideas & good luck with your project.
 

hippy

Technical Support
Staff member
Your project seems to be a simple follower, so I don’t see why a Picaxe would not work just fine.
I would agree with that. By 'rotary encoder' I thought you meant a quadrature encoder, but, as it's monitoring spooling out 'cable', you don't really need that, just need to count pulses, and you should be able to handle up to 16MHz with a PICAXE.

You may be able to get by with using the COUNT command, but if you need faster then you can probably use SETIMER COUNT or achieve the same by direct SFR access to on on-chip timer / counter.

It should be a simple case of counting 'how many pulses over a particular time', then converting that to a suitable PWM value to control the laser.
 

rq3

Senior Member
Hi guys,

Been a while since i was last on here. I have a general enquiry which im hoping some of you Picaxe genius can please help me with. I am looking to use a picaxe to drive between a 250mw and 5w laser using the onboard pwm. I guess for the bigger laser's I will need some additional circuitry to handle the current requirements. I would also like the same picaxe to read a rotary encoder and based on the output of this vary the laser power with the PWM.

My question before i purchase and begin development is;

Is this achievable with a PIcaxe and if so will there be any limitations using this system over an alternative? or put another way am i going to limit the performance of the system by using a Picaxe (i.e if I need high resolution from the encoder 16bit and its travelling at high rpm etc) is the PWM switching going to be fast enough to get max power from my laser etc?

I would really appreciate your thoughts on this!

Thanks

Anthony
I'm assuming that these are solid state diode lasers? If so, each laser needs a particular current to lase. Below that current, it's basically just a high power light emitting diode (LED).

If what you want to do is use a 5 watt laser, and turn it on and off (pulse width modulation) to vary its output power, a fast Picaxe can easily do that by driving the gate of a power MOSFET.

A 5 watt (average power) laser diode will NOT become a 250 mW laser just by reducing its drive current. It will become a 250 mW (average power) laser by pulsing the 5 watt diode at a 5% duty cycle.

Whether or not a Picaxe can do this depends upon the application. A 5% duty cycle could be 5 seconds on, and 95 seconds off. Easy for a Picaxe of any type. Or it could be 5 nanoseconds on, and 95 nanoseconds off. Not possible for any Picaxe. Both scenarios provide 250 mW of optical power, one can be Picaxe driven, one cannot.
 

jacque

New Member
Hi guys, sorry for the slow reply I’ve been away. Really appreciate the information you’ve all given - thanks! I’m going to go though it properly and I’ll probably come back with a couple more questions but it looks like the picaxe may be able to do the job using your suggestions.

Cheers
Anthony
 
Top