Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 6628

PWM is a form of signal modulation that allows digital output to approximate an analog signal. Use this for questions about using the PWM pins (marked with ~).

1 vote
Accepted

how to change increase pwm frequency by changing resolution?

Here's code for timer 1 on a atmega32u tested in a Teensy 2.0: void setup() { // put your setup code here, to run once: // Timer 1 Fast PWM mode *toggling* OC1A at 50kHz with *two* OCR1A counts … The popular examples aim for a specific frequency with toggling, but often don't go into showing the PWM with the non-TOP OCRxx registers. …
Dave X's user avatar
  • 2,340
1 vote

RF24 + High speed pwd

The prescaler would be the same, and the timer controlled pins would be D11 and D3: //// pwm settings for 100kHz on Timer 2 //// Toggle OC2A/D11/PB3 at 50kHz, PWM OC2B/D3/PD3 at 100kHz: DDRB |= … PWM TCCR2A = bit(WGM21) | bit(WGM20) | bit(COM2B1) // PWM on OC2B | bit(COM2A0); // Toggle OC2A TCCR2B = bit(WGM22) | bit(CS20); // Set /1 prescaler OCR2A …
Dave X's user avatar
  • 2,340
2 votes
Accepted

Is there any realy working setup for multicopter with codes

I've not used the (unmaintained) code you reference, but if a PID is responding much too fast in a new system, cut the parameters down significantly, first focusing on P and later I. Turn off the D, …
Dave X's user avatar
  • 2,340
1 vote

PID control for Motor Speed control

Instead of thinking of the PID output as pid_speed, think of it as motor_power, and what the PI controller is doing is translating errors in rpm into a motor power setting. You are probably getting …
Dave X's user avatar
  • 2,340
0 votes

How can I convert PID correction values to an PWM brushless command?

You convert PID outputs to process outputs by selecting appropriate Kp, Ki, and Kd constants -- they translate the error components into a process output. For example, if you want 10 degrees of erro …
Dave X's user avatar
  • 2,340
7 votes

How to output a true analog voltage at output pin

And if you put the a capacitor between your resistor and ground, the RC circuit of the capacitor will smooth out the PWM into an analog voltage. …
Dave X's user avatar
  • 2,340