Questions tagged [pwm]

Pulse-Width Modulation (PWM) is a technique used for controlling the power given to electrical devices. The average power supplied is controlled by rapidly turning the supply on and off. Questions here concern driving PWM outputs from the Raspberry Pi.

Filter by
Sorted by
Tagged with
-1
votes
1answer
37 views

Using a piezo to mimic human speech [closed]

note- i only have the speaker tag because there's no piezo or buzzer tag I want to use a piezo element to mimic human speech. I've already succeeded in playing piano notes with it, and am looking to ...
0
votes
1answer
27 views

What values for PWM to set intensity from 0 to 255?

I am using hw-479 that looks like the picture below. I cannot find much of information for it but the Alibaba page says The RGB LED module is made of a plug-in full-color LED. The PWM voltage input ...
1
vote
0answers
40 views

Powering a Servo with 12V Battery and Buck Converter

I wanna power my servo with the 12V terminal of a Mastercraft Nautilus battery pack (see here)(long story). The servo is a actuonix pq-12 micro linear servo (see here). I'm stepping the voltage down ...
0
votes
1answer
33 views

Controlling LED using PWM

When I run this code I’m expecting to get a led that brightens but I get a led that dims. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) dc=0 LED=GPIO.PWM(11,...
1
vote
0answers
30 views

When i change the dutycycle on my PWM it doesnt move my servo

I am using an SG90 and the GPIO Pin #17 but it only sometimes turns when I run the code. It always works if I reset the Kernel everytime. I am connected to my Pi through putty and am running the code ...
0
votes
2answers
118 views

PWM issues with pigpio and RPi.GPIO

I am using Pi Zero W with latest Raspberry Pi OS. I have a backlight of an LCD that I am trying to control via PWM. If I use RPi.GPIO I get flicker at anything other that 100% (or 0%) duty cycle. As ...
0
votes
0answers
29 views

Raspberry Pi3 - Controlling 4 DC motors

I need to feed 4 DC motors of 5V on my Raspberry Pi 3 Model B using PWM (Pulse Width Modulation). Currently, I have the next components: 2 NPM transistors, 1 L293D integrated circuit, resistors (220 ...
1
vote
0answers
82 views

Rpi python with a PCA9685 PWM controller stopping a digital servo motor problem

I have several servos plugged into a PCA9685 board and controlling them with PCA9685.py, and at the end of the script at pwm.cancel() my SF3218MG (270 degree) and 6221MG (180 degree) servos turn off ...
0
votes
1answer
38 views

PWM problem in a frequency less than 100Hz

I have attached a fan to pin #17 (through a transistor of course) and am writing a script to turn the fan on for a specified duration with a specified PWM duty. #!/usr/bin/env python import os ...
0
votes
1answer
43 views

Issues with Throttle Control on ESC with RPi 3B+

I am using the 30A BLDC ESC to control a brushless motor from my Raspberry Pi 3 B+. The documentation for the ESC can be found here: ESC pdf I seem to have successfully calibrated the ESC, but after ...
0
votes
0answers
24 views

Is it possible to write a stream of data to /sys/class/pwm/pwmchip0/pwm0/duty_cycle?

Can anyone tell me if it's possible to write a stream of data to /sys/class/pwm/pwmchip0/pwm0/duty_cycle ? I want to set the duty cycle of each individual pulse. That is, for example, I may want to ...
0
votes
0answers
34 views

Unexpected behavior with pigpiod after long runtime

for a few months I use python3 with pigpiod (version 71) at Raspberry Pi 3B+ to control some actuators (on/off) and LEDs (on/off/PWM). My dimming algorithm uses the command pi.set_PWM_dutycycle(pin, ...
0
votes
0answers
28 views

Need to control a simple RC car using my Pi. Can't I directly connect it to the Pi's GPIO pins?

I wanted to do a project where I can self drive my RC car using machine learning. However I have never used a Pi before and im not sure how to proceed. Here are the basics of what i have right now. ...
0
votes
0answers
44 views

Using pigpio and hardware PWM simultaneously

I am using pigpio to read 4 inputs. Everything works fine. And the entire process is a bit long and memory consuming. I also have to use one PWM output. I am planning to use the hardware PWM (pin 12 ...
1
vote
1answer
43 views

PWM not reaching desired frequency after checking on oscilloscope

I am attempting to setup a PWM signal on Pin 12 (GPIO #18) using a Raspberry Pi 3. I am capable of sending a PWM signal, however it is quite off from the target frequency. I have an o-scope that I ...
1
vote
0answers
90 views

pigpio hardware PWM for servos

My goal is to build a pan/tilt system. this works fine: import pigpio pi = pigpio.pi() pi.set_servo_pulsewidth(13,1055) 2 questions: is pi.set_servo_pulsewidth using hardware PWM (I prefer HW PWM) ...
1
vote
3answers
75 views

Can I reliably control four ESC with a servo driver board?

Im currently looking into building a quadcopter from scratch. The Raspberry Pi only has two PWM pins though, which isn't enough. And software PWM isn't great either, because you can't control a motor ...
1
vote
0answers
43 views

High-precision time-varying PWM outputs on R Pi

I'e seen a lot of examples of simple PWM on the Pi where relatively high-precision PWM signals at a fixed duty cycle can be generated using WiringPi or pigpio in hardware PWM mode. I have tried ...
2
votes
0answers
17 views

pwmWrite() dosen't run

else if(strcmp(hyp,"MEDIUM") == 0) { system("espeak 'medium'"); printf("%s\n", hyp); digitalWrite(LIGHT1, HIGH); pwmWrite (PWM_pin1, 524) ; } i try to control ...
1
vote
0answers
45 views

pigpio: Read PWM from RCcontroller then send to ESC via GPIO

Im trying to learn Python by combining my interest in designing an AWD radio controlled car (3D printed, Im decent with Fusion 360 too) with some smarts from Pi/Python to allow things like software ...
0
votes
1answer
61 views

Servo motor keep shaking while using software PWM to drive

Greet everyone, I am using JavaScript with pigpio to develop my learning project. How come my servo motor keeps shaking when I drive it by program PWM? codes are posted as follow: var servo1GPIO ...
3
votes
0answers
43 views

Is it possible to control servos in both directions on the RPi?

I have been working on controlling servos in one direction with PWM control via GPIO ports on my RPi 3. I've worked with motor controllers that use PWM before and it seems that I should be able to ...
1
vote
0answers
20 views

pigpio servo, stop command not reliable

import pigpio import math import RPi.GPIO as GPIO from gpiozero import Button import time GPIO_SERVO_PIN = 27 limit = 17 switch = Button(limit) GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN, ...
0
votes
0answers
29 views

Interrupt Servo once movement has initiated

I'm new to python and RPis. I'm building my own robot to learn. I manage to control my little robot and move it around, as well as moving the pan camera with my keyboard. While I was searching for a ...
1
vote
1answer
73 views

Control PWM duration with python

I need to control the PWM module on the raspberry pi. I’m now familiar with pigpio, and with hardware_PWM. However, I did not find anywhere where I can control the total duration of the PWM. Example: ...
2
votes
1answer
923 views

What is the relationship between angle and servo motor duty cycle? How do I implement this?

I am unsure of the relationship between duty cycle and angle. I see lots of tutorials online with many different equations to calculate duty cycle for a given angle. I have a 50Hz servo motor that ...
0
votes
0answers
95 views

Pigpio Hardware PWM callback is slow

I am trying to drive a servo motor with Raspberry pi. I have selected pigpio library to access GPIO. I need to send a specific number of pulses with a given frequency. But when I callback a function ...
2
votes
1answer
185 views

is it possible to get 12 bit(4096) resolution output from pi hardware pwm pin?

I want to produce 12 bit resolution from Pi hardware pwm pin for my project. Please help me to go in right way as I am new to both Python and Pi. import time import pigpio as pi import RPi.GPIO as g ...
0
votes
1answer
419 views

What is the proper calculation of duty cycle range for the sg90 servo?

In all specs of this servo that I can find there is a range of 1000-2000ms of duty cycle, for 50 Hz frequency, for the full range of motion. For example: http://m.zonesutech.com/Content/upload/...
0
votes
0answers
49 views

Voltage amplifier for pwm output

I am trying to use the PCA9685 to power a regular desktop pc cooler fan, the idea being to later be able to freely adjust the fan speed depending on the pwm set in the pwm driver.(similar to this) On ...
1
vote
0answers
246 views

Sine Triangular PWM using Raspberry Pi 4

I am new to Raspberry pi. I want to make sine triangular PWM which will control the H-bridge of the inverter. I generate sine wave (50 Hz)and triangular wave (1500 Hz) using python language and ...
0
votes
0answers
87 views

How do I setup the clock form pwm device tree overlay

I am trying to use pwm on GPIO pin 40 but I have been unsuccessful so far. I am using pwm as device tree overlay in my config.txt dtoverlay=pwm,pin=40 After that I tried performing the below actions ...
0
votes
1answer
84 views

How can you use pigpio to set a specific position for a continuous rotation servo?

Running my code with a normal 180 degree servo will move it to a user-specified angle and then hold it there. But when using a continuous rotation servo, it keeps rotating constantly for 500 <= ...
1
vote
3answers
118 views

Servo motor behaves odd

hello I Connected a servo motor to my Raspberry pi Zero W and used the example from raspberrypi.org: granpa scarer: Grandpa Scarer and the servo worked however after changing the value for: p....
0
votes
1answer
128 views

Using pigpios waves and audio output

I am using a Raspberry Pi 3 B+. I want to play audio through the 3.5mm jack and use PWM at the same time or successively to simulate a IR-Remote. I know that you can't use the hardware PWM while ...
2
votes
0answers
34 views

PWM on pump not working as expected

I am attempting to run a PWM on a pump using rpi.GPIO using the following code: def run_PWM_on_pump(): gpio.setmode(gpio.BOARD) gpio.setup(8, gpio.OUT) p = gpio.PWM(8, 0.5) #also works at ...
1
vote
1answer
402 views

How can Rpi4B python UART talk to XY PWM Signal Generators?

Currently I am trying to automate a coil winding machine using stepper motors. I wrote a Python code to send frequencies to the stepper motors. But for some reason, the frequencies produced by ...
3
votes
1answer
188 views

How to use Rpi GPIO to PWM adjust IR LEDs brightness?

I'm using this circuit for my project, which I referred from https://www.sparkfun.com/news/1396. I don't really understand how current works in GPIO pins, so the question is: instead of connecting ...
0
votes
1answer
555 views

How can I power a IR LED ring using GPIO port?

Okay so, I'm currently working on a final year project about vein visualization with Raspberry Pi 3 Model B+ and a NoIR camera V2. An infrared light source is required to capture clear vein image. I'...
2
votes
2answers
740 views

AC mains dimmer dimming 7W LED lamp problem (RpiZero + MPDM V4.1)

I'm trying to dim a 7W LED with a Raspberry Pi Zero for home automation. However it doesn't work as expected. I followed this tutorial : https://www.youtube.com/watch?v=wqY4-gHqvZI . I have the exact ...
1
vote
1answer
45 views

I2S 3W Class D Amplifier and 2.2“ SPI-Display (ILI9341) - GPIO 18 Problem

I want to connect the Adafruit I2S 3W Class D Amplifier Breakout Board and an 2.2" TFT Display (ILI9341) to a Raspberry Pi Zero. However, it seems that by default both components use the GPIO 18 (the ...
0
votes
0answers
206 views

Setting up the second PWM channel from kernel module not working on RPI 3 model B+

I'm trying to set up both PWM channels (PMW0 and PMW1) on my Raspberry Pi 3 Model B+ from my kernel module. I've successfully set up channel 0 with the desired frequency and variable duty cycle and I'...
1
vote
1answer
90 views

What is the frequency and cycle length of the pigpio library?

I've got a raspi 3b with an esc and a brushless motor attached. I can run the motor using pigpio the following commands: # First start the pigpio daemon sudo pigpiod # calibrate the esc pigs s 12 ...
0
votes
2answers
526 views

How to use Rpi python to read/write/convert, to/from Arduino PPM and PWM servo control signals?

I want to create a python equivalent of the RCPulseIn library for arduino that does all the same functions of the library. I have written up a code that has lots of errors, but has sort of a framework ...
1
vote
1answer
160 views

PIGPIO problem with delay on scripts

I am trying to run an old Raspberry Pi 2011.12 as a server to control a RGB LED strip. To this I am using PIGPIO since this is the best solution (RPi.GPIO is software based, which creates flickering). ...
3
votes
1answer
1k views

PWM on 5V GPIO pin

I have a 12V Noctua industrial fan (it's for a project, the amount of airflow is needed). The fan doesn't turn on by itself (with only 12V and GND connected), but it does turn on when I connect GPIO ...
1
vote
1answer
93 views

GPIO PWM. ESCs still run different after calibration

I’m putting a quadcopter together. I’m using a python script to calibrate the ESCs... they beep like a blinking led when I give them power. Then I run the calibrate script and they give me the proper ...
1
vote
0answers
61 views

Adafruit ServoHat importing PWM object

I am following the Adafruit page regarding the ServoHat for the Raspberry Pi. I am unclear what module to import to get the PWM class. This is the page about using the PWM class: https://learn....
1
vote
1answer
695 views

No module named 'adafruit_circuitpython_servokit' [closed]

I have a Adafruit PWM hat and I am trying to run play around with some servos. However, when I run this line: from adafruit_servokit import ServoKit It returns: No module named '...
0
votes
1answer
100 views

How to use at the same time 2 hardware pwm in wiringpi

I need help to configure 2 hardware PWM channels. I am developing device, and sometimes I will need active 2 PWM channels with different frequencies (frequencies is low: 410 and 580 Hz).I'm writing ...

1
2 3 4 5 6