I successfully set up an SKR 1.3 board to operate my K40 with Smoothieware running on it. Its been a while ago so this documentation may not be perfect.
The first thing you need to do is to get the latest version of smoothieware here.
Rename it to firmware.bin and upload that on your SKR board with either the USB cable or the SD-Card.
To control the laser with the SKR board we need to connect two inputs of the laser PSU to free pins on the SKR board: the laser enable and the laser pwm input.
(The laser enable pin can be attached to any free GPIO. The laser PWM pin can only be attached to PWM capable pins. On the SKR1.3 these are P2.0 - P2.5, P1.18, P1.20, P1.21, P1.23, P1.24, P1.26, P3.25 and P3.26. The microcontroller of the SKR1.3 only outputs 3.3V on the GPIO’s thats why we need a logic level shifter module like the one from Sparkfun. This is important only for laser enable. 3.3V turned out to be fine for the PWM Signal, so I did not level convert that signal.)
The following diagram shows how I connected everything. (I used images from Sparkfun and Duet3D forum user hector, so credits go out to them.)
(Right-click -> view image to enlarge the picture)
I used Pin 3.25 as PWM pin and 2.0 as laser enable pin. My config file can be found here. Upload that to the SKR and reset it.
Now connect the motors. I don’t use endstops on my K40 because I broke the flat cable connecting them. If you want to use your endstops make sure to connect them on a free pin and assign them in the config according to the pinout provided. Also I don’t have my flat band cable anymore so I just use a regular stepper motor connecting cable. The motors can be plugged into the skr board without any modifcations.
If you have the flat cable DONT try to solder on the pins. This is how I destroyed mine. Use the middleman board (google it) instead.
When everything is connected the next thing we wanna do is set up the power levels for our laser. In config.txt there are a few parameters that should be adjusted to your laser. These are maximum_power, laser_module_minimum_power and laser_module_default_power.
In our terminal, we can set up the current power level with the command “fire 10” for example. This means that our PWM Signal has a 10% duty cycle and can be understood as percentage of the maximum power level (that destroys our K40 laser tubes so never use fire 100). The fire command doesn’t acually fire our laser, you still need to push your fire button to see what the command did.
Now, start with fire 10 and push your fire button to see if the laser fires. If it doesn’t send fire 20 to the SKR and try again. What you now need to test out is when you laser begins to burn something. Remember the “fire”-value then. Next carefully raise the power level to find the level, where your tube draws the maximum allowed current of 18 mA. I suggest to stop at 15 mA to give the tube some extra life. Remember that value as well.
Now you need to put these values in you config. If your laser started firing at fire 16 you set up the value of laser_module_minimum_power to 0.16. If your laser drew 15mA at fire 55 then set maximum_power to 0.55. The parameter laser_module_default_power is the power set up when you turn on the device and push the fire button without setting anything up.
When you set your power level in LightBurn it now assigns 1% power to 100% power between these set up boundaries.
Lastly you can burn some test lines and measure them to calibrate your steps in the config. Smoothieware describes x-axis as alpha, y-axis as beta and z-axis as gamma that may be a bit confusing when you see the config for the first time.
Thats it. Now you have a Smoothieware powered K40 controlled by a SKR board.