Page 801 - Mechatronics with Experiments
P. 801

LABORATORY EXPERIMENTS  787
                      11.9 EXPERIMENT 9: SOLENOID CONTROL USING
                              A TRANSISTOR AND PIC MICROCONTROLLER

                             Objectives
                             To control a DC solenoid using a power transistor and PIC 18F452 (or PIC 18F4331)
                             microcontroller.

                             Components


                             Item                          Quantity  Part No.    Supplier
                             On/Off (pull) type DC solenoid   1     142463       www.jameco.com
                             On/Off (push-pull) type DC solenoid  1  145314      www.jameco.com
                             Transistor: IRF510 (MOSFET)      1     06F8238      www.newark.com
                             Diode                            1     76970        www.jameco.com
                             PIC Demo Board/Connectors       1 set  DM163022 or  www.microchipdirect.com
                                                                      DV164006



                             Theory
                             A solenoid is a linear displacement actuator. It has a coil, a plunger, and a core to guide
                             the electromagnetic field between the coil (stator) and the plunger (rotor). When current is
                             applied to the coil, force is generated in the direction to minimize the magnetic reluctance.
                             The direction of the current does not affect the direction of the force. The force generated
                             is proportional to the square of the current and inversely proportional to the square of the
                             air gap between the plunger and the stopper. By design, some solenoids are designed to
                             be operated in ON/OFF mode and some are designed to be operated in proportional mode.
                             In the ON/OFF mode of operation, the plunger is intended to take one of two positions
                             (fully OPEN or fully CLOSED) based on the current in its coil. In the proportional mode of
                             operation, the solenoid can take intermediate positions as a function of the coil current. In
                             this experiment we use a solenoid designed to be operated in ON/OFF mode. With careful
                             real-time control software, it can still be operated in the proportional mode. To control the
                             solenoid in ON/OFF mode, the output signal from the microcontroller to the transistor,
                             which switches the load current to the solenoid, can be a digital output signal. If we wanted
                             to control it in proportional mode, then a PWM output pin of the PIC should be used to drive
                             the transistor. We can also use a digital output channel and drive it with a PWM type signal
                             under software control, since the PWM frequency to drive the solenoid does not have to be
                             very high and such low frequency PWM signals can be generated under software control
                             at a standard digital output pin. For instance, if we wanted to generate a PWM signal at
                             50 Hz with 5% duty cycle control resolution, it requires us to update the digital output pin
                             at the following rate: 50 ⋅  100  = 1000 Hz.
                                                   5

                             Hardware
                             The circuit is designed to switch the voltage across the solenoid during the ON/OFF periods
                             of the cycle. In every cycle, when the voltage is high (12 V) the coil is energized by the
                             current flowing through it. A magnetic field, and the resulting actuation force, is produced
                             due to the tendency of the ferromagnetic plunger and coil generated magnetic flux to seek
                             the minimum reluctance point. This magnetic field pulls the plunger in towards the stopper.
                             When the voltage is low (0 V) for the remainder of the cycle (OFF period) the base current of
   796   797   798   799   800   801   802   803   804   805   806