Skip to content

[BUG] Laser PWM control does not work with SKR Mini E3 V2 at all #26293

Open
@HeartOfGermany

Description

@HeartOfGermany

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

I tried both Marlin 2.1.2.1 and Marlin 2.1.x-bugfix. I have set the Platform IO version to the latest (V3.3.1), latest Autobuild Marlin.

I have defined PA1 as Laser PWM pin. However the pin state always is at 3.3V, no matter what the input state is (S0-S255). I have also deactivated M106 printing to ensure there is no conflict. I changed PA1 to 1 to avoid conflicts with the Pin Macro.

Manually setting the Pin using M42 results in an ANALOG output voltage. So M42 shows, that the Pin can do more than 0 and 1. It is officially a PWM pin, both according to PIO and the PDF of the STM32F103RE. I am not sure, why the pin is in an analog state and not outputting PWM, but at least M42 with overriding Firmware procetion is able to do more than 0 and 1 state.

M42 is not acceptable for laser engraving, as it has unpredictable delay. Trust me, I tried with chopping each travel move in 0.05mm steps and still the timing is not perfect and always delayed by around 1 cm travel move. What I need is a working inline mode.

I attached the configuration files:
Configuration_adv.txt
Configuration.txt

Please ignore the Temp Max which is strange - I adjusted thermistor_1.h to work with 400°C

Please note, that the configuration is supposed to work as 3D printer AND Laser engraver, so deactivating printer stuff is no solution unfortunately - and not a fix aswell.

My goal is, to print with LaserGRBL - with no modification to the gcode, if possible

Bug Timeline

All tested Marlin 2 versions so far - with 2.0.9 and old PIO not even M42 worked for Analog DC output

Expected behavior

  • M42 correctly sets a DC voltage representing the PWM input
  • G0 S127 sets pin PA1/ Pin 1 to PWM 50/50 or Analog 50/50 -> Both works for me.
  • M4 I S127 sets pin PA1/ Pin 1 to PWM 50/50 or Analog 50/50 -> Both works for me.

Actual behavior

  • M42 correctly sets a DC voltage representing the PWM input (DC and not PWM is still strange!)
  • G0 S127 sets pin PA1/ Pin 1 to 3.3VDC
  • M4 I S127 sets pin PA1/ Pin 1 to 3.3VDC

Steps to Reproduce

  • Use my configuration with latest marlin bugfix or marlin 2.1.2.1 (downgrading a ton of definition is required, as almost all definitions changed the names for some strange reason)
  • Quickly hack a thermistor_1.h with 400°C support to get no compile error
  • Compile using Visual Studio Code, latest Auto Build Marlin, Platform IO
  • Select STM32F103RE_btt for reference
  • Open pins_BTT_SKR_MINI_E3_common.h and comment out PA1 assignments

Version of Marlin Firmware

Marlin 2.1.2.1 AND current Bugfix

Printer model

Ender 3 basis, highly modified

Electronics

SKR Mini E3 V2

Add-ons

DC to PWM converter, as PA1 only outputs analog DC from 0-3.3V - I never saw any PWM signals

Bed Leveling

MBL Manual Bed Leveling

Your Slicer

Other (explain below)

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions