Page 1 sur 1

Laser problems

Posté : 20 févr. 2021 14:24
par jodougie2812
Hello. I don't know if I'm in the correct place on this forum but I need help with the laser on my RCNC32
I've mounted at 15 watt laser and connected it to the board. Following the instructions on the firmware section.
The laser works but in the negative..
When I switch on it immediately lights up at full power.
Using LaserGRBL to burn a test diagram. The laser switches on and off but is on when it should be off..... and off when it should be on. Burning the background instead of the lines.
I hope that makes sense......
Is there a setting I need to change in GRBL. I have loaded the latest version of the firmware onto the card
Any help appreciated

Re: Laser problems

Posté : 20 févr. 2021 15:06
par HTheatre
Hi jodougie2812,

Yes, you have to take a look in GRB where the PWM signal have to be inverted.
The only way to check and modify it, if necessary, is to flash again the STM-32. I updated the assembly manual for that.
Take a look at the submanual dedicated to the STM-32 programming à the end of the assembly manual (link in my sign).

Moreover, if you reflash the STM-32 with the last firmware of the STM-32 available on the mstrens' GitHub page, do not forget to activate the laser mode before reflashing or connecting to GRBL via USB (in this case the command to send to GRBL will be $32=1)

See ya,

Re: Laser problems

Posté : 20 févr. 2021 18:31
par jodougie2812
Thanks. I will have a look.. im not sure how to invert the PWM . Hopefully it may become clear when I take a look tomorrow
Thanks

Re: Laser problems

Posté : 21 févr. 2021 15:09
par jodougie2812
Hello again.
I've looked at the GRBL using Antonio and am completely confused.
Can you give me an idea as to what I should be looking for.
Where I should find it and
What I should change it to.
Any help is appreciated. I think my brain may be too old for this steep learning curve
Thanks

Re: Laser problems

Posté : 21 févr. 2021 17:40
par mstrens
In the config.h file from the STM32 you have those lines:
// added by MS in order to allow to invert the PWM signal
// uncomment to invert PWM signal (it is implemented only for STM32F103 board.
#define INVERT_SPINDLE_PWM

Re: Laser problems

Posté : 22 févr. 2021 09:27
par jodougie2812
Wow this is difficult
I followed the instructions. Using Attolic True Studio.
I open config.h and remove the # from the #define INVERT_SPINDLE_PWM command
I then rebuild the project and it generates 2 errors

expected '=', ',', ';', 'asm' or '__attribute__' before 'uint8_t' in nuts_bolts.h and
unknown type name 'define' on line280
If i put the # back in front everything builds successfully.
Help please :)

Re: Laser problems

Posté : 22 févr. 2021 10:06
par mstrens
In fact you do not have to remove the #.

When you have
#define INVERT_SPINDLE_PWM
then the signal is inverted

In order NOT to invert it, you must have (adding // in front)
//#define INVERT_SPINDLE_PWM

Depending on your laser you need the one or the other.
So try with one, and if the signal is inverted, try the other one

Re: Laser problems

Posté : 22 févr. 2021 10:27
par jodougie2812
thanks i will give it a go

Re: Laser problems

Posté : 22 févr. 2021 19:47
par jodougie2812
Thanks. That worked.