aryo
Hi everyone,
I am currently working on a project using an ESP32 as a PLC via the OpenPLC runtime. My goal is to control a standard servo motor using the Analog Output (%QW) from my Ladder Diagram, which requires a precise 50Hz PWM signal.
However, I understand that the default PWM frequency in the OpenPLC ESP32 firmware is fixed at 1000Hz (which is fine for standard DC motors/LEDs, but makes servos jitter and overheat). I've been told that I need to modify the underlying hardware abstraction layer (C++ core files) and adjust parameters like ledcSetup before compiling the runtime.
Has anyone here successfully modified the OpenPLC core to change the PWM frequency to 50Hz for specific pins?
  • Which exact files in the OpenPLC directory do I need to tweak?
  • Are there any easier workarounds to achieve this within the OpenPLC ecosystem without breaking the compiler?
Any guidance or documentation points would be highly appreciated. Thanks in advance!
Reply 0 0
thiagoralves
Hello,
The OpenPLC forum has a new home: https://edge.autonomylogic.com . We migrated every member, profiles, topics, categories and attachments. Please redo your post on the new forum so we can continue our conversation.
Note: If you already have an Autonomy Edge account, you can simply login with your credentials to have access to your forum profile and posts. If you don't have an Autonomy Edge account, we ask you to set a fresh password on first sign-in using the same e-mail you used on this forum.
To set a fresh password, access the link https://edge.autonomylogic.com/forgot-password and insert the e-mail address used on this forum. You will receive an e-mail on your inbox with a link to choose a new password. Once you reset your password you will be able to login on https://edge.autonomylogic.com  using your new credentials.
Reply 1 0
Reply