Field of the Invention
In general terms, this invention relates to driving in a commutative mode a reactive load by means of a H-bridge composed of at least four switches, controlled in pairs. More particularly, this invention is concerned with bridge control circuits when functioning in a closed-loop mode. The invention is in particularly, but not exclusively, suitable for driving DC motors.
Background of the Invention
The H-bridge stage, essentially made of four switches that are typically transistors of the bipolar or of the field effect type, is well known and widely used for driving reactive loads, as for example electric motors, solenoids or the like.
Driving in a swithing mode of such loads may occur according to an open-loop mode by employing for instance a pulse width modulation (PWM) circuit generating a periodic control signal with a variable duty-cycle for turning on/off the switches of the H-bridge. The duty-cycle of the PWM periodic signal is regulated for controlling the load. In practice, the circuit behaves as a generator of a clock or timing signal with a variable frequency so as to vary, for example, the rotation speed of a DC motor driven by the bridge.
In many applications, where at least during some phases of operation, it is necessary to control the load in a more precise and reliable way, a control feedback loop is realized by monitoring the current that flows through the load by the use of a sensing resistance connected in series to the bridge stage and comparing the voltage present on the sensing resistance by the use of one or more comparators. Typically, in a current-mode control loop, a first and second comparator are required. The first comparator is used for comparing the voltage on the sensing resistance with ground or virtual ground potential (zero crossing comparator). The second comparator is used for comparing the same voltage present on the sensing resistance with an adjustable reference voltage (sensing comparator).
In this operating mode, the turn-on fronts for the load-driving pair of switches can be provided by the same PWM circuit where such is present for implementing an open-loop mode of load control during different operating phases. By contrast, the turn-off fronts for the load-driving switches may be provided by the output of the sensing comparator.
As a matter of fact, very often the bridge control system is designed to alternatively implement an open-loop type of control or a closed-loop type of control.
This is the case for example of a DC motor used for advancing a paper ribbon through a printer. A fast page feed is implemented by driving the paper advancing motor in an open-loop mode, whereas the motor is driven in a closed-loop mode in order to exert a precise control of the line feed during printing. Of course, there are many other applications that take advantage of the possibility of commanding a control according to one or the other mode.
Often, when the system is functioning in a closed-loop mode, the switching noise generated by the bridge's switches can have an amplitude such as to cause spurious switchings. To avoid this drawback, it is a common practice to employ a number of RC filters or more generally analog lowpass filters to reject switching noise, generated at every change of state of the bridge's switches.
According to one of the many ways of driving a DC motor, the control of the four switches of a H-bridge stage implies turning on a first pair of switches during an excitation phase (Bridge.sub.-- ON), the turning on of the second pair of switches and the turning off of the first pair during a current recirculation phase (Bridge.sub.-- RIC) for discharging the energy stored in the motor winding inductance, and eventually the turning off of all the switches for setting the bridge in a so-called "tristate" condition (high impedance). Therefore, at every change of configuration of the bridge's switches, switching spikes that are eventually read by the control comparators may (if their amplitude and/or persistence is sufficient) cause false or improper switching commands. These disturbances are commonly filtered by lowpass filters having a time constant that can be adjusted in function of the type of motor or reactive load to be driven.
FIG. 1 is a basic scheme of the use of an RC lowpass filter realized by connecting external components to dedicated pins of the integrated device and to a ground node of the load supply circuit.
The use of lowpass analog filters (RC) requires at least a dedicated pin coinciding with the sensing and input node of each comparator. Of course, an alternative is that of realizing RC filter components in an integrated form within the device. This situation, apart from not allowing an adaptation of the integrated device to the specific impedance characteristics of the external load, requires a conspicuous area of integration.
On the other hand, logic filtering techniques of switching noise are commonly based on processing a certain input logic signal containing noises by means of a logic circuitry that comprises at least a delay network, necessary for producing an output logic signal coinciding with the input logic signal but free of noise. Even in this case it is necessary to employ RC delay networks or equivalents and furthermore these circuits are hardly adaptable to specific impedance characteristics of the load.
Object and Summary of the Invention
There is therefore a need and/or utility for a control system of a bridge stage driving a reactive load that may be set to function in a closed-loop mode, at least during certain phases of operation, in which the switching noise is effectively filtered and which is simple to integrate and readily adaptable to the load characteristics.
The method of this invention consists in the utilization of a signal produced by a pulse width modulation (PWM) circuit normally present and employed for driving the bridge in an open-loop mode, for masking the decay interval of the switching noise, that is of the disturbaces caused when a first pair of switches that determine a current flow in a certain direction through the bridge load switch from an OFF state to an ON state. This is achieved by keeping high for a preestablished period of time the periodic signal produced by the PWM block, varying accordingly the signal duty-cycle for regulating the masking interval (i.e. the masking time that follows the instant of switching), in function of the characteristics of the driven load.
Moreover, the method consists of masking the decay time interval of the switching noise caused when the first pair of switches are commanded to an OFF state and the other pair of switches that provide a current recirculation path for the discharge the load's reactance, are commanded to an ON state, for a preestablished number of cycles of the system's timing (clock) signal, thus impeding any further switching for the duration of this second mask.
Naturally, outside the first and second mask intervals the system maintains control of the voltage present on the sensing resistance and of the current flowing through the load according to a closed-loop mode of control. As soon as this voltage, from a negative value, reaches the zero value, the bridge is set in a so-called "tristate" condition, by commanding to an OFF state all four switches of the H-bridge stage. This prevents the bridge from causing an undue inversion of the direction of rotation as could occur when driving a DC motor.
When driving a DC motor, an eventual accidental inversion of the direction of rotation is related to a series of cofactors such as: an "excessively long" period of the PWM signal, a too low value of the reference voltage of the sensing comparator, the type of motor, etc. In any case, such an inversion may have a nonnegligible probability of occurring in many situations and this must be positively impeded to avoid a possible "loss of control" by the system.
The second mask can be implemented by an analog monostable circuit, by a prechargeable n-bit down-counter, or better still, by an n-bit up-counter, capable of counting the pulses of the timing (clock) signal, "read" by a programmable n-bit comparator capable of generating (on a programming basis) a stop signal of the masking period. This facilitates the regulation of the mask interval in function of the load characteristics.
The control system of the invention realizes in an extremely simple and efficient way a precise control of the load. The system is substantially immune to switching noise and permits the inversion of the direction of the flow of current through the load and the switching from a closed-loop mode to an open-loop mode of control and viceversa.
Brief Description of the Drawings
The various aspects and advantages of this invention will be more evident through the following description of some important embodiments and by referring to annexed drawings, where:
FIG. 1 is a basic diagram showing the use of a lowpass external filter for filtering the switching noise according to a well known technique already referred to above;
FIG. 2 is a basic block diagram of the control system of this invention;
FIG. 3 shows the diagrams of operation in a closed-loop mode of the system of this invention;
FIG. 4 is a scheme of the SIGNAL.sub.-- CONTROL block of FIG. 2 according to a first embodiment;
FIG. 5 is a scheme of the SIGNAL.sub.-- CONTROL block of FIG. 2 according to an alternative embodiment.
Description of Preferred Embodiments
With reference to the basic scheme of FIG. 2, a H-bridge is realized with four switches 1, 2, 3 and 4, driven in pairs by four logic control signals that are generated by the BRIDGE.sub.-- CONTROL block.
The load may be represented by a DC motor, connectable by the bridge's switches between a supply node Vs and a virtual ground node that is connected to the real ground node GDN through a sensing resistance Rs. Therefore, the current that flows through the load M can be constantly monitored by comparing the voltage present on the sensing resistance Rs with ground potential by a first comparator, ZERO.sub.-- CROSS.sub.-- COMPARATOR, and/or with a reference voltage Vref by means of a second comparator, SENSING.sub.-- COMPARATOR.
The bridge control block contains a logic circuitry able to process a plurality of input command logic signals. Control of the bridge operation is carried out in different modes by means of a pair of input signals of the BRIDGE.sub.-- CONTROL block, namely an ON/RIC| signal and a TRISTATE signal. For instance, when the ON/RIC| signal is high, it closes a pair of switches, for example 1 and 3, in order to excite the motor M to rotate in a certain direction (Bridge.sub.-- ON); when the ON/RIC| signal is low, it opens the switches 1 and 3 and closes the switches 2 and 4 so as to allow recirculation (Bridge.sub.-- RIC) of the discharge current of the motor winding inductance. Naturally these functions are interchangeable for driving the motor in a reverse direction.
When the TRISTATE signal is high, it turns off all four switches (1, 2, 3 and 4) of the bridge, setting the circuit in a so-called tristate (high impedance) condition.
In the example of FIG. 2, the driving system provides the possibility of driving the H-bridge stage in an open-loop mode by exploiting the PWM.sub.-- GENERATOR block that generates a periodic signal whose duty-cycle may be adjusted in such a way as to vary within a certain range of the switching frequency. As schematically shown in the figure, the PWM.sub.-- GENERATOR block, according to a common practice, may advantageously employ the system's timing signal (Clock), obtaining, by frequency division, a PWM signal having a period which is a multiple of the period of the system's timing signal. This produces a PWM signal with a reduced frequency compared with the clock frequency and whose duty-cycle may be readily regulated by appropriate circuits.
In practice, the driving of the bridge in an open-loop mode may be implemented by applying the PWM signal produced by the PWM.sub.-- GENERATOR to the ON/RIC| input pin of the BRIDGE.sub.-- CONTROL block. In other words, when operating in an open-loop control phase using the PWM generator, the SIGNAL.sub.-- CONTROL block is practically excluded.
By contrast, the SIGNAL.sub.-- CONTROL block assumes control when the system is commanded to function in a closed-loop mode, based on the use of the output signals produced by two comparators, the SENSING.sub.-- COMPARATOR and the ZERO.sub.-- CROSS.sub.-- COMPARATOR, respectively, and, according to a fundamental aspect of the invention, of the signal produced by the PWM generator block.
The masking of the switching noise produced by the system of this invention is schematically shown in the diagrams of FIG. 3.
As shown in the diagrams of FIG. 3, during a phase of operation of the control system in a closed-loop mode, the periodic signal produced by the PWM.sub.-- GENERATOR block, whose rising fronts command the turning on of the pair of switches that connect the load to the supply nodes, according to a given direction of current flow, is exploited for masking the switching transients from OFF to ON of the two switches by keeping the PWM signal high for a controlled period of time (that is by adjusting the PWM signal duty-cycle).
In other words, during such a phase of operation of the system, the PWM signal is used for masking eventual spurious switchings of the output of the SENSING.sub.-- COMPARATOR for a certain mask interval starting from the turn-on instant of the switches. This effectively prevents the SIGNAL.sub.-- CONTROL block from unduly commanding a change of state of the bridge switches as a consequence of spurious switchings of the comparator that compares the voltage on the sensing resistance Rs terminals with the reference voltage Vref. This could happen when operating with a particularly low Vref value.
As long as the PWM signal remains high, the SIGNAL.sub.-- CONTROL block maintains such a conducting configuration of the bridge (Bridge.sub.-- ON). Obviously, the duration of the masking time interval, established by regulating the PWM signal, determines the minimum turn-on time interval of the bridge.
If the first temporal mask, established by means of the PWM signal, has elapsed, when the voltage on the sensing resistance Rs reaches the value of the reference voltage Vref, the SIGNAL.sub.-- CONTROL block commutes the bridge in a current recirculation configuration for allowing the discharge of the energy stored in the inductance of the motor winding. At this point, the current that flows through the sensing resistance Rs reverses its direction due to the electrical load inertia. Therefore, the voltage on the noninverting input of the ZERO.sub.-- CROSS.sub.-- COMPARATOR becomes negative.
Even during this change of phase, spurious pulses may occur, and for this reason a second masking operation is performed by the signal control block that generates a temporal interval having a programmable duration as soon as the bridge commutes to a current recirculation configuration. In practice during this second mask interval, the control is made independent from the actual state of the ZERO.sub.-- CROSS.sub.-- COMPARATOR output, and the bridge remains configured in a current recirculation mode even if the voltage on the sensing resistance Rs becomes positive.
When this second temporal mask elapses, the system maintains control of the voltage present across the sensing resistance Rs terminal. Therefore, as soon as this voltage reaches the null value, the bridge is brought to a state of high impedance (TRISTATE) by commanding into an OFF state all four switches. This prevents the motor from unduly reversing its rotation.
A first embodiment of the SIGNAL.sub.-- CONTROL block is shown in FIG. 4.
When the PWM signal is high, it forces the flip-flop FF-SR1 to a "set" state (thanks also to the presence of the gate AN1) in such a way that the Bridge.sub.-- ON output is high, thus determining the turning on of the bridge.
Through the NQ output of the FFSR1 flip-flop, the MASK.sub.-- GENERATOR and the FF-SR2 flip-flop are forced to a "reset" state.
When the PWM signal becomes low, the FF-SR1 flip-flop remains in a set state until the SENSE.sub.-- Comp signal becomes high. At this point, the FF-SR1 is reset and the MASK.sub.-- GENERATOR counter is free to evolve, generating the ZERO.sub.-- CROSS Mask Time interval shown in FIG. 3. The duration of this mask interval can be programmed in function of the load characteristics, in order to mask the noise spikes caused by the switching. During the counter evolution, the TimeOUT output remains low (as during the preceding reset phase) so that eventual noise spikes on the ZERO.sub.-- CROSS.sub.-- COMPARATOR input cannot bring the FF-SR2 flip-flop to a set state, thanks to the AN2 gate. When the TimeOut signal becomes high (that is at the end of the mask interval), FF-SR2 is free to reach a set state and may therefore drive the bridge into a high impedance configuration (Bridge.sub.-- TRISTATE) as soon as the current flowing through the load reverses its sign (ZERO.sub.-- CROSS.sub.-- COMPARATOR=1).
As will be evident to a skilled person, the SIGNAL.sub.-- CONTROL block can be realized in different ways. In particular, it is possible to eliminate the AN1 gate by using a flipflop of the SR type, intrinsically a "Dominant Set" circuit. In addition, even the circuit that generates the masking signal, MASK.sub.-- GENERATOR, can be realized in various ways, for example with an analog monostable circuit
When a system's clock signal is available and normally used by the PWM.sub.-- GENERATOR block, it is possible to use a counter for generating a mask interval. To program the mask interval, it is possible to preload a "down-counter" with a certain value during the reset phase and advantageously use the "carry" signal output, which will become high when the counter finishes its counting back to zero. This solution, based on the use of a preloadable down-counter can be dangerous in some applications, since the preload and clock signals are a synchronous, and therefore the "set-up" and "hold" times of the counter flip-flops might be violated.
A particularly preferred solution is that shown in FIG. 5.
According to this embodiment, the mask generating circuit is formed by an n-bit "up-counter" and an n-bit comparator. During the reset phase, the counter is set to an initial state (for example with all outputs set to zero) and so is the output of the FF-D1 flip-flop. When the reset phase terminates, the counter increments its output at every clock pulse until it reaches the programmed value established for the second comparator data input.
At this point, the comparator output does high and so becomes the output of the FF-D1 flip-flop at the following usable front of the clock signal. Thanks to the gate NA1, the FF-D1 output will remain high until a new phase of reset, so that said output can be used exactly as a TimeOut signal of the circuit of FIG. 3.
This embodiment of the masking signal generator is very reliable because even if the flip-flops timing conditions of "set-up" and "hold" are not complied with, there are not spurious effects because the flip-flops have an input that corresponds in value to their respective output (because an up-counter that starts from a reset state is being used), with the exception of the first flip-flop, which in any case might enter a metastable state wherefrom it will most probably exit at the successive front of the clock signal.