Page 810 - Mechatronics with Experiments
P. 810

796   MECHATRONICS
                                   Commercial H-bridge amplifiers accept two different types of PWM command signals
                              and there is a “H-bridge driver/controller” section of the circuit which translates the input
                              command signals to corresponding H-bridge drive signals to operate the transistor pairs:
                                1. PWM command signal (0–100% duty cycle, corresponding to 0–100% of maximum
                                   current command) and direction signal. The direction signal (ON for clockwise
                                   or positive, OFF for counterclockwise or negative) decides on the direction of the
                                   current, the PWM signal’s duty cycle determines the magnitude of the commanded
                                   current. Using these two signals, the H-bridge driver circuit generates two command
                                   signals that drive one of the pair (two transistors) at a predefined PWM frequency.
                                2. PWM command signal only in (0–100% duty cycle), where 50% duty cycle is
                                   considered as zero current command. A PWM duty cycle less than 50% is interpreted
                                   as counterclockwise direction, and a PWM duty cycle above 50% is interpreted as
                                   clockwise direction. Then, the H-bridge controller activates the two PWM channels
                                   to control one of the two pair of power transistors.
                              The type of PWM command signal an H-bridge expects is a matter of interpreting the
                              command signals in a clear way so that the direction and magnitude of the signal is defined.
                              The direction information determines which one of the two pairs of transistors will be
                              activated. The magnitude information determines what percentage of the time (duty cycle)
                              the active transistor pair is kept ON and OFF.
                                   If the H-bridge expects an analog voltage signal for current command, it again needs a
                              way to determine the magnitude and direction. For instance, 0–10 VDC analog input signal
                              defines the magnitude of desired current, and a direction input signal determines the sign
                              (direction) of the desired current. Likewise, an analog voltage command range of −10 V to
                              +10 V alone can be used to define both magnitude and direction of the commanded signal
                              as well.
                                   Regardless of the type of command signal used, the H-bridge controller needs to be
                              able to determine the desired current direction and magnitude. Once that is known, then
                              the corresponding transistor pair is activated with a proper duty cycle of a fixed frequency
                              PWM signal.

                              Procedure

                                1. Assemble the circuit as shown in the circuit diagram (Figures 11.31 and 11.32).
                                2. Calculate the values of the PWM frequency and duty cycle, and implement the code
                                   for these values.
                                3. Download and run the program. The motor speed should change based on the duty
                                   cycle.
                                4. Vary the duty cycle value in the code gradually to force the motor to correspondingly
                                   increase or decrease its speed. Notice that if we simply control the PWM signal based
                                   on open loop logic, we are controlling the H-bridge amplifier in voltage mode. The
                                   average voltage applied across the motor terminals will be simply proportional to the
                                   PWM output signals from the microcontroller. We refer to this type of amplifier as a
                                   “voltage amplifier.”
                                5. Change the direction and magnitude of the speed under software control.

                              Closed Loop Current Control     If we can measure the current passing through the
                              motor windings, and read it back to the microcontroller, then we can use it to implement a
                              closed loop current control algorithm to decide on the PWM output. For instance,
                                                      PWM = K ⋅ (i cmd (t) − i mea (t))        (11.130)
   805   806   807   808   809   810   811   812   813   814   815