0% found this document useful (0 votes)
8 views6 pages

DC Motor Codess

The document details MATLAB codes for plotting speed-torque curves of three types of DC motors: series, shunt, and separately excited. Each section includes a description of the motor type, the code used to calculate speed and torque, and the resulting plots that illustrate the relationship between torque and speed. The analysis emphasizes the importance of understanding these curves for optimizing motor performance in various applications.

Uploaded by

Raghad 3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views6 pages

DC Motor Codess

The document details MATLAB codes for plotting speed-torque curves of three types of DC motors: series, shunt, and separately excited. Each section includes a description of the motor type, the code used to calculate speed and torque, and the resulting plots that illustrate the relationship between torque and speed. The analysis emphasizes the importance of understanding these curves for optimizing motor performance in various applications.

Uploaded by

Raghad 3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

DC Motor Project: Codes for Plotting Speed with Torque

1- Plotting the Speed-Torque Curve of a Series DC Motor


 Description:
 This MATLAB code generates a speed-torque curve for a series DC motor.
 It defines a function series_dc_motor to calculate the speed and torque of the motor based
on the applied voltage, motor constants, and torque.
 The main script then sets the parameters such as applied voltage ( Vt), flux coefficient
(C), motor constant (K), armature resistance ( Ra), and field resistance (Rf).
 It defines a range of torque values ( torque_range) for which the speed-torque curve will
be plotted.
 Inside a loop, it calculates the speed and torque for each torque value in the range using
the series_dc_motor function and stores them in arrays.
 Finally, it plots the speed-torque curve using the plot function with appropriate labels and
titles.
 The Code :
% MATLAB code to plot the speed-torque curve of a series DC motor
% Function to calculate the speed and torque of a series DC motor
function [speed, torque_val] = series_dc_motor(Vt, C, K, torque, Ra, Rf)
% Calculate the numerator of the speed equation
numerator = Vt / sqrt(C * K) / sqrt(torque);
% Calculate the denominator of the speed equation
denominator = (Ra + Rf) / (C * K);
% Calculate the speed
speed = numerator - denominator;
% Assign the torque value
torque_val = torque;
end
% Applied voltage
Vt = 200;
% Flux (flux linkage) coefficient
C = 1;
% Motor constant
K = 0.1;
% Armature resistance
Ra = 0.5;
% Field resistance
Rf = 0.3;
% Torque range for the motor
torque_range = 100:100:800;
% Arrays to store speed and torque values
series_speed = [];
series_torque = [];
% Loop through each torque value in the range
DC Motor Project: Codes for Plotting Speed with Torque

for torque = torque_range


% Calculate speed and torque using the series_dc_motor function
[speed, torque_val] = series_dc_motor(Vt, C, K, torque, Ra, Rf);
% Append speed and torque values to arrays
series_speed = [series_speed, speed];
series_torque = [series_torque, torque_val];
end
% Plot speed-torque curve
plot(series_torque, series_speed, '-o');
title('Series DC Motor Speed-Torque Curve');
xlabel('Torque (Nm)');
ylabel('Speed (rad/s)');
grid on;

 The Generated Plot :


The plotted speed-torque curve illustrates the relationship between the motor's
rotational speed (in radians per second) and the torque applied to it (in Newton-
meters). As torque increases, the motor's speed decreases, demonstrating the
typical behavior of a series DC motor. This inverse relationship is a result of the
motor's design and operating principles. Additionally, the curve showcases the
motor's performance characteristics, indicating its capability to deliver higher
torque at lower speeds and vice versa. Understanding this curve is crucial for
optimizing the motor's operation in various applications, such as in industrial
machinery or electric vehicles, where precise control over speed and torque is
essential for efficient performance.

Figure 1 Speed-Torque Relationship in a Series DC Motor


DC Motor Project: Codes for Plotting Speed with Torque

2- Plotting the Speed-Torque Curve of a Shunt DC Motor


 Description:
This MATLAB code generates the speed and torque curves for a shunt DC motor.
It utilizes the given parameters such as applied voltage, field resistance, armature
resistance, motor speed, and armature voltage to calculate the motor speed (n2) for
various torque values. The calculation is performed based on the relationship
between armature current, armature voltage, and motor speed. The resulting speed-
torque curve illustrates the motor's performance characteristics, showing how the
motor speed varies with changes in applied torque. This information is crucial for
understanding and optimizing the motor's operation in various applications where
precise control over speed and torque is required, such as in industrial machinery,
robotics, and electric vehicles.

% Function to calculate motor speed (n2) based on given parameters


function n2 = calculate_motor_speed(IL, VT, RF, RA, N1, EA1)
% Calculate armature current (Ia) using Ohm's Law
Ia = IL - (VT / RF);
% Calculate armature voltage (Ea2) using Ohm's Law
Ea2 = VT - Ia * RA;
% Calculate motor speed (n2) using the formula: (Ea2 * N1) / EA1
n2 = (Ea2 * N1) / EA1;
end
% Given parameters for the shunt DC motor
VT = 230; % Applied voltage
RF = 50; % Field resistance
RA = 0.06; % Armature resistance
N1 = 1200; % Motor speed (N1)
EA1 = 250; % Armature voltage (EA1)
% Current values for which speed and torque are calculated
IL_values = [0, 100, 200, 300];
% Initialize empty lists to store speed (n2) and torque values
n2_list = [];
torque_list = [];
% Calculate speed and torque for each current value
for IL = IL_values
% Calculate motor speed (n2) using the calculate_motor_speed function
n2 = calculate_motor_speed(IL, VT, RF, RA, N1, EA1);
% Append calculated speed to n2_list
n2_list = [n2_list, n2];
% Append current value to torque_list
torque_list = [torque_list, IL];
DC Motor Project: Codes for Plotting Speed with Torque

end
% Plot speed-torque curve
figure;
plot(torque_list, n2_list, 'bo-', 'LineWidth', 1.5); % Plot torque vs
speed
title('Speed-Torque Characteristics of a Shunt DC Motor'); % Set title
xlabel('Torque (Nm)'); % Label x-axis
ylabel('Speed (RPM)'); % Label y-axis
ylim([500, 1250]); % Set y-axis limits
grid on; % Enable gridlines
 The Generated Plot :
The plotted graph illustrates the speed-torque characteristics of a shunt DC motor.
Each data point on the curve represents a specific torque value applied to the
motor, plotted against the corresponding motor speed. The curve showcases the
relationship between torque and speed, revealing how changes in torque affect the
rotational speed of the motor. As torque increases, the motor's speed tends to
decrease, indicating the typical behavior of a shunt DC motor. This speed-torque
curve provides valuable insights into the motor's performance and can be used to
optimize its operation for various industrial applications, where precise control
over speed and torque is essential for efficient and reliable performance.

Figure 2 Speed-Torque Characteristics of a Shunt DC Motor


DC Motor Project: Codes for Plotting Speed with Torque

3- Plotting the Speed-Torque Curve of a Separately Excited


DC Motor
 Description:
 This MATLAB code computes and plots the torque-speed characteristics of a separately
excited DC motor. It first defines two functions:
calculate_speed_separately_exicted_dc_motor, which calculates the motor speed based
on the given parameters, and calculate_torque, which calculates the torque of the motor.
The main parameters of the motor, such as applied voltage (VT), field resistance (RF),
armature resistance (RA), nominal motor speed (N1), and armature voltage under no-load
conditions (EA1), are specified.
 Next, the code iterates over a range of armature current values and calculates the
corresponding motor speeds using the calculate_speed_separately_exicted_dc_motor
function. Simultaneously, it computes the torque values using the calculate_torque
function. Finally, it plots the torque-speed curve, showing how motor speed varies with
changes in torque. This curve provides valuable insights into the performance
characteristics of the separately excited DC motor and is essential for analyzing and
optimizing its operation in various applications.

 The Generated Plot :


% Function to calculate motor speed of separately excited DC motor
function n2 = calculate_speed_separately_exicted_dc_motor(IL, VT, RF, RA,
N1, EA1)
Ia = IL;
Ea2 = VT - Ia * RA;
n2 = (Ea2 * N1) / EA1;
end
% Function to calculate torque of separately excited DC motor
function torque = calculate_torque(Ea2, Ia, n2)
% Calculate torque using the formula: torque = Ea2 * Ia / n2
torque = Ea2 * Ia / n2;
end
% Given parameters
VT = 230;
RF = 50;
RA = 0.06;
N1 = 1200;
EA1 = 250;
% Armature current values
IL_values = [0, 100, 200, 300];
n2_list = zeros(1, length(IL_values));
% Calculate motor speed for each armature current value
for i = 1:length(IL_values)
IL = IL_values(i);
DC Motor Project: Codes for Plotting Speed with Torque

n2_list(i) = calculate_speed_separately_exicted_dc_motor(IL, VT, RF,


RA, N1, EA1);
end
% Initialize torque list
torque_list = zeros(1, length(IL_values));
% Calculate torque for each armature current value
for i = 1:length(IL_values)
IL = IL_values(i);
Ia = IL;
Ea2 = VT - Ia * RA;
n2 = (Ea2 * N1) / EA1;
torque_list(i) = calculate_torque(Ea2, Ia, n2);
end
% Plot torque-speed characteristics
figure;
plot(torque_list, n2_list, 'bo-', 'LineWidth', 1.5);
title('Torque-Speed Characteristics of a Separately Excited DC Motor');
xlabel('Torque (Nm)');
ylabel('Speed (RPM)');
ylim([500, 1250]);
grid on;

 The Generated Plot :


The graph shows how the speed of a separately excited DC motor changes with
different torque levels. As torque increases, the motor's speed decreases, which is a
common behavior in DC motors. Interestingly, the pattern closely resembles that of
a shunt DC motor, indicating similarities in their performance characteristics. This
insight is valuable for understanding and optimizing the operation of DC motors
across various applications.

Figure 3 Torque-Speed Characteristics of a Separately Excited DC Motor.

You might also like