INSTRUCTIONS:

Check out the new MoBeam posts! To find K40 conversion information use the "INDEX", "SEARCH" or "LABELS" sections in the sidebar.

Monday, June 27, 2016

K40-S Graphics Display

Background

The Smoothie supports a graphic display panel which is connected via an adapter board and ribbon cables to the Smoothie motherboard.
The starting point for info: http://smoothieware.org/panel
The  K40-S BUILD INDEX with schematics

Donate:

Please consider donating (button to the right of this post).

Your donations help fund additional research, tools and parts that I will return to the community as information and how-to's. 

GLCD panel Build

The panel and its shield is pretty straight forward to build and install.
  • Shield build
    • Install the missing pins 
    • Install the 5VDC regulator 
  • Plug the shield onto the smoothie
  • Install the 2 shield-to-panel cables making sure they are correctly connected
  • Check the configuration file to assure the panel is enabled and configured correctly
Make sure that you don't make these mistakes:

Configuration

At the time of this post I was running "firmware-cnc"
Enable the panel module and un-comment what is needed for this display.
Link is here: http://smoothieware.org/rrdglcdadapter look for the configuration setting for the GLCD. 

Change the Rotary Dials Rotation Direction & Step Resolution

+Ray Kholodovsky (Cohesion3D) 
In the config file under panel swap the encoder A and B pin #’s with each other.
To change the step resolution; "That's called panel encoder resolution, it's not in the default smoothie config file, but you can add that line in. The value you want is 4, instead of the stock value 2."

Ready to run, looks like this

Smoothieboard GLCD Shield

The display is connected to the Smoothieboard via this shield which plugs on top of Smoothie :

GLDC sheild without regulator

Mounted GLDC shield with regulator installed

glcdv2_smoothie.png
Note: Additional pins must be added to the Smoothie to accommodate the shield. Install pins in the RED circles.

Cable orientation. I labeled my shield and the cables so that they don't get reversed. 

RepRap Smart Full Graphics Controller:

RepRap Smart Full Graphics Controller

Smoothie board and display mechanical:

In case you want to model the packaging of the display and the smoothie here are some 3D models for SketchUp:

Enjoy and leave suggestions as comments
Maker Don.

K40-S DC Power Systems Design


Background

This post outlines the design for DC power in the K40-S

The  K40-S BUILD INDEX with schematics

Donate:

Please consider donating (button to the right of this post).

Your donations help fund additional research, tools and parts that I will return to the community as information and how-to's. 

General K40 DCPS design configurations


The LPS capacity:

  • +24VDC @1amp
  • +5VDC @ 1amp
Internally these are created from separate sections of the LPS so they have a total capacity of 29VA.
I do not know the power requirements for K40+smoothie when under full dynamic load and therefore
I am skeptical that 24VDC@1 amp can run everything in this box at full power.

I have not measured the dynamic load so at this point it is a suspicion. Power budgeting & verification is on my list of to-do's.

What configuration to use?

How you wire the DC power depends on what your expected full load will be.
Your full load includes DC current drawn from any/all of these:

  • Smoothie
  • Local Control panel (GLCD)
  • Steppers
  • Z table
  • Finder LED
  • DC pumps


DC Power Budget

Coming soon

Typical configurations


You can configure DC power to the Smoothie in three basic ways:

Way #1

+24VDC from the LPS
+5VDC from regulator installed on-board smoothie
Capacity: 24VA
Pro's: simple two wire connection
Potential Con's: marginal power for anything else, local display, finder led, Z table, pump etc.

Way #2 

+24VDC from LPS
+5V from LPS
Capacity: 29VA
Pro's: more capacity 5VDC + 12VDC
Potential Con's: marginal power for anything else, local display, finder led, Z table, pump etc.

Way #3

+24VDC from external supply with selected capacity
+5VDC from regulator installed on-board smoothie
Capacity: based on external supply choice
Pro's: full DC capacity for K40 + expansion. Simple 2 wire DC wiring
Potential Con's: more complex wiring of AC mains (to add on supplies) and purchase cost of external supplies.

What works?


Many of the K40 conversions use Way#1 and 2, so it seems to work, I just do not know if it is marginal.

I chose Way#3 because:
  1.  I want as much isolation as possible from the HV laser supply. In my configuration only the grounds are common.
  2. I wanted to make sure that the motors had full capacity under dynamic loads. I do not know the actual loads so I took the safe route :).
  3. I wanted extra capacity for future accessories like the local GLCD and driving the stepper for the lift table. 
BTW: I currently use the LPS 24VDC & 5VDC  for other accessories such as external lift table and the finder LED.

You can employ Way#1 or 2 and then measure the PS voltage to insure that it is not drooping.

My Current Design

SCHEMATIC

The design is incomplete and is being documented here:

24VDC:

Separate 24vdc supply to smoothie to run the board and motors.
https://www.amazon.com/gp/product/B018TG7I4W/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
or:
https://www.amazon.com/gp/product/B00UHI3NGS/ref=ox_sc_act_title_2?ie=UTF8&psc=1&smid=AWUSKMLB3J3ZT

5VDC Power:

Integrated 5VDC regulator on smoothie and Display adapter provides all 5VDC.

http://shop.uberclock.com/collections/smoothie/products/switching-regulator-dc-to-dc-5v

Laser Power Output:

12VDC:

Separate 12VDC supply: pump, cabinet lights, temperature alarm.
https://www.amazon.com/gp/product/B00UHI3NGS/ref=ox_sc_act_title_2?ie=UTF8&psc=1&smid=AWUSKMLB3J3ZT

Fuses:

All DC supplies will be fused using: 


Saturday, June 11, 2016

K40 + Light Objects Air Assist

Air Assist 

After trying multiple ways of adding air assist using pipes and such, I decided to just get the LO air assist.




Donate:

Please consider donating (button to the right of this post).
Your donations help fund additional research, tools and parts that I will return to the community as information and how-to's. 

Added the LO air assist

Your lens may not fit

The stock lens in my K40 did not fit in the LO air assist unit. Its diameter is to small. So I turned an metal adapter ring. Others have used a cut down nylon washer, which I think is a better idea.
I plan to change my lens and diameter later.






Enjoy and comment,
Maker Don

K40-S Middleman Board Interconnect

Background

The Smoothie needs to be connected to the electro-mechanics of the K40. This includes:
  • X stepper (both phases)
  • Y stepper (both phases)
  • Optical endstops (Optical End stops)
    • Y endstop (open collector)
    • X endstop (open collector)
  • DC power distribution
The  K40-S BUILD INDEX with schematics

Donate:

Please consider donating (button to the right of this post).

Your donations help fund additional research, tools and parts that I will return to the community as information and how-to's. 

Status

In operation fully tested and working fine :)

Middleman

You can get the board here: https://oshpark.com/shared_projects/3W1BpcNl

The middleman schematic and board layout is below:


The connections to the Smoothie are labeled outside the associated connector. 

Note: the pins on this connector are reversed from the other end due to the nature of the FFC connector and single sided cable, its complex to describe, hope this picture helps.

See: Post on Optical End stops

Middleman board and cable orientation


Assembly and connector orientation:

Parts:

In search of a ribbon cable source

The ribbon cable that connects from the endstop daughter board evidentially is not very standard. I have not found a source of replacement.

The cable specs are:
Length: ?? haven't measured it yet.
Pitch: 1.25mm
# of conductors: 12
Type: FFC

You can find 1.25mm pitch cables but they are two many conductors and not long enough.

Some places I am looking:
http://www.axon-cable.com/

Let me know if your find one .... +Don Kleinschnitz

Assembly:

Ribbon connector placement and orientation

The middleman in operation

The Middleman's wired into the system
Middleman mounted in electronics cabinet.

Middleman as an endstop test board

What do you do with an extra Middleman board?

Build an optical end stop tester .... of course !

Lately I have been tinkering with end stops more than anyone should and while looking in my Smoothie conversion parts bin it occurred to me that I could use my extra Middleman board and connector to make an endstop tester.

Done .....

Schematic is here with use instructions:
http://www.digikey.com/schemeit/project/k40-endstop-tester-L91LPBG2001G/

Package is here, nothing impressive. It uses 2x 2016 button batteries and holder. :
https://goo.gl/photos/TatG7gw7LjWsMtgSA

Video is here:
https://goo.gl/photos/MDxDGBuseskPnTGS9

Note: if you don't have a Middleman board you can make one of these using a FPC connector whose pins are soldered to the battery, switches and LED's see the schematic. 

https://plus.google.com/113684285877323403487/posts/MkSQRatqqG9

------------------------------

Enjoy and comment especially if you see errors
Maker Don

OLD: K40-S Laser Power & Control Interface

Background

One design task as part of the conversion of the K40 to a Smoothie is to determine how to best, safely and predictably interface a PWM control with the stock laser power supply. This post documents that research  design, test and implementation.

Status

THIS POST IS OBSOLETE AND LEFT HERE FOR HISTORY ONLY!

READ THIS POST: 

I need a Laser Power Supply (dead) to test:

I wish I at least had a typical schematic for these LPS so I could verify the LPS-IN and "FIRE" function characteristics. My concern is the interface to the LPS and what its response would be to a PWM signal. The expectation is that the input to the LPS-IN is AC coupled through a low pass filter network that will integrate the PWM signal but that expectation is unverified.

If anyone has a LPS schematic or a blown LPS that we can use to better understand its interface please contact me at: don_kleinschnitz@hotmail.com or comment below.

Reverse engineering Information: 

From Scott Marshall on G+:

This is the manufacturers page there's specs and such there, minimal, but some info.
http://en.jnmydy.com/products_list.html
http://en.jnmydy.com/comcontent_detail/&FrontComContent_list01-1285720952066ContId=4&comContentId=4&comp_stats=comp-FrontComContent_list01-1285720952066.html

Inputs P+ and K+ directly drive these optos:http://www.everlight.com/file/ProductFile/EL817.pdf

Driving this PWM Controller by good old Texas Instruments
http://www.ti.com/lit/ds/symlink/tl494.pdf


Inputs are speced at 5v, but look to work on 3,3v (show 3v logic High)

It's pretty conventional switching supply stuff from there. The Hv circuit seems to be a flyback running at about 440hz (awful low) with a tripler output.
300W 11kv nominal 4-20ma (26kv insulation breakdown)

Results of research:

This design is complicated and confusing since: There are two or more prevailing places to connect the PWM control and multiple variations of implementation with at lease two vintages of power supplies.

Below are a couple of links to K40 builds showing others approach:

Connecting PWM to the LPS:

The goal of this design is to connect the PWM signal from the Smoothie to the LPS.  
There are three places to interface the PWM signal to the LPS, INFIRE & "L";

"IN" control:

The IN signal: both A and B configuration of LPS have an IN signal which by all evidence is intended to be an analog and digital means of controlling the laser power supply. This signal in the manual case is the center tap on a 2K potentiometer that is mounted on the control panel labeled "Current Regulation". The only evidence that both PWM and Manual controls can be present at the same time is that the specs from some vendors say: "PWM and Analog" control of the LPS. This interpretation of the use of "AND" may be to specific for translated documentation. 
The IN signal requires a 0-5VDC signal to get the full range of power. The PWM signal therefore must be a TTL like signal, various LPS documentation supports that specification. This means that a +3 VDC PWM signal must be translated to a +5 VDC level. It is also important to insure that the PWM signal is positive. +5 VDC is full power and ground is no power.
Using IN with the "Current Calibration" pot installed will result in a DC shift of the PWM signal. As a minimum this configuration is likely to create power levels that are hard to accurately correlate to duty cycle controls from the driving G/M codes. It could also create DC errors preventing reaching full power levels. 
There are NO schematics available and without knowing the exact input configuration of the LPS only trial and testing can confirm that IN control is optimum. It seems that most Smoothie users are configured this way using a Level Shifter (Ls).

Here is how the Light Objects controller is connected notice that the PWM output on the controller is connected to "IN" on the LPS.

Laser "FIRE" control:

Different "FIRE" functions are used in type A and B LPS configuration. The main theory for using a "FIRE" control function is to simulate the modulation of the "Test Switch" using the PWM signal
Using this configuration is more rational for controlling the LPS with a logic level derived PWM signal. That said and unlike the IN signal I found no evidence in the LPS documentation that "Fire" signals are intended for PWM control. The key concern is that there may be LPS internals (filters/ caps) that do not allow the response necessary for a PWM signal especially at low PWM duty cycles where the pulse width is small. This could create strange laser power problems if the input circuitry is filtering higher speed inputs than a switch closure would provide. I have seen a few K40 configured using a "Fire" function.

Note: 
  • The Smoothie PWM in K40 configurations are typically configured for 50 Hz operation.
  • The signals used as the "FIRE" function is:
    • Type A: +K
    • Type B:  TH or TL.  TH (high) and TL(LOW).

One discussion that often crops up in forums is if the "Current Regulation" pot should be left connected to serve as a "MAX" limit control when using the IN signal as a PWM input. I think that is a good idea but am unsure if it creates any interface or reliability problems with the PWM control.

"L" Control

In this configuration the PWM signal from a controller is connected to the "L" pin on the LPS's power connector. Most evidence suggests that this is a "laser on" function. 
The logic is that the M2 Nano must control the laser some how? The only connection between the M2Nano and the LPS is the "LO" connector which connects to the "L" on the LPS's power connector.

The LO signal is a low true enable to the LPS. At this point I suspect the L signal is the power on/off control in the stock K40 controller. 
Some have reported successfully using the LO signal for PWM, but others have told me that if LO is not statically held low the "Laser Test" SW will not fire. Clearly the upcomming tests will remove the confusion.

M2Nano Pinouts:

This is the best outline of the M2Nano controller pin-outs I have found:

I traced the LO signal on the M2Nano and found that it is connected to a transistor (see pencil point) and the upper left 2 pin connector. Notice the LO label on the left side of the power connector and on the left side of the two pin connector at the top right. This tracing at least suggests it is a used function.
M2Nano controller LO signal 

L Control Conflict:

According to some reported tests it seems that the "L" signal on the LPS must be kept at ground for the laser to fire at all and therefore cannot be used for PWM control. To make matter more confusing some posts were confusing this "L" with the "TL" on Type B supplies.

This configuration suggests using LO for PWM input will work: 

LPS Power Connector:

The Power connector on the LPS typically contains these signals:
  • 5VDC (Yellow)
  • GND (Black)
  • 24VDC (Green)
  • L (Pink) [the M2 Nano LO pin connects to this pin in stock K40's]

Power Supply Configurations:

LPS with white connectors:

Label on back of my LPS supply, I got to it with a video borescope :)

MYJG40W [S/N: 2015090481]


Mine looks like this (I think this type is out of production): 

Ebay: MYJG40 (first time I have seen one like mine for sale)

LPS with all Green Connectors: 

  • LPS part #: MYJG40W [S/N: 2015090481]
  • Suppliers website: ( mine does not look like this): MYJG40W

Photo:

General LPS specs:

Taken from ebay site

DC output specs:
  • 24v@ 1 amp
  • 5V @1 amp

http://www.ebay.com/itm/40W-Power-Supply-Mini-CO2-Laser-Rubber-Stamp-Engraver-Cutter-Engraving-110-220V/311665474162?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D38530%26meid%3D3bc7b9f262f246fca7512e47acedd983%26pid%3D100005%26rk%3D2%26rkt%3D6%26sd%3D172276804836

Laser Power Supply (LPS) Interfaces

I arbitrarily labeled the two types of interfaces "A" and "B" to simplify the documentation. 

Type "A"  LPS control interface:

Current regulation

  • Ground: signal ground
  • IN: laser current control 0-5VDC
  • 5VDC: 5V power [** 5.02 VDC]
Note: the "Current Regulation" pot is connected across these three signals with the center tap connected to IN.

Test Switch ("FIRE")

  • K+: Test switch [**4.28 VDC]
  • K-: gnd return for laser [connected to gnd]

Laser Switch (enable)

  • P+ Laser Switch [**4.28VDC]
  • P- gnd return for Laser Switch [connected to gnd]
** voltage measured with connectors removed
Showing the interface equivalent circuit.

Type "B" LPS control interface:

I think this is the configuration that ships with newer K40's.

Terminal Definition as follows:

THInput SignalOn-Off laser control,TH≥3V, emitting laser; TL≤0.3V, no laser.
TLInput SignalOn-Off laser control,TH≥3V, no laser; TL≤0.3V, emitting laser
WPInput SignalOn-Off laser control,TH≥3V, no laser; TL≤0.3V, emitting laser
GGNDThis foot must be connected well with the laser machine shell and the ground of control board.
INInput SignalThe control of laser power: Both 0-5V analog signal and 5V PWM signal can control the laser power.
5VOutput PowerOutput 5V, the maximum output current is 20mA.

Note: WP = water protection, assume this is an interlock loop for the water pump.

Manual K40 Laser Power Control

The front panel has a knob called "Current Regulation". Its a 2K ohm pot that is wired across 5VDC. The wiper is connected to the Laser Power Supply's IN signal. This configuration provides the stock K40 a 0-5VDC signal on the LPS-IN to adjust the power to the laser.

LPS PWM Interface Design 

Smoothie Open Drain Approach

After posting the level shifter approach below I got advice that the Smoothie could have on of its output configured for "Open Drain" connection to the LPS. 

This approach would completely eliminate the level shifter... YaY!

This approach uses two of the connectors to connect to the Smoothie. One (x10) to connect to the drain of Q6 (a AOT240L MOSFET) and one (X6) to pick up ground.

This schema uses P2.5 in the "Laser" configuration section of the configuration file to set up the PWM but P2.4 can also be used. 

Q6 is high current MOSFET, and if we wanted to reserve it for later use P2.4 and Q9 could be employed instead but the configuration would have to be set accordingly. 

An untested sketch of how that might work is below. I still do not like that the "Current Regulation" pot is the pull-up in this design and when adjusted to zero grounds the driver. Just does not feel clean.

Still working this design. It may be that a pull-up and a low pass filter is needed on the "IN" to isolate the DC and the series resistor is unneeded. This would need testing.

Open Drain Design

"FIRE" with Open Drain

In this configuration the open drain and a correctly sized pull-up is connected to the +K which is the signal used to turn on the laser with the "Test Switch". The PWM would need ground to be the full power level, since the open drain inverts the PWM signal no configuration changes are not necessary. With the right size pull-up the "Test Switch" can remain.

IN with open drain

In this configuration the open drain is connected to the IN port with or without the "Current Regulation" pot installed. The PWM would need 5 VDC to be the full power level, since the open drain inverts the PWM signal configuration changes are necessary.

Level Shifter (LS) Approach

We are going to connect the PWM signal to the LPS-IN or "FIRE" function for power control. The output coming from the Smoothie's PWM swings from 0-3.2VDC and the LPS-IN or "FIRE" expects a 0-5VDC swing to get to full laser power.
I decided to use one channel of a level shifter breakout from Adafruit. Yes it is overkill but even if you do build a equivalent shifter in discrete components it will require a breakout of some sort. The Adafruit breakout is just a few $.

4-channel I2C-safe Bi-directional Logic Level Converter - BSS138

LS connected to FIRE

In the type A case the output of the level shifter is connected to the +K or "FIRE" function with or without the "Test" switch installed. which is the signal used to turn on the laser with the "Test Switch". The PWM would need to be ground true so the PWM would need to be inverted in the configuration.
In the type B case the TH input could be used and no inversion or configuration changes are necessary.

TODO: need to evaluate the impact of grounding the output of the LS when "Test" switch pushed.

LS connected to IN:
In this configuration the output of the level shifter is connected to the IN port with or without the "Current Regulation" pot installed. The PWM would need 5 VDC to be the full power level, since the LS does not invert the PWM no PEM configuration changes are necessary.
TODO: evaluate methods for DC isolation of PWM and pots dc offset.

Level Shifter

The level shifter design is shown below including a model of the input to the LPS. Ideally this would be on the middleman or built into a smoothie version.

Level shifter breakout and LPS input model

Smoothie PWM characteristics and configuration:

See this configuration file for duty cycle and frequency settings:

# Laser module configuration
laser_module_enable                          true             # Whether to activate the laser module at all. All configuration is 
                                                              # ignored if false.
laser_module_pin                             2.5              # this pin will be PWMed to control the laser. Only P2.0 - P2.5 
                                                              # can be used since laser requires hardware PWM
#laser_module_max_power                       0.8             # this is the maximum duty cycle that will be applied to the laser
#laser_module_tickle_power                    0.0             # this duty cycle will be used for travel moves to keep the laser 
                                                              # active without actually burning
#laser_module_pwm_period                      20              # this sets the pwm frequency as the period in microseconds

Smoothie configuration for open drain

The open drain will invert the PWM signal from the Smoothie therefore the configuration file would have to change the output polarity by appending <<!>> to the pins definition.
Smoothie pin Invert parameter.

TODO: PUT FINAL SMOOTHIE CONFIGURATION FILE HERE

Parked: header file for laser control. Come back later and explain.

Smoothie control of Laser

Link to additional discussion regarding controlling of laser with two control pins:

PWM frequency

Note that the period in the above configuration file is 20 us (.000002 sec). 
That is a frequency of 1/.000002 = 500,000 cps or 500 KHZ

Design problems?

Looking at the model of the input to the right of the picture reveals a few situations that I need to investigate. When the pot is turned all the way down it will essentially be shorting the level shifter to ground. Will this cause enough current draw to burn out the BSS138, who's max current is 220 ma? 

I also wonder how the changing DC offset + PWM will effect the integrated IN signal. It may be necessary to remove the level shifters output pull-up (it is in parallel with the pot) and add a series resistor to the output.

At this point this is all untested......
After building a test set up I will test for these cases and report here.

Design Musings

Something about using the "Current Regulation" pot as the pullup in the open drain configuration still bothers me. Theoretically this will adjust the max voltage the PWM pulse can achieve giving the effect of a lower power offset. I can't decide if this is a cleaver approach or a ugly hack that will come and bite me later.

Seems like the "right" approach is to insert a PWM to voltage converter. Then again, in its simple form is just a low pass filter anyway, which is what we are expecting is on the input of the LPS.

I would still like to isolate the PWM from DC offsets created by the Current Regulation pot.

I like the open drain approach the best as it is simple and eliminates the LS breakout. 

Enjoy, and leave comments. 
Maker Don.


K40-S Laser Power & Control Interface

Background

One design task as part of the conversion of the K40 to a Smoothie is to determine how to best, safely and predictably interface a PWM control with the stock laser power supply. This post documents that research  design, test and implementation.

Status

I need a Laser Power Supply (dead) to test:

I wish I at least had a typical schematic for these LPS so I could verify the LPS-IN and "FIRE" function characteristics. My concern is the interface to the LPS and what its response would be to a PWM signal. The expectation is that the input to the LPS-IN is AC coupled through a low pass filter network that will integrate the PWM signal but that expectation is unverified.

If anyone has a LPS schematic or a blown LPS that we can use to better understand its interface please contact me at: don_kleinschnitz@hotmail.com or comment below.

Reverse engineering Information: 

From Scott Marshall on G+:

This is the manufacturers page there's specs and such there, minimal, but some info.
http://en.jnmydy.com/products_list.html
http://en.jnmydy.com/comcontent_detail/&FrontComContent_list01-1285720952066ContId=4&comContentId=4&comp_stats=comp-FrontComContent_list01-1285720952066.html

Inputs P+ and K+ directly drive these optos:http://www.everlight.com/file/ProductFile/EL817.pdf

Driving this PWM Controller by good old Texas Instruments
http://www.ti.com/lit/ds/symlink/tl494.pdf


Inputs are speced at 5v, but look to work on 3,3v (show 3v logic High)

It's pretty conventional switching supply stuff from there. The Hv circuit seems to be a flyback running at about 440hz (awful low) with a tripler output.
300W 11kv nominal 4-20ma (26kv insulation breakdown)

Results of research:

This design is complicated and confusing since: There are two or more prevailing places to connect the PWM control and multiple variations of implementation with at lease two vintages of power supplies.

Below are a couple of links to K40 builds showing others approach:

Connecting PWM to the LPS:

The goal of this design is to connect the PWM signal from the Smoothie to the LPS.  
There are three places to interface the PWM signal to the LPS, INFIRE & "L";

"IN" control:

The IN signal: both A and B configuration of LPS have an IN signal which by all evidence is intended to be an analog and digital means of controlling the laser power supply. This signal in the manual case is the center tap on a 2K potentiometer that is mounted on the control panel labeled "Current Regulation". The only evidence that both PWM and Manual controls can be present at the same time is that the specs from some vendors say: "PWM and Analog" control of the LPS. This interpretation of the use of "AND" may be to specific for translated documentation. 
The IN signal requires a 0-5VDC signal to get the full range of power. The PWM signal therefore must be a TTL like signal, various LPS documentation supports that specification. This means that a +3 VDC PWM signal must be translated to a +5 VDC level. It is also important to insure that the PWM signal is positive. +5 VDC is full power and ground is no power.
Using IN with the "Current Calibration" pot installed will result in a DC shift of the PWM signal. As a minimum this configuration is likely to create power levels that are hard to accurately correlate to duty cycle controls from the driving G/M codes. It could also create DC errors preventing reaching full power levels. 
There are NO schematics available and without knowing the exact input configuration of the LPS only trial and testing can confirm that IN control is optimum. It seems that most Smoothie users are configured this way using a Level Shifter (Ls).

Here is how the Light Objects controller is connected notice that the PWM output on the controller is connected to "IN" on the LPS.

Laser "FIRE" control:

Different "FIRE" functions are used in type A and B LPS configuration. The main theory for using a "FIRE" control function is to simulate the modulation of the "Test Switch" using the PWM signal
Using this configuration is more rational for controlling the LPS with a logic level derived PWM signal. That said and unlike the IN signal I found no evidence in the LPS documentation that "Fire" signals are intended for PWM control. The key concern is that there may be LPS internals (filters/ caps) that do not allow the response necessary for a PWM signal especially at low PWM duty cycles where the pulse width is small. This could create strange laser power problems if the input circuitry is filtering higher speed inputs than a switch closure would provide. I have seen a few K40 configured using a "Fire" function.

Note: 
  • The Smoothie PWM in K40 configurations are typically configured for 50 Hz operation.
  • The signals used as the "FIRE" function is:
    • Type A: +K
    • Type B:  TH or TL.  TH (high) and TL(LOW).

One discussion that often crops up in forums is if the "Current Regulation" pot should be left connected to serve as a "MAX" limit control when using the IN signal as a PWM input. I think that is a good idea but am unsure if it creates any interface or reliability problems with the PWM control.

"L" Control

In this configuration the PWM signal from a controller is connected to the "L" pin on the LPS's power connector. Most evidence suggests that this is a "laser on" function. 
The logic is that the M2 Nano must control the laser some how? The only connection between the M2Nano and the LPS is the "LO" connector which connects to the "L" on the LPS's power connector.

The LO signal is a low true enable to the LPS. At this point I suspect the L signal is the power on/off control in the stock K40 controller. 
Some have reported successfully using the LO signal for PWM, but others have told me that if LO is not statically held low the "Laser Test" SW will not fire. Clearly the upcomming tests will remove the confusion.

M2Nano Pinouts:

This is the best outline of the M2Nano controller pin-outs I have found:

I traced the LO signal on the M2Nano and found that it is connected to a transistor (see pencil point) and the upper left 2 pin connector. Notice the LO label on the left side of the power connector and on the left side of the two pin connector at the top right. This tracing at least suggests it is a used function.
M2Nano controller LO signal 

L Control Conflict:

According to some reported tests it seems that the "L" signal on the LPS must be kept at ground for the laser to fire at all and therefore cannot be used for PWM control. To make matter more confusing some posts were confusing this "L" with the "TL" on Type B supplies.

This configuration suggests using LO for PWM input will work: 

LPS Power Connector:

The Power connector on the LPS typically contains these signals:
  • 5VDC (Yellow)
  • GND (Black)
  • 24VDC (Green)
  • L (Pink) [the M2 Nano LO pin connects to this pin in stock K40's]

Power Supply Configurations:

LPS with white connectors:

Label on back of my LPS supply, I got to it with a video borescope :)

MYJG40W [S/N: 2015090481]


Mine looks like this (I think this type is out of production): 

Ebay: MYJG40 (first time I have seen one like mine for sale)

LPS with all Green Connectors: 

  • LPS part #: MYJG40W [S/N: 2015090481]
  • Suppliers website: ( mine does not look like this): MYJG40W

Photo:

General LPS specs:

Taken from ebay site

DC output specs:
  • 24v@ 1 amp
  • 5V @1 amp

http://www.ebay.com/itm/40W-Power-Supply-Mini-CO2-Laser-Rubber-Stamp-Engraver-Cutter-Engraving-110-220V/311665474162?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D38530%26meid%3D3bc7b9f262f246fca7512e47acedd983%26pid%3D100005%26rk%3D2%26rkt%3D6%26sd%3D172276804836

Laser Power Supply (LPS) Interfaces

I arbitrarily labeled the two types of interfaces "A" and "B" to simplify the documentation. 

Type "A"  LPS control interface:

------- Current regulation -------
  • Ground: signal ground
  • IN: laser current control 0-5VDC
  • 5VDC: 5V power [** 5.02 VDC]
Note: the "Current Regulation" pot is connected across these three signals with the center tap connected to IN.

-------- Laser on/off  ("FIRE") ---------
  • K+: laser test switch [**4.28 VDC]
  • K-: grnd
** voltage measured with connectors removed

Type "B" LPS control interface:

I think this is the configuration that ships with newer K40's.

Terminal Definition as follows:

THInput SignalOn-Off laser control,TH≥3V, emitting laser; TL≤0.3V, no laser.
TLInput SignalOn-Off laser control,TH≥3V, no laser; TL≤0.3V, emitting laser
WPInput SignalOn-Off laser control,TH≥3V, no laser; TL≤0.3V, emitting laser
GGNDThis foot must be connected well with the laser machine shell and the ground of control board.
INInput SignalThe control of laser power: Both 0-5V analog signal and 5V PWM signal can control the laser power.
5VOutput PowerOutput 5V, the maximum output current is 20mA.

Note: WP = water protection, assume this is an interlock loop for the water pump.

Manual K40 Laser Power Control

The front panel has a knob called "Current Regulation". Its a 2K ohm pot that is wired across 5VDC. The wiper is connected to the Laser Power Supply's IN signal. This configuration provides the stock K40 a 0-5VDC signal on the LPS-IN to adjust the power to the laser.

LPS PWM Interface Design 

Smoothie Open Drain Approach

After posting the level shifter approach below I got advice that the Smoothie could have on of its output configured for "Open Drain" connection to the LPS. 

This approach would completely eliminate the level shifter... YaY!

This approach uses two of the connectors to connect to the Smoothie. One (x10) to connect to the drain of Q6 (a AOT240L MOSFET) and one (X6) to pick up ground.

This schema uses P2.5 in the "Laser" configuration section of the configuration file to set up the PWM but P2.4 can also be used. 

Q6 is high current MOSFET, and if we wanted to reserve it for later use P2.4 and Q9 could be employed instead but the configuration would have to be set accordingly. 

An untested sketch of how that might work is below. I still do not like that the "Current Regulation" pot is the pull-up in this design and when adjusted to zero grounds the driver. Just does not feel clean.

Still working this design. It may be that a pull-up and a low pass filter is needed on the "IN" to isolate the DC and the series resistor is unneeded. This would need testing.

Open Drain Design

"FIRE" with Open Drain

In this configuration the open drain and a correctly sized pull-up is connected to the +K which is the signal used to turn on the laser with the "Test Switch". The PWM would need ground to be the full power level, since the open drain inverts the PWM signal no configuration changes are not necessary. With the right size pull-up the "Test Switch" can remain.

IN with open drain

In this configuration the open drain is connected to the IN port with or without the "Current Regulation" pot installed. The PWM would need 5 VDC to be the full power level, since the open drain inverts the PWM signal configuration changes are necessary.

Level Shifter (LS) Approach

We are going to connect the PWM signal to the LPS-IN or "FIRE" function for power control. The output coming from the Smoothie's PWM swings from 0-3.2VDC and the LPS-IN or "FIRE" expects a 0-5VDC swing to get to full laser power.
I decided to use one channel of a level shifter breakout from Adafruit. Yes it is overkill but even if you do build a equivalent shifter in discrete components it will require a breakout of some sort. The Adafruit breakout is just a few $.

4-channel I2C-safe Bi-directional Logic Level Converter - BSS138

LS connected to FIRE

In the type A case the output of the level shifter is connected to the +K or "FIRE" function with or without the "Test" switch installed. which is the signal used to turn on the laser with the "Test Switch". The PWM would need to be ground true so the PWM would need to be inverted in the configuration.
In the type B case the TH input could be used and no inversion or configuration changes are necessary.

TODO: need to evaluate the impact of grounding the output of the LS when "Test" switch pushed.

LS connected to IN:
In this configuration the output of the level shifter is connected to the IN port with or without the "Current Regulation" pot installed. The PWM would need 5 VDC to be the full power level, since the LS does not invert the PWM no PEM configuration changes are necessary.
TODO: evaluate methods for DC isolation of PWM and pots dc offset.

Level Shifter

The level shifter design is shown below including a model of the input to the LPS. Ideally this would be on the middleman or built into a smoothie version.

Level shifter breakout and LPS input model

Smoothie PWM characteristics and configuration:

See this configuration file for duty cycle and frequency settings:

# Laser module configuration
laser_module_enable                          true             # Whether to activate the laser module at all. All configuration is 
                                                              # ignored if false.
laser_module_pin                             2.5              # this pin will be PWMed to control the laser. Only P2.0 - P2.5 
                                                              # can be used since laser requires hardware PWM
#laser_module_max_power                       0.8             # this is the maximum duty cycle that will be applied to the laser
#laser_module_tickle_power                    0.0             # this duty cycle will be used for travel moves to keep the laser 
                                                              # active without actually burning
#laser_module_pwm_period                      20              # this sets the pwm frequency as the period in microseconds

Smoothie configuration for open drain

The open drain will invert the PWM signal from the Smoothie therefore the configuration file would have to change the output polarity by appending <<!>> to the pins definition.
Smoothie pin Invert parameter.

TODO: PUT FINAL SMOOTHIE CONFIGURATION FILE HERE

Parked: header file for laser control. Come back later and explain.

Smoothie control of Laser

Link to additional discussion regarding controlling of laser with two control pins:

PWM frequency

Note that the period in the above configuration file is 20 us (.000020 sec). 
That is a frequency of 1/.000002 = 50,000 cps or 50 KHZ

Design problems?

Looking at the model of the input to the right of the picture reveals a few situations that I need to investigate. When the pot is turned all the way down it will essentially be shorting the level shifter to ground. Will this cause enough current draw to burn out the BSS138, who's max current is 220 ma? 

I also wonder how the changing DC offset + PWM will effect the integrated IN signal. It may be necessary to remove the level shifters output pull-up (it is in parallel with the pot) and add a series resistor to the output.

At this point this is all untested......
After building a test set up I will test for these cases and report here.

Design Musings

Something about using the "Current Regulation" pot as the pullup in the open drain configuration still bothers me. Theoretically this will adjust the max voltage the PWM pulse can achieve giving the effect of a lower power offset. I can't decide if this is a cleaver approach or a ugly hack that will come and bite me later.

Seems like the "right" approach is to insert a PWM to voltage converter. Then again, in its simple form is just a low pass filter anyway, which is what we are expecting is on the input of the LPS.

I would still like to isolate the PWM from DC offsets created by the Current Regulation pot.

I like the open drain approach the best as it is simple and eliminates the LS breakout. 

Enjoy, and leave comments. 
Maker Don.