Archive

Posts Tagged ‘Motor’

Speed Control of a DC motor using PWM.

December 19th, 2008

My sojourn of the AVR world is proving to be a worthwhile venture. I must admit architecture-wise, things are a bit more complicated on the AVR than on the stock 8051. However that initial learning curve is easily offset by the ease of using C as a programming language. And not to mention the euphoric sensation of using the gnu tool chain over Linux to create my stuff.

I thought the best way would be to learn each subsystem of the AVR ATMega32 in turn. So this week, I chose the Timer/Counter sub-system. And so here I am demonstrating Pulse Width Modulation (PWM) on the AVR which makes use of the underlying timer/counter system to generate a PWM output on one of its port pins.

I am not going to describe PWM here, as Wikipedia has a very good article on the same. Also, if you find the Wikipedia article mathematically daunting, you may read this alternative article here.

This demo is relatively simple and does not involve hours of soldering or anything. If there was anything that I had to devote time to, then it was the official ATMega32 datasheet. But it needs a lot of guts to even try to understand the terse(but correct) language of these datasheets. Something like legal-speak, every word has its own technical meaning and cannot be substituted by another word even if they are synonyms in the ‘normal’ english sense. So I spent about half a day getting familiar with the ins and outs of the AVR and finally sometime late in the night, I came up with this contraption for the demo.

Here is a small video of my demo. Do leave in your comments afterwards. And don’t forget to stay tuned for more upcoming AVR stuff !

seemanta Embedded Hobbyist, My Creations, Tech , , ,