38. Arduino for Production! AVR - Controlling a Hobby Servo Using the Internal PWM

preview_player
Показать описание
Purchase my new book: Arm Microcontroller Programming and Circuit Building Volume 1

Please watch: "Buildyourcnc CNC Router on Love Yurts"
Patrick's Tip Jar:
bitcoin:1Gtawd29Sgu5CdvfUnkRg1YBfowCawjFdH
Ether:0xa962365100011B79097A7bb9DD51A53eE98266bb
If you have found this video to be helpful, consider making a tip. Thanks.
In this video, I control a hobby servo using the internal PWM (Pulse Width Modulation) feature of the AVR Atmega32 (atmega324 specifically).

This tutorial will work with all analog servos that accept a PWM signal. Hobby servos that are generally in this realm are Hitec Servos, Futaba servos, Parallax servos, and many other analog hobby servos.

●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●

Equipment that I use to make videos:

Рекомендации по теме
Комментарии
Автор

you know you are just so excellent.. I m new to avr programming and know just a little about programming and hardware controls till now. I tried to learn on my own few things to create a robotic arm as my college project, , the servos were first a mess for me but now i got all my answers at a single place for servo control... thankyouu !!!!

vkapoor
Автор

not even being funny, finally someone who explains... the best tutorial I could find on this

izaih
Автор

Very good for knowledge recycling after more than 3 years without touching an Atmel uC! Thank you and keep it up!

ruijorgemoreno
Автор

I'm just getting started with programming microcontrollers, and your videos are exactly what I needed!  Thank you!

FishKungfu
Автор

The stepping motor is a motor that essentially acts on pulses and turns relatively precisely achieving a desired rotation angle. Standard stepping motors will rotate at 1.8 degrees per pulse (after going through a translation process to provide proper coil firing). So, if say 10 pulses were sent to the driver/stepping motor, the shaft would rotate to 18 degrees. 200 pulses would give a full rotation of the shaft. These motors are used where precise control is needed.

PatrickHoodDaniel
Автор

The amps are going to be drawn from the controller and other components that are connected to the controller. You would need to determine what your amp draw will be when you are designing the circuit and provide the supply that will allow that level of current. For #2, use a level shifter for that application.

PatrickHoodDaniel
Автор

Hi Patrick!
I think you can even make a death star with the talent of writing reversely. Keep up good work!!

UtkuDemir
Автор

Great video,
you are a great teacher thanks

amikhimji
Автор

Sounds good, looking forward for the tutorial, but you could also show how to use one Dual potentiometer to control two servo at the same time

munot
Автор

Thanks for a nice job. I find your videos very helpfull and clear. At the Timeline 8:37 and 9:00 you mention the output pin(19) as OCR1A( which is not an output PIN) !? I think you mean OC1A or I am misundestanding something?

Mehrani
Автор

Sure, that sounds like a really fun and easy tutorial. I will do that next since it is a quick one.

PatrickHoodDaniel
Автор

Sure, this is a good example of the multiple channel ADC and PWM out. I will get on it.

PatrickHoodDaniel
Автор

I wish I had superb handwriting like yours.

fantomu
Автор

@TheMasterAbdul Good tip. I have been purposefully staying away from that method as I wanted to drill the shifting operators solidly before introducing this method. I will add this in the tutorials a bit later. Thanks greatly for this comment!!

PatrickHoodDaniel
Автор

Got an A on my subject of microcontroller programming, partially thanks to this !

ghennadiemazin
Автор

Thank you so much!
It works perfectly in the ATMega328P (are the same registers) :D

franciscojavierfrancobelen
Автор

Hi,

great video. But can you please explain the the 800 and the 2100 at the end of the video? 1)What does that mean? Are they suppose to mean the angle at which the Servo turns?
2) Why do they turn in the opposite way?
3) Normally a Servo allows only 1000-2000, but the value you give is out of range.

Sorry, i am a beginner.

chelvis
Автор

Hello, thank you for your videos, i have a question, the 50 Hz is the Signal frequency or the pwm frequency

ahmedladhibi
Автор

Hi, how do u check for 1Mhz per period in the data sheet ? Like which section. Sorry to ask a qns like this as I’m new to this. Hehe.

lingserene
Автор

nice tutorial, this is very much helpful  to all the avr begineers, great.!!  and language also understandble..

bmuruganmurugan
join shbcf.ru