SKR turbo 1.4 Laser PWM problem

Hi, i have a mpcnc and was trying to install a 3 pin pwm laser on it. I’m using marlin 2.1.x and i used the 2.0 pin for the laser PWM and the 4.29 pin for the Enable. everything seem to work fine but the pwm.
When i tried to do a 50ms pulse i got the following result :


the Enable pulse was about 50ms but the pwm wasn’t working.
Here are the config files (Pastebin):
config.h : 2F0yYF5S
config_adv.h :LxGM96tG
Can someone help me please ?

Your pastebin links aren’t links. Which board are you using? (is the 2.0 pin PWM capable?) How did you set about creating the PWM pulse train (what commands did you issue)?

I couldn’t add link to the post so i added the id to the config files.I used the pulse option on the lcd menu to generate this pulse and where can i find if the pin is PWM capable ?

thanks for your help, i didn’t think the lcd menu button were at fault but when i tried sending “M4 O204” i got a much better result :


I think it might be due to a warning i got while compiling but i ignored it because it was a part of the code that i don’t understand and didn’t modify :

Marlin\src\lcd\menu\menu_spindle_laser.cpp:82:99: warning: unsigned conversion from 'int' to 'TMenuEditItem<MenuEditItemInfo_uint16_5>::type_t' {aka 'short unsigned int'} changes value from '80000' to '14464' [-Woverflow]
   82 |         EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 80000, cutter.refresh_frequency);

do you think it’s causing the problem and if yes do you know how it can be fixed.
i feel so dumb that i didn’t even think to send a command manually.
Have a nice day :slight_smile:

That function takes an unsigned short int. That type can only support values between 0 and 65535. When you put in 80,000, it makes it fit by rolling it over to 14464.

I’m not sure what that function does, but if you change that 80000 to 65535, the warning wil go away and the max value 65535 will be used instead of 14k.

So i tried to change to 65535 but the lcd control still doesn’t work

I’m not sure what is going on with that. I was just trying to help you with your C++ warning :slight_smile:

Thanks anyway, now i think i can use it so the lcd control not working isn’t such a big deal. Have a nice day :smiley:

1 Like

Generally info like that is available in the specs for the MCU of your controller card, which is why I asked which controller you were using. Once you know the MCU you can ask google!

Glad you got it working! I guess your logic analyser ‘pulse’ icon did exactly that… it gave you a pulse. :slight_smile: