Speed control of DC motor using PIC microcontroller part 1

Why we need to control speed of dc motor:

There are many application of DC motors, where we need a variable speed of DC motor. For example DC motor have a applications in electrics cars, trucks and aircraft.These are three examples where we need variable speed of DC motor. Although now a days AC motors have more use in market for variable speed application over DC motor due to enhancement in power electronics and solid state electronics.But DC motors ares till used today in many applications for variable speed.

Types of DC motors:

According to armature and field current circuit configuration there are five types of DC motor:

  • DC motor with separate excitation
  • DC motors with shunt
  • Series DC motors
  • Compound DC motors
  • DC motors with excitation from permanent magnet

The speed of separately excited DC motor and DC shunt motor  can be made variable by changing terminal voltage and by changing the armature resistance. The speed of DC series motor and permanent magnet DC motor can only be changed by changing armature terminal voltage.While Compound  DC motor have both characteristics of DC series motor and DC shunt motor.

So there is one thing common in all types of DC motors. Speed control by changing armature terminal voltage is same in all types of DC motors.Now to make this project you have to learn a method through which we can apply variable DC voltage to armature of any DC motor so that we can control speed of DC motor according to our requirement.

Methods to generate variable voltage:

  • Variable power supply
  • Pulse width modulation technique

In variable power supply there are some limitation but still speed of  very small power DC motors can be controlled by making a variable power supply with the help of  voltage regulators which are used to generate variable voltage with in a specified limit provided by manufacturer.There are many voltage regulators in market.But there will be issue of power rating of DC motor. Because power supplies which make with such voltage regulators have not too much high power handling capability and power supply is main source of power to DC motor. Therefore this method is not practically feasible and recommended.

Second method, pulse width modulation is the best method to control DC voltage applied to terminal of armature.In pulse width modulation we actually control switching duty cycle, which is the ratio of on time to the total time of switching.

Pulse width modulation:

This is a method to control the output voltage with the of constant frequency switching and by adjusting on duration of switching and in other words by changing duty cycle of switching.

                                    Constant switching time period = on time + off time                                                                                 Duty Cycle = on time / on time + off time %

Duty cycle can not be greater than 1 or 100%. Because on time will always be less than total timer period of switching frequency .The relationship of input-output voltage and duty cycle is

                                                output voltage =  duty cycle * input voltage

Hence output voltage and duty cycle is directly related with each other but their output also depend on switching frequency of switch. What is a switch here.I will discuss it later.

Different Pulse width modulation having different duty cycles
Different Pulse width modulation having different duty cycles

In above picture there are four PWM having different duty cycle.So we need to change duty cycle according to requirement of output voltage.But output voltage can never be greater than input voltage. But now the question which into mind. how to generate PWM and how to use PWM for variable output voltage generation.

 PWM Generation Methods:

There are two ways to generate pulse width modulation with variable duty cycle:

  1. Using analog electronics ( operational amplifier , comparator and saw tooth wave etc)
  2. Using digital electronics  ( microcontrollers and dedicated PWM controllers IC’s )

I will not discuss first method in this article. but in future I will write a complete post on Pulse width modulator using analog electronics. But those who don’t know about programming and micrcoontrollers can use analog electronics method for this purpose.

Circuit Diagram:

To control DC motor speed with  PIC microcontroller , you should know how to generate PWM using PIC microcontroller and how to use analog channel of PIC micrcontrollerto to read  analog Voltage.If you don’t know about these topics. Kindly visit following link to get the understanding of PIC microcontrollers and their programming.

PIC microcontrollers tutorials

I will cover circuit diagram and programming portion in next tutorial: Speed control of DC motor using PIC microcontroller part 2.

check this article to know further about DC motor speed control. This article contain circuit diagram and coding :

Speed control of DC motor using pic micrcontroller part 2

keep visiting our website for more info

2 thoughts on “Speed control of DC motor using PIC microcontroller part 1”

  1. Hi Bilal
    I am currently in the process of developing a prototype for a drone with special features
    Can we talk by phone
    Los Angeles

  2. I am doing project of final year and my project topic is paper recycling machine and i am using 8dc motor then please guide me to interfacing all motor

Leave a Comment