Anyone successfully get PWM laser support for STM32 going?
July 31, 2024 06:26PM
I have a target platform using an STM32F407 that I'm working on getting laser (with PWM) going, but before I start chasing issues too deep into the firmware I thought I'd check to see if anyone has already done the work?

I saw mention in the source that PWM frequency setting was only supported on the LPC and ESP32 targets (for 32-bit CPUs), but it looked like the STM32 branch did have some PWM plumbing in it. Anyone know for sure if STM32 PWM can indeed work with the M3-4-5 commands as-is? (I'm not clear if the comment means that just setting the PWM *frequency* isn't supported in the STM32 HAL or if PWM *in general* isn't working?)

When I enable the laser #defines I get a working laser enable signal, but the PWM output just goes high and then turns off one second later (as a result of the LASER_SAFETY_TIMEOUT_MS threshold triggering-- which seems odd since the platform *is* moving at the time)...

Thanks for any wisdom/experience you might be able to offer!

Edited 1 time(s). Last edit at 07/31/2024 06:27PM by havok1919.
VDX
Re: Anyone successfully get PWM laser support for STM32 going?
August 01, 2024 02:10AM
... if it's a firmware for 3D-printing, then you have another option, what's maybe even better -- for controlling lasers with Pronterface and Marlin4Due I'm using the extruder step signal to generate "speed independant" laser pulses - with this I'll get constant and pretty precise "pulses per mm", so regardless, how slow/fast its moving, the averaged power per mm is the same winking smiley

For another solution with a STM32F4discovery board I'm using a CNC-software/firmware combo (Editask/Mtask) - here the programmer included a special I/O-pin and driver modi to synchrinize the laser-pulses to the motion (otherwise it would be delayed in the look-ahead buffer output).

Edited 1 time(s). Last edit at 08/01/2024 02:12AM by VDX.


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Sorry, only registered users may post in this forum.

Click here to login