PWM Duty cycle not correct #472

Open
opened 2022-01-19 22:44:12 +00:00 by Zounich · 1 comment
Zounich commented 2022-01-19 22:44:12 +00:00 (Migrated from github.com)

Hi vitormhenrique,

I am using octoprint on a Raspberry PI 2B.
With GPIO 23 I control a lamp via pwm.

image

After I have saved the configuration, I can dim the lamp.
However, I have 2 problems:

1: If I set 10% in the enclosure plugin, I get 16% on the GPIO.

2: The PWM signal is interrupted and for a few ms. the GPO spent 100%.

Here is the log:

2022-01-19 23:36:18,994 - octoprint.plugins.enclosure - INFO - Setting GPIO mode to BCM
2022-01-19 23:36:18,996 - octoprint.plugins.enclosure - INFO - Setting GPIO pin 13 as PWM
2022-01-19 23:36:18,998 - octoprint.plugins.enclosure - INFO - starting PWM on pin 13

When I check the GPIO configuration, GPIO 23 shows as OUT and not ALT0.

image

If I configure PWM via the terminal and control it there, it works without errors.

Do you have an idea where the cause for this could be?

Best Regards
Zounich

Hi vitormhenrique, I am using octoprint on a Raspberry PI 2B. With GPIO 23 I control a lamp via pwm. ![image](https://user-images.githubusercontent.com/97953026/150222689-7299661b-4c57-4608-83d6-d8d3198a39a8.png) After I have saved the configuration, I can dim the lamp. However, I have 2 problems: 1: If I set 10% in the enclosure plugin, I get 16% on the GPIO. 2: The PWM signal is interrupted and for a few ms. the GPO spent 100%. Here is the log: 2022-01-19 23:36:18,994 - octoprint.plugins.enclosure - INFO - Setting GPIO mode to BCM 2022-01-19 23:36:18,996 - octoprint.plugins.enclosure - INFO - Setting GPIO pin 13 as PWM 2022-01-19 23:36:18,998 - octoprint.plugins.enclosure - INFO - starting PWM on pin 13 When I check the GPIO configuration, GPIO 23 shows as OUT and not ALT0. ![image](https://user-images.githubusercontent.com/97953026/150229945-7cd07491-ec00-4e74-8682-0a9d6a18922b.png) If I configure PWM via the terminal and control it there, it works without errors. Do you have an idea where the cause for this could be? Best Regards Zounich
vitormhenrique commented 2022-02-28 17:40:01 +00:00 (Migrated from github.com)

I have no clue what is going on. I use python libraries, so if you create scripts on python with the same libraries do the error still happens?
I'm guessing those are erros on the libraries.

I have no clue what is going on. I use python libraries, so if you create scripts on python with the same libraries do the error still happens? I'm guessing those are erros on the libraries.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#472