Sei sulla pagina 1di 5

TUTORIAL FOR RUNNING A

DC-MOTOR USING
KRYPTON BOARD
[WEL – LAB,IIT BOMBAY]
Objective:

-> To control the speed and direction of a DC motor.

Description:

A very popular technique of controlling the speed of the DC


motor is by using PWM. This is made possible because of the low pass
response of the DC motor(Remember what happens when
a periodic signal of suitable frequency is passed through a low pass
filter). The response of the DC motor is thus proportional to the DC
value of the excitation signal if the frequency is chosen suitably. But
the DC value of the square wave is directly proportional to its duty
cycle. Hence the response of the DC motor i.e speed can be
controlled by varying the duty cycle.
We now know how to control the speed of the DC motor. But
how do we control the direction.This is acheived by using a clever
trick as explained below.
We see that motor rotates in the direction, based on which end
of the coil is driven by the signal having higher duty cycle. The
additional condition that is to maintained is that the two signals
namely at A+ and A- have to be complementary.

Problem statement consolidation:

-> To drive the DC motor with three different speeds in forward


direction and three different speeds in reverse direction.
-> Let speeds be set based on the switch inputs S2,S3 and S4. So in
theory 8 different speeds can be set.

Implementation:

Let the frequency of the excitation signal be approximately 50Hz.


One possible architecture is as shown below.
17-bit counter is required to generate 400 Hz clock. The clock is fed
to a 3 bit counter,the purpose of which shall be clear shortly. The
comparator1 compares the 3-bit count with switches'(S2,S3 and S4)
status and then outputs high if it is equal ,else outputs low. The
comparator2 compares the 3-bit count with “111” and then outputs high
if it is equal, otherwise low. The state machine uses the outputs from
the 2 comparators
in order to switch between the two states S0 and S1. When in S0 the
state-machine outputs “01” and when in S1 it outputs “10”. Initially the
state is S0. When the count becomes equal to S2,S3,S4 the state
changes to S1. Now when the count becomes equal to “111” it toggles
back to state S0. Since there are 8 states, the frequency of the
square wave generated at the output is 400/8 = 50Hz with a duty
cycle that depends upon the switch inputs(S2,S3 and S4).

As an example:
Say if S2,S3,S4 are “110”. Then Output(1:0) is “01” until the count from
the 3-bit counter is “110”. When the count exceeds “110” the
Output(1:0) becomes “10” until count becomes “111” after which the
Output(1:0) switches back to “01” and the process continues.

The resulting waveforms are as shown below:

Output(1)

Output(0)

Since the CPLD pins cannot drive the motor directly. The Output(1:0)
is connected to the motor through L293D interface as explained in
the “Stepper motor tutorial”

Potrebbero piacerti anche