DC Motor Control in MATLAB
1. Run MATLAB demo ‘Speed control of a DC motor using BJT H-bridge’. Modify the model such that the armature current doesn’t shoot up when the motor changes direction from forward to reverse.

The Bipolar Junction Transistor (BJT) when used for power switching applications, operates as an IGBT. When it is conducting (BJT operating in the saturated region), a forward voltage Vf is developed between collector and emitter (in the range of 1 V). Therefore, the IGBT block can be used to model the BJT device.
The IGBT block does not simulate the gate current controlling the BJT or IGBT. The switch is controlled by a Simulink® signal (1/0). The DC motor uses the preset model (5 HP 24V 1750 rpm). It simulates a fan-type load (where Load torque is proportional to the square of speed). The armature mean voltage can be varied from 0 to 240 V when the duty cycle (specified in the Pulse Generator block) is varied from 0 to 100%.
The H-bridge consists of four BJT/Diode pairs (BJT simulated by IGBT models). Two transistors are switched simultaneously: Q1 and Q4 or Q2 and Q3. When Q1 and Q4 are fired, a positive voltage is applied to the motor, and diodes D2-D3 operate as free-wheeling diodes when Q1 and Q4 are switched off. When Q2 and Q3 are fired, a negative voltage is applied to the motor, and diodes D1-D4 operate as free-wheeling diodes when Q2 and Q3 are switched off.
The motor starts in a positive direction with a duty cycle of 75% (mean DC voltage of 180V). At t= 0.5 sec., the armature voltage is suddenly reversed and the motor runs in the negative direction.
'Scope' shows motor speed, armature current, and load torque and 'Currents' shows currents flowing in BJT Q3 and diode D3.
When we run the Simulink model, we get the results as shown below, we can see that the armature current shoots up at t=0.5 sec when the direction of the motor is reversed.






2. Refer to the help section of ‘The Four-Quadrant Chopper DC Drive (DC7) block’. Compare it with the H-bridge model.

The 200 HP DC motor is separately excited with a constant 150 V DC field voltage source. The armature voltage is provided by an IGBT converter controlled by two PI regulators. The converter is fed by a 515 V DC bus obtained by rectification of a 380 V AC 50 Hz voltage source. In order to limit the DC bus voltage during dynamic braking mode, a braking chopper has been added between the diode rectifier and the DC7 block.
The first regulator is a speed regulator, followed by a current regulator. The speed regulator outputs the armature current reference (in p.u.) used by the current controller in order to obtain the electromagnetic torque needed to reach the desired speed. The speed reference change rate follows acceleration and deceleration ramps in order to avoid sudden reference changes that could cause armature over-current and destabilize the system. The current regulator controls the armature current by computing the appropriate duty ratios of the 5 kHz pulses of the four IGBT devices (Pulse Width Modulation). For proper system behavior, the instantaneous pulse values of IGBT devices 1 and 4 are opposite to those of IGBT devices 2 and 3. This generates the average armature voltage needed to obtain the desired armature current. In order to limit the amplitude of the current oscillations, a smoothing inductance is placed in series with the armature circuit.

Comparison of four-quadrant chopper DC drive (DC7) with H-Bridge:
1. In a four-quadrant chopper, DC drive distributes the required current supply for each sector and it consists of 4 quadrants like forward motoring, forward regenerative braking, reverse motoring, and reverse regenerative braking, whereas H-bridge supplies an irregular current for each sector that causes voltage fluctuations in armature current. It consists of 2 operations, forward motoring and reverse motoring
2. In modern battery chargers for electrical vehicles, H-bridge circuits are used. A four-quadrant operation is required in industrial as well as commercial applications.
3. The efficiency is high in the chopper compared to H-bridge, and maintenance is less than H-bridge.
4. Regenerative braking is not possible in H-bridge while it is possible in a DC7.
5. In H-bridge we need to change the polarity in order to control the motor's direction of rotation. Whereas, in a DC7, we need to interrupt one signal under the control of another.
3. Make a suitable EV model using the DC7 block and make a result report.
Using the above DC7 model, we need to build our own suitable EV model. To achieve this, we need to first modify the energy source at the input. We can take a generic battery model and configure it or we can use a simple DC source as an energy source and give the appropriate voltage value for an EV. The scope results vary in both cases from each other.
In this case, we will use a generic battery and configure it. The battery model in Simulink is shown below.

The battery parameters that are considered in the model are shown below.

The next step would be to give the model any driving cycle input instead of the step signal block. We can prepare our own drive cycle data and import it to the model. But in this case, we will go with the WOT (Wide Open Throttle) condition for simplification. The drive cycle data will be added as shown below.

So the total run time would be 3 seconds. The top speed will be 40m/s, the time to start deceleration will be 2 seconds.
Now we need to take the vehicle load characteristics for the relating Torque and speed of the vehicle. The linear load torque block can be replaced with a subsystem model according to the load characteristics given by
`Ttr = 24.7 + 0.0051w^2`
So using this equation we make a subsystem for the vehicle load characteristic equation and change the simulation time with respect to our drive cycle data.
The subsystem is shown below.

The input Wm is received as feedback from the DC7 block and is fed into the subsystem. The output of the subsystem would be the torque required.
After making the above changes, our EV model will be ready to be executed.

After running this model, we will be getting the below results.

The above image shows the drive cycle input at WOT condition.

The above image shows us the current and voltage being discharged from the battery during the run-time.

The above image shows us the variation of duty cycles, armature voltage, and current, and motor speed in accordance with the drive cycle input. We can also observe the difference between the actual and obtained values of the armature current and motor speed and its relationship with the duty cycles.
The Simulink model is attached below.
4. Explain in a brief the operation of the BLDC motor.
A Brushless DC Motor is similar to a Brushed DC Motor but as the name suggests, a BLDC doesn’t use brushes for commutation but rather they are electronically commutated. In conventional Brushed DC Motors, the brushes are used to transmit the power to the rotor as they turn in a fixed magnetic field. As mentioned earlier, a BLDC motor used electronic commutation and thus eliminates the mechanically torn brushes.
A BLDC Motor is a type of synchronous motor in the sense that the magnetic field generated by the stator and the rotor revolve at the same frequency.
Brushless Motors are available in three configurations: single-phase, two-phase, and three-phase. Out of these, the three-phase BLDC is the most common one.
The following image shows the cross-section of a BLDC Motor.

Stator
The structure of the stator of a BLDC motor is similar to that of an induction motor. It is made up of stacked steel laminations with axially cut slots for winding. The winding in BLDC is slightly different than that of the traditional induction motor.

Generally, most BLDC motors consist of three stator windings that are connected in star or ‘Y’ fashion (without a neutral point). Additionally, based on the coil interconnections, the stator windings are further divided into Trapezoidal and Sinusoidal Motors. In a trapezoidal motor, both the drive current and the back EMF are in the shape of a trapezoid (sinusoidal shape in case of sinusoidal motors). Usually, 48 V (or less) rated motors are used in automotive and robotics (hybrid cars and robotic arms).

Rotor
The rotor part of the BLDC Motor is made up of permanent magnets (usually, rare earth alloy magnets like Neodymium (Nd), Samarium Cobalt (SmCo), an alloy of Neodymium, Ferrite, and Boron (NdFeB)). Based on the application, the number of poles can vary between two and eight with North (N) and South (S) poles placed alternately. The following image shows three different arrangements of the poles. In the first case, the magnets are placed on the outer periphery of the rotor.

The second configuration is called a magnetic-embedded rotor, where rectangular permanent magnets are embedded into the core of the rotor. In the third case, the magnets are inserted into the iron core of the rotor.
Position Sensors (Hall Sensors)
A Position Sensor, which is usually a Hall Sensor (that works on the principle of Hall Effect) is generally used to detect the position of the rotor and transform it into an electrical signal. Most BLDC Motors use three Hall Sensors that are embedded into the stator to sense the rotor’s position.
The output of the Hall Sensor will be either HIGH or LOW depending on whether the North or South pole of the rotor passes near it. By combining the results from the three sensors, the exact sequence of energizing can be determined.
WORKING PRINCIPLE -
Consider the following setup of three windings in the stator designated A, B, and C. For the sake of understanding, let us replace the rotor with a single magnet.

We know that when a current is applied through a coil, a magnetic field is generated and the orientation of the field lines i.e. the poles of the generated magnet will depend on the direction of the current flowing through the coil.
Using this principle, if we supply current to coil A so that it will generate a magnetic field and attract the rotor magnet. The position of the rotor magnet will shift slightly clockwise and will align with A.
If we now pass current through coils B and C one after the other (in that order), the rotor magnet will rotate in a clockwise direction.

To increase efficiency, we can wind the opposite coils using a single coil so that we get the double attraction. Further increasing the efficiency, we can energize two coils at the same time so that one coil will attract the magnet and the other coil will repel it. During this time, the third will be idle.
For a complete 3600 rotation of the rotor magnet, six possible combinations of the coils A, B, and C are applicable and are shown in the following timing diagram.

Base on the above diagram, we can confirm that at any time, one phase is positive, one phase is negative and the third phase is idle (or floating). So, based on the inputs from the Hall Sensors, we have two switches in the phases as per the above diagram.