Saturday, July 20, 2019
Microcontroller Based DC Motor Speed Controller
Microcontroller Based DC Motor Speed Controller In this report I present a microcontroller based DC motor speed controller. DC motors play a vital role in most of the industrial areas. They are mainly used for the mechanical movements of physical applications such as media drives, power plants, lifts, elevators, conveyers, belt driven loads (printing press) etc. The controller implements the control strategy governing the load and motor characteristics. To match the load and motor, the input to the microcontroller is manipulated by the controller. The purpose of a motor speed controller is to capture a signal representing the demanded speed, and to drive the motor at that speed. The controller may or may not actually measure the speed of the motor. If it does, it is called a Feedback Speed Controller or Closed Loop Speed Controller, if not it is called an Open Loop Speed Controller. Feedback speed control is better, but more complicated, and may not be required for a simple circuit design. The former (closed loop) is implemented in the presented controller design. The subject arrangement consisted of a tachometer attached to the shaft of the motor. A controller design cannot be more accurate than methods aimed at measuring actual motor speed. This is readily attained by coupling the motor shaft with a tachometer. The tachometer output signal is converted to a dc voltage signal acceptable to the microcontroller. The microcontroller is programmed to drive the motor accomplishing the load requirement. The operation of dc motor was studied. Several types of motors and various control types were investigated. The project also intends to familiarize us with the efficiency of PIC in control systems. To evaluate the effectiveness of the controller, analysis will be conducted driving variable load while maintaining constant speed of the motor. The advantages of using microcontrollers to control dc motor were studied. INTRODUCTION 1.1 MOTOR An electric motor is an electromechanical device that converts electrical energy to mechanical energy. The mechanical energy can be used to perform work such as rotating a pump impeller, fan, blower, driving a compressor, lifting materials etc. It is estimated that about 70% of the total electrical load is accounted by motors only. 1.2 CLASSIFICATION OF MOTORS Electric Motors Alternating Current (AC) Motors Direct Current (DC) Motors Synchronous Induction Three-Phase Single-Phase Self Excited Separately Excited Series Shunt Compound FIG-1.1 classification of motors 1.3 AC MOTORS An AC motor is a motor that is driven by an alternating current. It consists of two basic parts, an outside stationary stator having coils supplied with alternating current to produce a rotating magnetic field, and an inside rotor attached to the output shaft that is given a torque by the rotating field. 1.3.1 TYPES OF AC MOTORS There are two types of AC motors, depending on the type of rotor used. The first is the synchronous motor, which rotates exactly at the supply frequency or a sub multiple of the supply frequency. The magnetic field on the rotor is either generated by current delivered through slip rings or by a permanent magnet. The second type is the induction motor, which turns slightly slower than the supply frequency. The magnetic field on the rotor of this motor is created by an induced current. 1.3.2 TYPES OF INDUCTION MOTORS Squirrel-Cage Induction Motors The most simple and reliable of all electric motors. It is essentially a constant speed machine, which is adaptable for users under all but the most severe starting conditions. Requires little attention as there are no commutator or slip rings, yet operates with good efficiency. Wound-Rotor (Slip Ring) Induction motor It is used for constant speed-service requiring a heavier starting torque than is obtainable with squirrel cage type. Because of its lower starting current, this type is frequently used instead of the squirrel-cage type in larger sizes. These motors are also used for varying-speed-service. Speed varies with this load, so that they should not be used where constant speed at each adjustment is required, as for machine tools. Single Phase Induction Motors This motor is used mostly in small sizes, where polyphase current is not available. Characteristics are not as good as the polyphase motor and for size larger than 10 HP, the line disturbance is likely to be objectionable. These motors are commonly used for light starting and for running loads up to 1/3 HP Capacitor and repulsion types provide greater torque and are built in sizes up to 10 HP. Synchronous Motors Run at constant speed fixed by frequency of the system. Require direct current for excitation and have low starting torque. For large motor-generators sets, frequency changes, air compressors and similar apparatus which permits starting under a light load, for which they are generally used. These motors are used with considerable advantage, particularly on large power systems, because of their inherent ability to improve the power factor of the system. 1.4 DC MOTOR Direct-Current motors, as the name implies, use a direct-unidirectional current. A DC motor has three main components: Field pole. The interaction of two magnetic fields causes the rotation in a DC motor. The DC motor has field poles that are stationary and an armature that turns on bearings in the space between the field poles. A simple DC motor has two field poles: a north pole and a south pole. The magnetic lines of force extend across the opening between the poles from north to south. Armature. When current goes through the armature, it becomes an electromagnet. The armature, cylindrical in shape, is linked to a drive shaft in order to drive the load. The armature rotates in the magnetic field established by the poles, until the north and south poles of the magnets change location with respect to the armature. Once this happens, the current is reversed to switch the south and north poles of the armature. Commutator. This component is found mainly in DC motors. Its purpose is to overturn the direction of the electric current in the armature. The commutator also helps in the transmission of current between the armature and the power source. 1.4.1 OPERATION OF A DC MOTOR: When a dc motor is subject to dc voltage, the current flows through the armature coil. A wire carrying current also has a magnetic field around it. This magnetic field distorts the parallel magnetic field of stator to produce a force which causes the armature coil to turn. FIG-1.2 operation of motor Each coil of the armature is not only connected to the brushes but the brushes are connected first to one end and then to the other end of the coil. This commutating action is necessary to maintain the same direction of the current flow in the armature coils relative to the magnetic field lines in the field poles. The motor would never turn without commutation. FIG-1.3 cross section diagram of a motor 1.4.2 Types of Excitations There are two basic elements in a DC motor. The way in which these are connected results in various types of DC motors. SHUNT WOUND: The construction and principle of operation of a shunt motor is similar to any DC motor. This type of motor is called shunt because the field is in parallel or shunts the armature. The shunt field is directly connected in parallel with the armature circuit. Shunt windings require large number of turns to produce a strong magnetic field. SERIES WOUND: In a series wound motor, the field is connected in series with the armature. In this type, the speed tends to increase until the back EMF equals the impressed voltage. The EMF also decreases the current in the field and armature. As the field weakens more speed is required to maintain the counter EMF. Thus a series motor is used only where the load is attached e.g. A lift truck, an electric crane. Etc. COMPOUND WOUND: A compound motor has two field windings, the shunt field and series field. The shunt connected in parallel with the armature and the series field connected in series with the armature. The combination of both fields gives double advantages. It has a greater torque than the shunt motor due to the series field and fairly constant speed due to the series field winding. The compound motor has both shunt and series motor characteristics. These will be discussed along with their control techniques in the next chapter. 1.5 TACHOMETER A tachometer is an instrument that measures the rotational speed of the shaft of the motor. It functions in a similar fashion as compared to a speedometer on a car. It tells you the speed of the car. Similarly the tachometer is used to measure the motor speed. In a closed loop control system the information about the instantaneous state of the output is fed back and compared with the input and difference is used to modify the output in such manner as to achieve a desired condition. Similarly a tachometer is coupled to the shaft of the motor. Thus a signal representing the speed of the motor is produced. This signal is fed back to the input where it is compared to the speed command voltage. The error produced is actuated by the speed of the motor. In my designed controller the error actuating and motor control is achieved by programming the microcontroller. It is used to control the rotation of the motor. It senses the input and process it using the program burned in it and gives the required PWM output on the required port pins. This output controls the on/off time of the mosfet and thus controls the motor. This technique and mosfets will be discussed in the next chapter. As long as the speed command voltage is held constant, the motor will run at a proportional constant speed regardless of the mechanical load. The set speed control gives a dc voltage input, for example 12 volts for maximum speed and zero for stationary. This could be a potentiometer providing any voltage in a range from zero to +12 volts. The microcontroller (PIC) amplifies the difference between the two input voltages (tachometer and potentiometer) and the error is actuated. 1.6 MICROCONTROLLER (PIC) The name PIC initially referred to Programmable Interface Controller. Advantages of using PIC over other controlling devices for controlling the DC motor are given below: SPEED The execution of an instruction in PIC IC is very fast (in micro seconds) and can be changed by changing the oscillator frequency. One instruction generally takes 0.2 microseconds. COMPACT: The PIC IC will make the hardware circuitry compact. RISC PROCESSOR The instruction set consists of only 35 instructions. EPROM PROGRAM MEMORY Program can be modified and rewritten very easily. INBUILT HARDWARE SUPPORT Since PIC IC has inbuilt programmable timers, ports and interrupts, no extra hardware is needed. POWERFUL OUTPUT PIN CONTROL Output pins can be driven to high state, using a single instruction. The output pin can drive a load up to 25mA. INBUILT I/O PORTS EXPANSIONS This reduces the extra ICs which are needed for port expansion and port can be expanded very easily. INTEGRATION OF OPERATIONAL FEATURES Power on reset and brown/out protection ensures that the chip operates only when the supply voltage is within specification. A watchdog timer resets PIC if the chip ever malfunctions and deviates from its normal operation. The speed of motor is directly proportional to the DC voltage applied across its terminals. Hence, if we control the voltage applied across its terminal we actually control its speed. A PWM (Pulse Width Modulation) wave can be used to control the speed of the motor. Here the average voltage given or the average current flowing through the motor will change depending on the ON and OFF time of the pulses controlling the speed of the motor i.e. The duty cycle of the wave controls motor speed. This wave is generated by the PIC. . CHAPTER 2. 2.1 DC SHUNT MOTOR FIG -2.3 Shunt windings require large number of turns to produce a strong magnetic field. This is because a small gauge wire cannot handle heavy currents. As a result, when voltage is applied, very little current flows through the shunt coil. The interaction of the magnetic fields between the one from armature and the one from shunt coil causes the motor to rotate. The speed can be controlled by varying the field strength or armature voltage. Current is supplied from the stationary housing to the rotating armature through commutator brushes arrangement. As the stator is stationary, power is applied directly to it. 2.1.2 SPEED CONTROL OF A DC SHUNT MOTOR This type of motor runs at a constant speed practically, regardless of the load. It is the type generally used in commercial practice. Speed of the shunt wound motors may be varied in two ways: First, by inserting resistance in series with the armature, thus decreasing speed (FIG ) And second, by inserting resistance in the field circuit. In this case the speed will vary with each change in load. This normally works with any controller setting i.e. it maintains constant speed despite variable load. Therefore, a shunt motor has proved its efficiency in adjustable speed service and loads requiring a low starting torque. 2.2 DC SERIES MOTOR In a series motor, the field winding (shunt field) is connected in series with the armature winding (A) as shown in the figure. The field current is therefore equal to the armature current. Speed is restricted to 5000 RPM It must be avoided to run a series motor with no load because the motor will accelerate uncontrollably. FIG-2.5 V = Supply voltage E = Generated e.m.f I = Supply current RA = Armature resistance RF = Field resistance 2.2.2 SPEED CONTROL OF A DC SERIES MOTOR The speed of a series motor depends almost entirely on the flux. The stronger the field flux, the lower the speed. Likewise, decrease in load current and therefore in field current and field flux causes an increase in speed. This can be achieved by adding a resistor in parallel with the series field winding. This causes the field current to decrease and the flux drops accordingly. This causes the motor speed to increase. The speed can be decreased by adding an external resistor in series with the armature and the field winding. This would cause a reduction in the armature supply voltage causing the motor speed to decrease. 2.3 DC COMPOUND MOTOR A DC compound motor is a combination of shunt and series motor. In a compound motor, the field winding (shunt field) is connected in parallel in series with the armature winding (A). For this reason this motor has a good starting torque and a stable speed. The higher the percentage of compounding (i.e. percentage of field winding connected in series), the higher the starting torque this motor can handle. For example, compounding of 40-50% makes the motor suitable for hoists and cranes, but standard compound motors (12%) are not. There are 2 major types of compound motors. These are given below: Cumulative compound motors Differential compound motors FIF-2.6 CUMULATIVE COMPOUND MOTOR FIG-2.7 DIFFERENTIAL COMPOUND MOTOR 2.3.2 SPEED CONTROL OF A COMPOUND MOTOR The speed of a compound motor can easily be controlled by changing the voltage supply to the motor. A solid state AC variable frequency motor drive can also be used to vary the speed of an AC motor. 2.4 PWM (PULSE WIDTH MODULATION) PWM, or Pulse Width Modulation, is a method of controlling the amount of power to a load without having to dissipate any power in the load driver. Imagine a 10W light bulb load supplied from a battery. In this case the battery supplies 10W of power, and the light bulb converts this 10W into light and heat. No power is lost anywhere else in the circuit. If we wanted to dim the light bulb, so it only absorbed 5W of power, we could place a resistor in series which absorbed 5W and then the light bulb could absorb the other 5W. This would work, but the power dissipated in the resistor not only makes it get very hot, but is wasted. The battery is still supplying 10W. An alternative way is to switch the light bulb on and off very quickly so that it is only on for half of the time. Then the average power taken by the light bulb is still only 5W, and the average power supplied by the battery is only supplying 5W also. If we wanted the bulb to take 6W, we could leave the switch on for a little longer than the time it was off, then a little more average power will be delivered to the bulb. This on-off switching is called PWM. The amount of power delivered to the load is proportional to the percentage of time that the load is switched on. Pulse-width modulation (PWM) or duty cycle variations are commonly used in speed control of dc motor. The duty cycle is defined as the percentage of digital high to digital low and digital high pulse-width during a PWM period. Thus by varying the pulse width, we can vary the average voltage across a DC motor and hence its speed In my presented controller design the PWM (Pulse Width Modulation) function of PIC is used for the electric current control to drive a motor. PWM can change the duty of the pulse to output into CCP1 by the data. The duty of the pulse of CCP1 is controlled in the voltage (the control voltage). When the control voltage is higher than the regulation value, the H level time of the CCP1 pulse is made long and the number of rotations of the motor is lowered. When the control voltage is lower than the regulation value, the H level time of the CCP1 pulse is made short and the number of rotations of the motor is raised. This mechanism will be discussed and elaborated in the next chapter. 2.5 MOSFETS The speed controller works by varying the average voltage sent to the motor. Imagine a light bulb with a switch. When you close the switch, the bulb goes on and is at full brightness, say 100 Watts. When you open the switch it goes off (0 Watts). Now if you close the switch for a fraction of a second, and then open it for the same amount of time, the filament wont have time to cool down and heat up, and you will just get an average glow of 50 Watts. This is how lamp dimmers work, and the same principle is used by speed controllers to drive a motor. When the switch is closed, the motor sees 12 Volts, and when it is open it sees 0 Volts. If the switch is open for the same amount of time as it is closed, the motor will see an average of 6 Volts, and will run more slowly accordingly. As the amount of time that the voltage is on increases compared with the amount of time that it is off, the average speed of the motor increases. This on-off switching is performed by power MOSFETs. A MOSFET (Metal-Oxide-Semiconductor Field Effect Transistor) is a device that can turn very large currents on and off under the control of a low signal level voltage 2.5.1 TYPES OF MOSFETS. There are NPN type and PNP type as the semiconductor part. When no voltage is applied no electric current flows between the drain and the source. NPN type is called N-channel and PNP type is called P channel. An oxide film is put to the semiconductor of NPN or PNP and metal is put onto it as the gate. In case of NPN, the part of N is a source pole and a drain pole. In case of PNP, the part of P is the polar side. When positive voltage is applied to the gate of the N-channel MOS FET, the electrons of N-channel of source and drain are attracted to the gate and go into the P-channel semiconductor among both. With the movement of these electrons, it conditions itself like spans a bridge for electrons between drain and source. The size of this bridge is controlled by the voltage to apply to the gate. . This type (N CHANNEL) of mosfet is used in the presented controller. FIG 2.8 In case of P-channel MOS FET, the voltage is opposite but does similar operation. When negative voltage is applied to the gate of P-channel MOS FET, the holes of P-channel of source and drain are attracted to the gate and go into the N-channel semiconductor among both. With the movement of these holes, a bridge for holes is spanned and the electric current flows between drain and source. Transistor controls an output current by the input current. However, in case of FET, it controls an output current by input voltage (Electric field). The input current doesnt flow. To handle a MOS FET, needs attention because the oxidation insulation film is thin. This film is prone to the high voltage of the static electricity and so on. CHAPTER 3 The highlighted part in the figure represents the shaft which links the motor and the tachometer. The speed of the motor is directly proportional to the frequency of the tachometer. The dc voltage input is provided by the potentiometer. The microcontroller operates on a dc voltage. The output from the tachometer is a sine wave which has to be rectified in order to operate the pic. This is achieved using an F/V converter. The converter releases a dc logic signal which operates the pic. CIRCUIT EXPLANATION: The input voltage to the main motor is controlled by a potentiometer. This variable resistor could be adjusted manually to provide a 0-12 v input. This voltage sets the number of rotations of the main motor. The input voltage of PIC becomes low when bringing VR1 close to the side 1 and PIC increases the drive electric current of the motor. That is, the revolution of the motor rises. The input voltage of PIC becomes high when bringing VR1 close to the side 3 and PIC reduces the drive electric current of the motor. That is, the revolution of the motor slows down. Control voltage is defined as the feedback signal which is produced to rectify the error between the desired and controlled speed. This is provided by the tachometer in our case. The output from the tachometer is a sine wave which cannot operate the microcontroller to perform the programmed functions. This is converted to a dc voltage signal compatible with the pic microcontroller. This changed voltage is used to enable the CCP feature of the PIC resulting in motor drive. The CCP feature will be discussed in detail later in the chapter. The control voltage to PIC is thus governed by the fluctuations of the main motor. This control voltage (feedback signal) is directly proportional to the rotational speed of the motor. The PIC microcontroller is the brain of the circuit controlling all actions to be done and the output. PIC controls the electric drive current for the control voltage to become a regulation value. When the revolution of the motor slows down, i.e. control voltage goes down, the drive electric current of the motor is increased and number of rotations is raised. When the control voltage reaches a regulation value, a drive electric current at the point is held. When the number of rotations of the motor is high, i.e. the control voltage is high, the drive electric current of the motor is reduced and number of rotations is lowered D1 is used to protect PIC when the voltage of the detection motor is high. The voltage which is applied to the terminal of PIC is a maximum of +5V. This zener diode prevents the destruction of PIC when the speed detection voltage of the motor exceeds 5V. CCP FEATURE Capture, Compare and Pulse Width Modulation feature is abbreviated to form CCP. Capture This is the function to capture the 16 bits value of timer1 register when an event occurs on pin RC2/CCP1. This can be used for the measurement of the period time of the signal like the frequency counter and so on Compare Generate an interrupt, or change on output pin, when Timer 1 matches a pre-set comparison value PWM Create a re-configurable steady duty cycle square wave output at a user set frequency. The timer resource of the capture and compare is timer1 and the timer resource of PWM is timer2. The following steps should be taken when configuring the CCP module for PWM operation: Set the PWM period by writing to the PR2 register. PWM Period equals [(PR2+1)]*4Tosc*(timer 2 prescale value), and the resultant PWM frequency equals 1/ PWM_Period. Tosc stands for time period of the oscillations. Set the PWM duty cycle by writing to the CCPR1L register and CCP1X and CCP1Y bits of CCP1CON register. Duty Cycle is based on CCPRxL, most significant byte, and CCPxCON, least significant two bits. CCPRxL functions as a comparative value with timer 2 and a scaling factor to determine the number of counts of CCPx. PWM logic remains high, without considering CCPxCON. The two least significant bits, CCPxCON, determine the percentage of the maximum resolution the PWM duty cycle is extended. Make the CCP1 pin an output by clearing the TRISC. Set the TMR2 prescale value and enable Timer2 by writing to T2CON register. Configure the CCP1 module for PWM operation. PWM can change the duty of the pulse to output into CCP1 by the data. When the time period of the H level of the pulse of CCP1 is short, the time of ON (the L level) becomes long in TR2 which implies that the drive electric current of the motor increases. Oppositely, when the H level time of the pulse of CCP1 is long, the ON time of TR2 becomes short and the drive electric current of the motor decreases. The duty of the pulse of CCP1 is controlled by the control voltage (feedback signal) which was taken in with input circuit. When the control voltage is higher than the regulation value, the H level time of the CCP1 pulse is made long and the number of rotations of the motor is lowered. When the control voltage is lower than the regulation value, the H level time of the CCP1 pulse is made short and the number of rotations of the motor is raised. A three terminal regulator is used for getting the operate voltage for pic. PARTS PIC16F873 3 Terminal regulator ( 7805) Transistor for MOS FET drive ( 2SC1815 ) Power MOS FET ( 2SK3142 ) Zener diode ( RD5A ) IC socket Resonator Variable resistor for motor speed setting Resistors Capacitors Printed board VFC 320 (F/V CONV) Bipolar transistor 2N222 FURURE WORK: Dec: complete circuit design and order components. January: software design and circuit assembly February: Simulation and preparation of final report and presentation March: review and appendices April: submission.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.