0% found this document useful (0 votes)
73 views19 pages

ECEL LAB#3 Angelada

The document discusses DC motors, including their basic components and operation. It describes how a DC motor converts electrical energy to mechanical energy using magnetic fields produced by current flowing through a stator and rotor. It then discusses different types of DC motors such as brushed DC motors, brushless DC motors, and permanent magnet DC motors. It also provides examples of common applications that use DC motors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views19 pages

ECEL LAB#3 Angelada

The document discusses DC motors, including their basic components and operation. It describes how a DC motor converts electrical energy to mechanical energy using magnetic fields produced by current flowing through a stator and rotor. It then discusses different types of DC motors such as brushed DC motors, brushless DC motors, and permanent magnet DC motors. It also provides examples of common applications that use DC motors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Aleha Marie R.

Angelada BSECE-4A

ECEL 12: Lab Experiment #3

Title: DC Motor Control System


I. Introduction and Basic Theory

A DC motor, also known as a direct current motor, is an


electrical machine that converts electrical energy into
mechanical energy by creating a direct current magnetic field.
A magnetic field is formed in the stator of a DC motor when it
is turned on. The field causes the rotor to rotate by attracting
and repelling magnets on the rotor. The commutator, which is
hooked to brushes connected to the power source, supplies
current to the motor's wire windings to keep the rotor turning.

One of the reasons DC motors are preferred over other types of motors
is their ability to precision control their speed, which is a necessity for
industrial machinery. DC motors are able to immediately start, stop, and
reverse—an essential factor for controlling the operation of production
equipment.

Types of DC Motors
Each type of DC motor has advantages that must be considered prior to purchase and use. Two of the most
significant advantages of DC motors over alternating current (AC) motors are their ease of installation and low
maintenance requirements.
The connections between the field winding and the armature distinguish DC motors from AC motors. Field windings
can be linked in series or parallel to the armature. The connection can be both parallel and sequential in various
instances.
DC motors are ubiquitous and have a wide range of uses. Every program has its own type. Brush or brushless DC
motors are available. Brushes drive the rotor in brush DC motors. A permanent magnet is used in a brushless DC
motor's rotor. Regardless of your requirement for DC motors, it's critical to grasp each type because they're used
in so many different applications.
DC Motors Types
Brushed DC Motor
A brush DC motor generates a magnetic field by passing
current via a commutator and brush linked to the rotor.
The stator is the container that houses the brush DC
motor's components as well as the magnetic field. Brushes
are constructed of carbon and can be stimulated singly or
simultaneously. A series-wound DC motor or a shunt
wound AC motor is formed by wrapping the coil on the
rotor in series or parallel.

The commutator is an electrical switch that reverses the


current between the rotor and the power supply. Reversing
the current direction creates a constant rotational torque.
Through a set of contact bars, the commutator's sections
are connected to the rotor's windings.
Separately excited, self-excited, and permanent magnet DC motors are the three most common types. The electric
field in the self-excited kind is generated by an electromagnet in the stator construction. A powerful magnet
produces the magnetic field of the permanent magnet type.

Self-excited DC motors are further divided into shunt, series, and compound. The compound excited type is
separated into cumulative and differential with short and long shunts in each type.

Separately Excited DC Motor


Separate electrical supplies are provided to the armature
and field windings in a separate stimulated DC motor. The
armature current and field current operations do not
interact with one another, yet the input power is the total
of their operations.

Permanent Magnet DC Motor


A powerful permanent magnet. The armature of a DC motor is wound, but there is no field winding. It has a
conventional armature with brushes and a commutator. Rare earth magnets like samarium cobalt and neodymium
iron boron are used.

Self-Excited DC Motor
In self-excited DC motors, the field and armature windings are connected and have a single supply source. The
connections are parallel or series with parallel made as shunt wound while the series version is series wound.

Shunt
The field and armature windings in a shunt wound DC motor are linked
parallel to each other. Instead of the opposite way around, the field winding
is exposed to terminal voltage. The speed of a Shunt DC motor remains
constant regardless of the mechanical load.
Series
A series motor is a universal motor since it can operate on both AC
and DC voltages. In spite of the voltage source, series motors always
rotate in the same direction. On a series DC motor, the field and
armature windings are connected in series to the power source.

Compound
The series and shunt field windings are used in a compound DC motor. The
shunting of the shunt field winding determines whether cumulative or
differential compound DC motors have long or short shunts. The flux in the
shunt fields assists the flux in the series field in cumulative DC motors.

Brushless DC Motor
A permanent magnet rotor and a coil wound stator are used in brushless DC motors. Brushes are not required with
this DC motor design. The benefit of a brushless DC motor is that it eliminates brush wear and tear because the
moving magnet produces very little heat.

How DC Motors Work


A DC motor works on the principle that putting a current-carrying wire in a magnetic field produces mechanical force.
They can be used interchangeably because DC motors and DC generators have the same architecture. Because the
speed and torque characteristics of a DC motor are superior to those of an AC motor, alternating current (AC) is
converted to DC for big electrical applications such as steel mills and electric trains. DC motors are just as popular as
three-phase induction motors in industrial applications.
Stator
The stator is the motor's stationary main body that offers support and protection. The armature or rotor is driven by
a rotating magnetic field created by the stator. The field windings and the electrical supply are housed in this static
section of an electric motor.

Shaft
The shaft, which is at the core of the motor, is rotated by the windings and commutator. To endure the loads of the
application, the shaft is made of a hardened metal, usually steel. The torque generated by the winding is transferred
to the stator-supported shaft.
Terminals
Positive and negative terminals are found on a DC motor. The motor rotates clockwise when the positive wire is
attached to the positive terminal. The terminals are linked to brushes and brush arms inside the back cover of an
electric motor and provide electricity to the motor.

Magnets
Permanent magnets are the magnets utilized in DC motors. This implies that their magnetic field is constantly active.
Magnets with opposite ends attract, while magnets with similar ends repel. A DC motor has two magnets around the
rotor so that a strong magnetic field travels through it.

Rotor
The rotor is the motor's dynamic component that generates mechanical rotations. The rotor, also known as the
armature, is made up of several disks that are separated by laminated sheets. Eddy currents exist, but they are much
smaller and do not affect the motor's operation.

Coil Windings
Because two coils tend to jam and halt the motor, DC motors must have at least three to assure smooth rotation. A
strong and intense magnetic field is created by coiling the wire. Each coil is offset by 120 degrees from the one before
it. The rotor's rotation grows smoother as more coils are put to it.

Brushes
A DC motor's brushes give power to the coils and are metal components that behave as springs. Brushes are pressed
against the commutator by their spring action. The brush arms hold them in place, and they are directly attached to
the terminals or electrical supply.

Commutator
Small copper plates are attached on the shaft and rotate as the shaft rotates, forming the commutator. The poles of
the power supply shift due to the spinning of the rotor. Each coil is connected to two commutator plates that are
electrically isolated yet linked via the coils.

Uses for DC Motors


Because DC motors offer a higher starting torque than induction motors, they are employed in a wide range of
applications. Brushed DC motors are small and efficient, and they provide exceptional rotational control. Brushless DC
motors have an extended life span due to the absence of brush wear. They are also simple to maintain and noiseless.
DC Motors Usages
▪ Diesel Electric Locomotives
▪ Electric Vehicles
▪ Cranes
▪ Conveyor Systems
▪ Ceiling Fans
▪ Pump Drives
▪ Elevators

L298N MOTOR DRIVER

This L298N Motor Driver Module is a high power motor driver module for driving DC and Stepper Motors. This module
consists of an L298 motor driver IC and a 78M05 5V regulator. L298N Module can control up to 4 DC motors, or 2 DC
motors with directional and speed control.
L298N Module Pinout Configuration

Pin Name Description

IN1 & IN2 Motor A input pins. Used to control the spinning direction of Motor A

IN3 & IN4 Motor B input pins. Used to control the spinning direction of Motor B

ENA Enables PWM signal for Motor A

ENB Enables PWM signal for Motor B

OUT1 & OUT2 Output pins of Motor A

OUT3 & OUT4 Output pins of Motor B

12V 12V input from DC power Source

5V Supplies power for the switching logic circuitry inside L298N IC

GND Ground pin

Features & Specifications

• Driver Model: L298N 2A


• Driver Chip: Double H Bridge L298N
• Motor Supply Voltage (Maximum): 46V
• Motor Supply Current (Maximum): 2A
• Logic Voltage: 5V
• Driver Voltage: 5-35V
• Driver Current:2A
• Logical Current:0-36mA
• Maximum Power (W): 25W
• Current Sense for each motor
• Heatsink for better performance
• Power-On LED indicator

Brief about L298N Module

The L298N Motor Driver module consists of an L298 Motor Driver IC, 78M05 Voltage Regulator, resistors,

capacitor, Power LED, 5V jumper in an integrated circuit.

78M05 Voltage regulator will be enabled only when the jumper is placed. When the power supply is
less than or equal to 12V, then the internal circuitry will be powered by the voltage regulator and the 5V pin
can be used as an output pin to power the microcontroller. The jumper should not be placed when the power
supply is greater than 12V and separate 5V should be given through 5V terminal to power the internal
circuitry.

ENA & ENB pins are speed control pins for Motor A and Motor B while IN1& IN2 and IN3 & IN4 are
direction control pins for Motor A and Motor B.

Internal circuit diagram of L298N Motor Driver module is given below:


II. Objectives

▪ To make a program using Arduino platform that will control the DC motor using PWM pin of the
Arduino
▪ To drive a DC motor with the use of Arduino PID controller
▪ To create a simple design application program either using the DC motor or PID controller.

III. Equipment/Tools/Materials/Components Needed

In this experiment the components used were all virtual.

▪ DC Motor
▪ Potentiometer
▪ Arduino Uno Board
▪ PicsimLab
▪ Arduino IDE

Software used:
▪ Picsimlab
▪ Virtual Serial Ports
▪ Arduino IDE
Materials used in Design Application:

▪ 9V battery
▪ L298N motor driver
▪ DC motor
▪ Arduino Board
▪ DHT22 temperature and humidity sensor
▪ Connecting wires
IV. Diagram

V. Procedure

▪ In this experiment, we re tasked to make a program using Arduino platform to control the DC motor
using the PWM pin of the Arduino Uno Board.
▪ The DC motor shaft must turn 15, 25, 50, 100 and 180 degrees that was set by the pulse width using
the pulse width modulation.
▪ The DC motor movement will base on the PWM and dependent on the PID controller, the Kp, Ki and
Kd will be set the potentiometer connected to the analog input of the Arduino board.

Before we can start with the simulation we need to establish the software and libraries needed in order to run the
experiment.

*note: we need to download the library for L298N Motor Driver

 We need to create the connection in the Virtual Serial Ports since we are using virtual components that is
more convenient. Just like in the previous experiment the connection in the Virtual Serial ports is in COM 1
and COM 2.
 Next, set up the needed components in the PicsimLab, go to “spare parts window” and choose the DC motor
as the “Output”, for the “Input” choose the potentiometer, and go to “Modules” menu and choose the
Oscilloscope to display the graph later on.
The “Properties” in the Picsimlab is shown below:
After that, we will now move on to creating the code based on the condition given start of the
procedure. After the code is compiled without error/s, upload the hex code. That can be done by clicking on
the “Sketch” menu in the Arduino IDE then choose “Export Compiled Binary”. Make sure to remember the file
location because that hex code will be used to run the simulation in the PicsimLab. The code for Arduino is
provided below.

// ECEL-12 LAB#3
//use standalone version of the L293 library
#define use_standalone
//import the library in sketch
#include <L293.h>
//initialize L293 control pins
const int speedPin = 3; //INPWM
const int forwardPin = 5; //INA
const int reversePin = 6; //INB
int pot; //potentiometer input
float DC; //create an instance of the L293 library
L293 DCmotor(speedPin, forwardPin, reversePin);
void DutyCycle() {
pot = analogRead(A0);
if (pot >= 0 && pot <= 205) { // the potentiometer is divided into five portions
DC = 255.0*0.15; //15% duty cycle
}
if (pot >= 205 && pot <= 510) { // the potentiometer is divided into five portions
DC = 255.0*0.25; //15% duty cycle
}
if (pot >= 510 && pot <= 715) { // the potentiometer is divided into five portions
DC = 255.0*0.50; //50% duty cycle
}
if (pot >= 715 && pot <= 920) { // the potentiometer is divided into five portions
DC = 255.0*0.75; //75% duty cycle
}
if (pot >= 715 && pot <= 1023) { // the potentiometer is divided into five portions
DC = 255.0*1; //100% duty cycle
}
}
void setup() {
}
void loop() {
DutyCycle();
DC = map(pot, 0, 1023, 0, 255);
DCmotor.forward(DC);
}
This time, go to the Picsimlab click the “File” menu and choose the ‘’Load Hex”, that is the hex code from
Arduino and observe the results.

VI. Results and Discussions

The figures below show the results in various percentage of Duty Cycle.

15% Duty Cycle

25% Duty Cycle


50% Duty Cycle

75% Duty Dycle


100% Duty Cycle

Discussion:

After the simulation and observing the behaviour of the graph as the duty cycle varies it can be said that, to indicate
the speed and duration of each revolution, the total duration for a full rotation is displayed against the appropriate
duty cycle in seconds. It indicates that the speed is faster when the time to complete a full rotation is less, and
slower when the time to complete a full rotation is greater.

VII. Observations

By doing this experiment, observations can be made; like the relationship of the DC motor’s speed is directly
proportional to the Duty Cycle. It may not be linear, but it is observable that the speed of the DC motor
increases as the Duty Cycle is increased. This is because the motor's speed is determined by the PWM supplied
to the motor driver, as well as the speed at which it is operated.
VIII. Conclusions

Overall, we may draw the following conclusion from this experiment: the duty cycle applied to the driver
influences the speed of the DC motor; if the duty cycle is 0%, the speed is the lowest, and if it is 100%, the
speed is the highest.

IX. Recommendations

It is suggested that you use sensors when undertaking this type of activity in order to have a better
understanding or more detailed observation. Because the exact position and speed of the DC motor can be
determined or presented in this manner. These sensors can be used to detect the rotational parameters of a
DC motor as well as its acceleration and deceleration.

X. Design Applications

This design application regulates the motor's speed based on temperature. The speed of the motor increases as the
temperature rises, and the speed of the motor reduces as the temperature falls. This application can be a great start
in projects such as temperature regulation.

Components used:

▪ 9V battery
▪ L298N motor driver
▪ DC motor
▪ Arduino Board
▪ DHT22 temperature and humidity sensor
▪ Connecting wires

The connections are provided below,


/*

* Control Speed of Motor with Temperature using DHT22 Sensors with Motor driver L298N Module

* This code is to control single motor.

#include <L298N DC motor.h>

// motor 1 settings

#define IN1 2

#define IN2 4

#define ENA 3 // this pin must be PWM enabled pin

const int CCW = 2;

const int CW = 1;

const int motorDirection = CW;// set your motor direction

#define motor1

// use the line below for single motor

L298N DC motor motor(IN1, IN2, ENA, true);

const float tempMin = 30.0; // this can be changed to what min. temperature you want to set

const int speedMin =30;//speed in % from 0 to 100

const float tempMax = 65.0; // this corresponds to the max temp that will drive the motor in max. speed

const int speedMax =100;//speed in % from 0 to 100


int motorSpeed;// variable holding motor speed

//Setting for DHT sensor

#include "DHT.h"

#define DHTPIN 6

#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321

DHT dht(DHTPIN, DHTTYPE);

void setup() {

Serial.begin(9600);

Serial.println("L298N with Motor");

Serial.println("Speed Depends on Temperature");

Serial.println();

motor.begin();

dht.begin();

//L298N DC Motor

void loop() {

// Temperature to speed

tempToSpeed();

Serial.print("motorSpeed:");

Serial.println(motorSpeed);

motor.rotate(motor1, motorSpeed, motorDirection);//run motor1 at 60% speed in CW direction

delay(500);

// motor.brake(1);

*/

void tempToSpeed()
{

float t = dht.readTemperature();// read temperature in C

//float t = dht.readTemperature(true);// read temperature in F

Serial.print("T:");

Serial.print(t,1);

Serial.println(" C");

motorSpeed = map(t, tempMin, tempMax, speedMin,speedMax);

if(t <tempMin)

motorSpeed=0;

motor.brake(1);

if (t >tempMax)

motorSpeed=100;

}//tempToSpeed() end

Results and Discussion:

The result is provided below wherein the sensor reads the surrounding temperature at first.

In this result I’ve changed the minimum temperature to 26 degrees and the serial monitor is provided below.
Meanwhile, in the result provided below I’ve changed the min. temperature to 30 degrees. I did this just to
prove that the displayed temperature is the surrounding temperature. And, as you can see the DC motor is braked
because the desired temperature for it to activate is not yet reached.

What I’ve did next is I increased the temperature by applying heat near the sensor enough for it to sense
without damaging the component. This is the fastest way to observe if the design is really working. And as can be seen
in the result below, at 40. 1 degrees the DC motor rotates at 30 % CW direction that is because the temperature is
already increasing.
And as the temerature continues to increase, the speed of the DC motor also increases until the maximum speed is
reached wherein the DC motor speed will also be at its maximum. And if the temperature will decrease it will also
decrease. Actually, we can add a function in the code that can make the DC motor stop rotating if the temperature
is cold instead of putting it on brake.

XI. References

DC Motor: What Is It? How Does It Work? Types, Uses (iqsdirectory.com)


https://components101.com/modules/l293n-motor-driver-module

You might also like