Laser Module TTL/PWM with Pico Systems Universal Stepper Controller

More
11 Apr 2022 19:39 - 11 Apr 2022 19:41 #239962 by 3DTOPO
I am using pico-systems Universal Stepper Controller and I would like to implement control of a laser module that has both TTL and PWM capabilities.

The laser module states that TTL signal controls power. So I guess 0V and the module is off and more than 5V the power is on? So for TTL, I guess I can just use a 5V pin and turn it off an on? How would I assign that to the spindle off/on gcode command?

For power control, it says is supports 5V PWM modulation. The only specs given is 0/5-12V, 0-1kHz. I’m guessing 0/5 is 0.5 For PWM, if I understand correctly, can I use a spare step/dir output for a 5V PWM signal? How might it be configured and controlled with gcode?

Any suggestions and information how to configure settings would be greatly appreciated.
 
Last edit: 11 Apr 2022 19:41 by 3DTOPO.

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

More
11 Apr 2022 22:42 #239988 by tommylight

The only specs given is 0/5-12V, 0-1kHz. I’m guessing 0/5 is 0.5

 

Nope, it is 0 and 5V to 12V, although typed incorrectly. And the PWM frequency can be from 0 to 1KHz or 1000Hz.
The rest is Ok.
As for using step outputs, chances are it works but not sure if it requires firmware or just hal settings, so leaving that to Jon as he is the grand master for Pico.
Also, moved to "driver boards".
The following user(s) said Thank You: 3DTOPO

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

More
12 Apr 2022 00:48 #240000 by jmelson
Well, that is not simple. The USC can only do varying pulse rate with fixed pulse width.
Some devices can accept Pulse Density Modulation, which looks just like step pulses, so that might be worth a try, to feed your laser power setting to an unused step generator in the HAL files. The value you feed to a raw step generator is just pulses/second.
The following user(s) said Thank You: 3DTOPO

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

More
12 Apr 2022 03:29 #240006 by 3DTOPO
Thanks Jon!

I see. Well, mainly I just need to be able to turn it off which sounds easy with TTL.

It would be pretty neat to have engraving capabilities though.

Hmm, do we live in an age where a I guy could purchase, I don't know say a USB to PWM dongle or something like that?

Or is there something I can plug into some parallel pins or the USC or something to do PWM easy?

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

More
12 Apr 2022 10:21 #240033 by tommylight
Parallel port can do PWM nicely, most probably TTL too, if the laser works with 3.3V, or use a BOB to get 5V outputs.
The following user(s) said Thank You: 3DTOPO

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

More
12 Apr 2022 14:50 #240050 by jmelson

Thanks Jon!

I see. Well, mainly I just need to be able to turn it off which sounds easy with TTL.

It would be pretty neat to have engraving capabilities though.

Hmm, do we live in an age where a I guy could purchase, I don't know say a USB to PWM dongle or something like that?

Or is there something I can plug into some parallel pins or the USC or something to do PWM easy?



 [/quote]
Well, there might be a way.  P8 provides 8 bits of parallel data at 5 V levels.  This was originally intended for a spindle speed DAC, but could be used for laser power.  An Arduino or ATTiny CPU could easily convert that to the required PWM.
You could set laser power with S#### commands.  But, I think that might cause a motion hitch.  There are M codes that do NOT drain the motion queue that could be used with a small tweak to the HAL files.
Jon
The following user(s) said Thank You: 3DTOPO

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

More
12 Apr 2022 19:31 - 12 Apr 2022 19:44 #240075 by 3DTOPO
Thanks guys!

It says "Support 5V PWM", so I'm guessing it will want 5V.

I guess I will get TTL working and go from there. Would it best to have the USC control it? I think it should work with 3V if needed. Any example configs would be very much appreciated - I am quite rusty with linuxCNC!

Interesting about P8. What would the microcontroller be doing when converting from P8 to PWM? Is their a C program or something I could look at? What pins would it be using on the MC? An example configuration for setting up an M code would also be appreciated.

Oh - and one more question - does the laser module need to share negative or something with what is generating the signal? I ask because it has 3 pins: DC power +, DC power - and TTL/PWM pin.
Last edit: 12 Apr 2022 19:44 by 3DTOPO.

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

More
12 Apr 2022 23:52 #240095 by jmelson
P8 has 8 digital pins that get a value that represents 0 to 255 (decimal) and also negative-true enable signals for spindle forward and spindle reverse. You don't need to worry about those. Just ablve the drawign of the board you will find the pinout for P8 here: pico-systems.com/univstep_pins.html

As for the microcontroller, it just needs to read in the 8 input pins as a binary number and put out a PWM signal of the desired frequency and duty cycle. I do not have sample code for this. Probably somebody has already done this, and a sample code can be found. As for the enables, the USC's e-stop logic will force all 8 digital outputs of P8 to zero when E-stopped.
Yes, I would assume the laser needs a common ground with whatever is sending it a power command. The DC power - sounds like the ground reference.

Jon
The following user(s) said Thank You: 3DTOPO

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

More
13 Apr 2022 00:05 #240098 by 3DTOPO
Thanks for the info. Sounds like something I could pull off, but would it be easier to use a parallel pin converted to 5V as tommylight suggests is possible?

Otherwise, it would be nice to have engraving, but definitely going to take more time than I can give it now since it's not a necessity. But I do appreciate all the information in any event, thank you!

Any hint how to configure the spindle on/off gcode to TTL? Or tutorials on the subject?

Thanks for confirming it needs a common!

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

More
13 Apr 2022 02:55 #240107 by jmelson
Spindle on is M03, spindle off is M05.
With the standard config file set, the M03 turns on SSR1 and M05 or E-stop turns it off.
The command signal to the SSR is onyl a 3.3 V level, and is inverted. So, you would want to put a DC solid state relay in the SSR1 position, and then wire +5 V throught the SSR's output to the laser.
Jon
The following user(s) said Thank You: 3DTOPO

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

Moderators: PCWjmelson
Time to create page: 0.131 seconds
Powered by Kunena Forum