Step control of DC motor. Transistor motor control in microcontroller circuits. Diagram with a midpoint

Volodymyr Rentyuk, Zaporozhye, Ukraine

The article provides a brief overview and analysis of popular circuits designed to control brushed DC motors, as well as offers original and little-known circuit solutions.

Electric motors are probably one of the most popular products of electrical engineering. As the omniscient Wikipedia tells us, an electric motor is an electric machine (electromechanical converter), in which electrical energy is converted into mechanical energy. The beginning of its history can be considered the discovery that Michael Faraday made back in 1821, establishing the possibility of a conductor rotating in a magnetic field. But the first more or less practical electric motor with a rotating rotor waited until 1834 for its invention. It was invented by Moritz Hermann von Jacobi, better known to us as Boris Semenovich, while working in Königsberg. Electric motors are characterized by two main parameters - the speed of rotation of the shaft (rotor) and the torque developed on the shaft. In general, both of these parameters depend on the voltage supplied to the motor and the current in its windings. Currently, there are quite a lot of varieties of electric motors, and since, as our well-known literary character Kozma Prutkov noted, the boundless cannot be embraced, we will dwell on the consideration of the features of controlling DC motors (hereinafter referred to as electric motors).

There are two types of DC motors - these are commutator motors familiar to us and brushless (stepper) motors. In the first, an alternating magnetic field, which ensures the rotation of the motor shaft, is formed by the rotor windings, which are powered through a brush commutator - a collector. It interacts with the constant magnetic field of the stator, rotating the rotor. For the operation of such engines, external switches are not required, their role is played by the collector. The stator can be made both from a system of permanent magnets and from electromagnets. In the second type of electric motor, the windings form the fixed part of the motor (the stator), and the rotor is made of permanent magnets. Here, an alternating magnetic field is generated by switching the stator windings, which is performed by an external control circuit. Stepper motors ("stepper motor" in English spelling) are much more expensive than collector motors. These are quite complex devices with their own specific features. Their full description requires a separate publication and is beyond the scope of this article. For more information on engines of this type and their control schemes, you can refer, for example, to.

Collector motors (Figure 1) are cheaper and generally do not require complex control systems. For their functioning, it is enough to supply a supply voltage (rectified, constant!). Problems begin to arise when it becomes necessary to adjust the speed of rotation of the shaft of such an engine or in a special torque control mode. There are three main disadvantages of such engines - a small torque at low speeds (therefore, a gearbox is often required, and this affects the cost of the design as a whole), the generation of a high level of electromagnetic and radio interference (due to sliding contact in the collector) and low reliability (more precisely, small resource; cause in the same collector). When using collector motors, it must be taken into account that the current consumption and the speed of rotation of their rotor depend on the load on the shaft. Brushed motors are more versatile and more widely used, especially in low cost applications where price is the determining factor.

Since the speed of rotation of the collector motor rotor depends, first of all, on the voltage supplied to the motor, it is natural to use circuits for its control that have the ability to set or adjust the output voltage. Such solutions that can be found on the Internet are circuits based on adjustable voltage regulators and, since the age of discrete regulators has long passed, it is advisable to use inexpensive integral compensation regulators for this, for example,. Possible options for such a scheme are shown in Figure 2.

The scheme is primitive, but it seems very successful and, most importantly, inexpensive. Let's look at it from an engineer's point of view. First, is it possible to limit the torque or current of the motor? This is solved by installing an additional resistor. In Figure 2 it is labeled R LIM . Its calculation is available in the specification, but it worsens the performance of the circuit as a voltage regulator (more on this below). Secondly, which of the speed control options is better? The option in Figure 2a gives a convenient linear control characteristic, which is why it is more popular. The option in Figure 2b has a non-linear response. But in the first case, if the contact in the variable resistor is broken, we get the maximum speed, and in the second - the minimum. Which one to choose depends on the specific application. Now consider one example for a motor with typical parameters: operating voltage 12 V; maximum operating current 1 A. LM317 IC, depending on the suffixes, has a maximum output current from 0.5 A to 1.5 A (see specification; there are similar ICs with higher current) and advanced protection (against overload and overheating). From this point of view, it suits our task perfectly. Problems are hidden, as always, in the details. If the engine is brought to maximum power, which is very realistic for our application, then on the IC, even with the minimum allowable difference between the input voltage V IN and the output V OUT equal to 3 V, power will be dissipated at least

P = (V IN - V OUT) × I = 3 × 1 = 3 watts.

Thus, a radiator is needed. Again the question is - to what power dissipation? At 3 watts? And here it is not. If you are not too lazy and calculate the IC load graph depending on the output voltage (this is easy to do in Excel), then we get that under our conditions, the maximum power on the IC will be dissipated not at the maximum output voltage of the regulator, but at an output voltage of 7.5 V ( see Figure 3), and it will be almost 5.0 W!

As you can see, it turns out something is no longer cheap, but very cumbersome. So this approach is suitable only for low-power motors with an operating current of no more than 0.25 A. In this case, the power on the regulating IC will be at the level of 1.2 W, which will already be acceptable.

The way out is to use the method of pulse-width modulation (PWM) for control. It is indeed the most common. Its essence is the supply of unipolar rectangular pulses modulated in duration to the engine. According to the theory of signals, in the structure of such a sequence there is a constant component proportional to the ratio τ/T, where: τ is the pulse duration, and T is the period of the sequence. It is she who controls the speed of the engine, which distinguishes her as an integrator in this system. Since the output stage of a PWM-based regulator operates in a key mode, as a rule, it does not need large radiators to remove heat, even at relatively large motor powers, and the efficiency of such a regulator is incomparably higher than the previous one. In some cases, you can use buck or boost DC / DC converters, but they have a number of limitations, for example, in terms of the depth of adjustment of the output voltage and the minimum load. Therefore, as a rule, other solutions are more common. The "classic" circuit design of such a regulator is shown in Figure 4. It is used as a throttle (regulator) in a professional model railway.

An oscillator is assembled on the first operational amplifier, a comparator on the second. The signal from the capacitor C1 is fed to the input of the comparator, and by adjusting the response threshold, a rectangular signal with the desired ratio τ/T is formed (Figure 5).

The adjustment range is set by trimming resistors RV1 (faster) and RV3 (slower), and the speed control itself is carried out by resistor RV2 (speed). I draw the attention of readers to the fact that a similar scheme is circulating on the Internet in Russian-language forums with errors in the ratings of the divider that sets the threshold of the comparator. The engine is directly controlled through a key on a powerful field-effect transistor of the type. The features of this MOSFET type transistor are a large operating current (30 A DC, and up to 120 A pulse), an ultra-low open channel resistance (40 mΩ) and, consequently, a minimum power loss in the open state.

What should be the first thing to pay attention to when using such schemes? First, it is the execution of the control circuit. Here in the scheme (Figure 4) there is a small flaw. If over time there are problems with the moving contact of the variable resistor, we will get a complete almost instantaneous acceleration of the engine. This may damage our device. What is the antidote? Install an additional sufficiently high-resistance resistor, for example, 300 kΩ from output 5 of the IC to a common wire. In this case, if the regulator fails, the engine will be stopped.

Another problem with such regulators is the output stage or motor driver. In such circuits, it can be performed both on field-effect transistors and on bipolar ones; the latter are incomparably cheaper. But both in the first and in the second option it is necessary to take into account some important points. To control a MOSFET type field effect transistor, it is necessary to provide charge and discharge of its input capacitance, and it can be thousands of picofarads. If the resistor in series with the gate (R6 in Figure 4) is not used or its value is too low, the op-amp can fail at relatively high drive frequencies. If you use R6 of a large denomination, then the transistor will stay in the active zone of its transfer characteristic longer and, therefore, we have an increase in losses and heating of the key.

One more note to the circuit in Figure 4. The use of an additional diode D2 makes no sense, since the structure of the BUZ11 transistor already has its own internal protective high-speed diode with better characteristics than the proposed one. Diode D1 is also clearly superfluous, the BUZ11 transistor allows the supply of a gate-source voltage of ± 20 V, and polarity reversal in the control circuit with a unipolar supply, as well as voltages above 12 V, are impossible.

If a bipolar transistor is used, then the problem arises of generating a sufficient base current. As you know, to saturate a switch on a bipolar transistor, its base current must be at least 0.06 of the load current. It is clear that the operational amplifier may not provide such a current. For this purpose, in a similar, in fact, regulator, which is used, for example, in the company's popular mini-engraver PT-5201, a transistor is used, which is a Darlington circuit. Here is an interesting point. These mini-engravers sometimes fail, but not due to overheating of the transistor, as one might assume, but due to overheating of the IC (maximum operating temperature +70 ° C) by the output transistor (maximum allowable temperature +150 ° C). In the products used by the author of the article, he was pressed close to the IC body and put on glue, which unacceptably heated the IC and almost blocked the heat sink. If you come across such a performance, then it is better to “unstick” the transistor from the IC and bend it as much as possible. For this know-how, the author of the article was awarded a set of tools by Pro'sKit. As you can see, everything needs to be solved as a whole - look not only at the circuitry, but also be attentive to the design of the regulator as a whole.

There are some more interesting circuits for simpler PWM controllers. For example, two circuits based on a single driver op-amp are published in [

To begin with, let's take a closer look at a conventional DC motor. Any engine has two main parts - a rotor and a stator. In a collector motor, the stator is a fixed part, it consists of permanent magnets (or in more powerful electromagnet motors). Rotor (armature) - rotates, is combined with the motor shaft and consists of many coils (at least three). The collector (brush-collector assembly) is responsible for switching the outputs of the rotor coils. The current in such a motor is supplied to the rotor coils through sliding contacts (or brushes). Only one coil is connected at a time, and it creates the torque of the engine due to the passing current.

From the point of view of the basic elements of circuitry, any engine can be represented as the following equivalent circuit:


When the motor is connected to a DC source and has not yet begun to rotate, it is a normal resistance. That is, current flows through it according to Ohm's law and the resistance of its winding. The R component predominates. The inductance starts to affect when the voltage is not constant, for example, if the motor is powered by a PWM signal.

The rotor resistance and inductance are generally very small. It can be measured with an ordinary multimeter. Small model motors have a resistance of 1-10 ohms. Therefore, at the start of the motor (when it has not yet begun to rotate), the current greatly exceeds the operating current of the motor, and if the motor is stationary for a long time (it is jammed), then such a high current can lead to overheating of the motor and failure.

The inductance of the rotor coils tries to keep the current flowing through the windings constant. Its effect is noticeable only when the voltage changes. When the motor starts to rotate, the collector begins to switch the rotor coils, which causes a voltage change. The inductance tries at these moments to keep the current flowing through the motor at a constant level due to the voltage.

During the rotation of the rotor coil, they begin to generate current (like a generator) - a back EMF occurs. The faster the rotor rotates, the higher the back EMF that occurs in the coils, and since it is directed against the supply voltage, the current consumed by the motor decreases.

In what follows, we will need the following conclusions:

    until the motor starts to rotate it is a resistance

    if you apply a changing voltage to the motor (for example PWM), then the inductance will have a big effect, it will resist the change in current through the motor

    when the motor rotates, it is a generator, and due to this, the current consumption is reduced (the resulting voltage is V - Vbemf).

How to connect the motor to the MK

In this article, we will understand how to use the MK to control the speed and direction of rotation of a conventional DC motor.

In order for the DC collector motor to start rotating, it is enough to apply a certain voltage to it. The polarity of this voltage will determine the direction of its rotation, and the magnitude of the voltage - the speed of rotation. Voltage cannot be changed indefinitely. Each motor is designed for a certain voltage range. When the voltage rises, the current through the motor will increase, and it will begin to overheat and may burn out. The following graph of a certain motor clearly shows the relationship between its main indicators.


The maximum power (Torque - torque) the motor reaches at maximum current. And the dependence of current and torque is linear. The engine reaches its maximum speed when there is no load (at idle), with an increase in load, the rotation speed drops. The rated operating voltage is indicated in the passport for the engine, and this graph is also given for it. If you reduce the voltage, then the rotation speed, and all other indicators will also fall. As a rule, below 30-50% of the rated voltage, the motor will stop rotating. If the motor cannot turn the shaft (it is jammed), then in fact it will become resistance and the current consumed reaches the maximum value, depending on the internal resistance of its windings. A conventional motor is not designed to operate in this mode and may burn out.

Let's see how the current changes from the load on a real R380-2580 motor.


We see that the operating voltage of this motor is 12V, the current consumption under load is 1.5A. The motor stop current rises to 8A, and in idle rotation, the current consumption is only 0.8A.

As we know, the microcontroller port cannot deliver more than 50mA, and the 12V supply voltage is too high for it. To control the motors, we need an electronic key - a transistor, take a regular NPN bipolar transistor and connect it according to the following wrong scheme.


In order for the motor to start rotating, a small current must be applied to the base of the transistor, then the transistor will open and be able to pass much more current and voltage through itself - the motor will rotate. It is worth noting that if we assemble such a scheme, then the transistor will fail very soon, if not immediately. To prevent this from happening, it must be protected.

As we already know, one of the components of the motor - inductance - resists a change in current. Therefore, when we close the transistor to turn off the motor, the resistance of the transistor will increase sharply and it will stop passing current through itself. However, the inductance will resist this, and in order to keep the current at the same level, according to Ohm's law, the voltage on the collector of the transistor will begin to rise sharply (it can even reach 1000V, though for a very short time) and the transistor will burn out. To prevent this from happening, it is necessary to put a diode in parallel with the motor windings, which will open the way for reverse voltage and close it on the motor winding, thereby protecting the transistor.

Also, all permanent motors have one more trouble - during rotation, the mechanical contact in the collector is not ideal, the brushes spark during operation, creating interference, which can lead to a microcontroller failure. To reduce this interference, it is necessary to use small capacitors connected in parallel with the motor leads (as close as possible to the motor itself). Here is the final correct circuit (diode may not necessarily be Schottky, but it is preferred).


Bipolar transistors in the open state, they behave like diodes (about 0.7 V falls on them). And this, in turn, causes them to heat up at high currents and reduces the efficiency of the motor control circuit. Therefore, it is better to control motors with field-effect (MOSFET) transistors. Currently, they are quite common and have a low price. Their low on-resistance allows them to switch very high currents with minimal losses. However, they also have their drawbacks. Since MOSFETs are voltage driven, not current driven (and typically 10V), you either need to select custom logic MOSFETs that can be driven as low as 1.8..2.5V or use dedicated voltage pump circuits (FET drivers). How to choose a MOSFET for your circuit, we will consider in other articles, on specific devices.

Now, by supplying a logical unit to the output of the microcontroller, we will make the motor rotate, and the logical zero will stop. However, it will rotate at a constant speed and only in one direction. I would like to be able to change the direction of rotation of the motor, as well as its speed. Consider how this can be achieved using a microcontroller.

H-Bridge - change the direction of rotation of the motor

To control the direction of rotation of the motor, there is a special circuit called the H-bridge (the circuit looks like the letter H).


In the H-bridge circuit, N-channels are always used as the lower transistors, but the upper ones can be either N-channel or P-channel. P-channel transistors in the upper key are easier to control, it is enough to make a bias voltage level circuit at the gate. To do this, you can use a low-power N-channel field-effect or bipolar transistor. The lower transistor can be controlled directly from the MK if you choose a special logic field effect transistor.

If your circuit will use a high-voltage DC motor (more than 24V) or a powerful motor with currents greater than 10A, then it is better to use special microcircuits - MOSFET transistor drivers. Drivers are controlled, as a rule, by microcontroller signals from 2 to 5V, and at the output they create the voltage necessary for the full opening of MOSFET transistors - usually 10-15V. The drivers also provide a large pulse current necessary to accelerate the opening of field-effect transistors. With the help of drivers, it is easy to organize the control of the upper N-channel transistor. A very good driver is the L6387D chip from ST. This chip is good because it does not require a diode for the voltage pump circuit. This is how it is connected to control the H-bridge on 2 N-channel transistors.


N-channel field-effect transistors are cheaper than P-channel ones, and also have lower on-state resistance, which allows switching high currents. But they are more difficult to manage in the up position. The problem with using an N-channel transistor in the upper switch is that to open it, you need to apply a voltage of 10V relative to the Source, and as you can see in the diagram, there can be all the motor supply voltage, not 0 volts. Thus, 10V + motor supply voltage must be applied to the base. You need a special bootstrap circuit to increase the voltage. Usually, for these purposes, a voltage pump circuit is used on a capacitor and a diode. However, such a circuit only works if you constantly recharge the capacitor - by opening, closing the lower transistor (in PWM control). To be able to keep the upper transistor constantly open, it is necessary to further complicate the circuit - to add an external capacitor feed circuit. Here is an example of an N-channel transistor driving circuit without the use of driver ICs.


Let's move on to controlling the speed of rotation of the motor.

PWM signal - control the speed of rotation of the motor

DC motors have a linear relationship between the speed of rotation and the applied voltage. Thus, to reduce the speed of rotation, it is necessary to apply less voltage. But we must remember that with a drop in voltage, the power of the motor drops. Therefore, in practice, the motor speed can only be controlled within 30%-50% of the full motor speed. To control the speed of the motor without loss of power, feedback from the motor on the rotational speed is necessary, for example, as in an electric screwdriver. This control mode requires a more complex circuit. We will consider a simple option - motor speed control without feedback.

So, we need to change the voltage supplied to the motor. We have a MOSFET transistor at our disposal. We remember that our motor has an inductance. An inductor resists a change in current. And if you quickly turn on and turn off the voltage on the motor, then at the moment of turning off the current will continue to flow due to the inductance. And the motor will continue to rotate by inertia, and will not stop. But naturally, it will rotate more slowly, the average voltage on its windings will be lower.

The microcontroller, just perfectly able to generate a pulsed PWM (PWM) signal. And the motor is able to integrate this signal (average) due to the inductance of the windings and the inertia of the rotor. The average voltage received by the motor, and hence the speed, will depend on the duty cycle (duty factor) of the PWM signal.

What PWM frequency is needed for better motor control? The answer is very simple, the more the better. The minimum frequency depends on the inductance of the motor, as well as the mass of the rotor and the load on the motor shaft. If we simulate PWM motor control in an electrical simulator (for example, PROTEUS), it will be seen that the higher the PWM frequency, the more even the current flows through the motor (ripple current - decreases with increasing frequency). Low frequency:


high frequency:


If the frequency drops below a certain level, the current will become discontinuous (it will drop to zero) and as a result the motor will not be able to spin.


Great, it's simple! We make the PWM frequency higher, for example 1 MHz, and any motor will have enough. In life, everything is not so simple. To understand all the possible problems, we can simply take the gate of a MOSFET as an ideal capacitor. In order for the transistor to fully open, the capacitor must be charged to 10V (actually less). The more current that we can pump into the capacitor, the faster it will charge, which means the transistor will open faster. In the process of opening the transistor, the current and voltage on it will be maximum, and the longer this time, the more the transistor will heat up. The datasheet usually has such a parameter as Qgate - the full charge that must be transferred to the transistor in order for it to open completely.


The inductance of the motors is not so small, and such high frequencies are not needed. To control DC motors, 8 kHz is enough, preferably about 20 kHz (outside the audio range).

Additionally, it is worth noting that in order to reduce the starting current, it is necessary to smoothly raise the PWM frequency at the start. And yet - it is better to control the starting current of the motor using current sensors.

PWM motor control involves a very fast change in voltage from 0 to maximum, which creates big problems when tracing the board. Let us briefly list the rules that must be observed when tracing the board.

    The grounds for controlling the motors and the microcontroller must be separated, connected at one point with a thin conductor, for example 0.3mm, as close as possible to the power wires of the entire circuit

    MOSFET drivers should be as close as possible to the MOSFETs themselves.

    The execution of the control area is necessarily double-sided, preferably with an earth layer on one side. In impulse control, electromagnetic interference occurs, in order to reduce it, the ground layer must be nearby.

    Be sure to have a capacitor as close as possible to the zone of passage of large impulse currents. If there is no such capacitor, then the voltage on the power line will strongly sag and the microcontroller will constantly reset. Also, without such a capacitor, due to the inductance of the power wires, the voltage on the power line can increase several times and the components will fail!

In more detail, we will consider how these rules work on specific devices.

PWM signal in H-bridge

Let's see how the control circuit affects the heating of our electronic keys. Let's say that we control the motor with a PWM signal with a duty cycle of 50% and the motor spins in one direction.

The easiest option is to apply a PWM signal to one of the two transistors, and leave the other open all the time. Usually, PWM in this case is applied to the lower transistor (N type), which is usually faster. In this case, the heating of the lower one will be greater than the upper one by the amount of heat released during switching of the transistor. To equalize the score, you can alternately apply a PWM signal either to the upper (if they are the same), then to the lower transistor. It is also possible to apply PWM to both transistors at the same time, but due to the difference in transistors, this will not be effective, and will also increase heating by switching transistors. With this control scheme, the other two transistors work as diodes. Fortunately, the highest current through the diode will be at the highest PWM duty cycle, while the diode will be on for a very short time.

To eliminate the current through the diodes, which give significant heating, you can never disconnect the motor from the voltage, but instead, turn it in the opposite direction. Thus, we must, for example, turn 70% of the PWM signal to the right, and 30% to the left. This will result in a total of 70%-30%=40% speed to the right. But the diodes will not be involved. This method of management is called complementary. Such a circuit requires a large capacitor on the power line, as well as a power source that can draw current (such as a battery).

Instead of rotating the motor in different directions, you can help the diodes - namely, slow down the motor, open the two upper transistors at the moment of a low PWM signal level. In practice, all these methods do not give a significant change in the engine speed, but allow you to effectively control the heating of field-effect transistors. More details about the features of various control schemes can be found in this article.

This concludes our article about motors. Now we can move on to practice - we will do it for the robot.

In the past, traction systems used pulse-controlled open-loop controllers to control DC motors. At present, only asynchronous motors are mainly used in traction systems.

In low power systems, and especially in servo systems, closed-loop pulse control is common. The most widely used DC motors with permanent magnets. There are also motors with independent excitation, but in this article only permanent magnet motors will be considered.

Permanent Magnet DC Motor

In small DC motors, the magnetic field is usually generated by ceramic permanent magnets. It is clear that the characteristics of such motors are similar to those of motors with an excitation winding. But permanent magnet motors have better performance:

Note: Torque-speed curve (fig. 1).

For DC motors, the following dependencies can be specified:



In this way:


For DC motors is a constant value, therefore:

Single Quadrant Drive

The DC motor control circuit uses a PWM inverter with a controller.

Rice. 2. Controlled single quadrant drive

Two-quadrant work

On fig. 3 shows a bridge circuit for driving a DC motor. Such a scheme is often used in the power stage for controlling servo motors and stepper motors. The bridge circuit can also be used in linear servo amplifiers, but for efficiency reasons it is only really used to drive small motors. Basically, the transistors work like switches and are controlled by the PWM of the servo amplifier.

These switches work in pairs: T1-T4 and T2-T3. When T1-T4 are closed and T1-T3 are open, the armature current flows to the right. The motor rotates, for example, clockwise. With T2-T3 closed and T1-T4 open, the motor will rotate counterclockwise. A bridge in driver mode can work in two directions.

Rice. 3. Bridge DC motor control circuit

Basically, the bridge circuit for controlling a DC motor has two options, which are called unipolar and bipolar PWM. On fig. 4 shows a possible waveform for a unipolar PWM.

The voltage on the motor during one cycle varies from 0 to V (from + to +V and from 0 to -V). Two switches are used: T1-T4 or T2-T3.

With a bipolar PWM signal (fig. 5), four switches are used for one direction of rotation of the motor. The voltage on the motor varies from +V to -V, the average value of the voltage determines the direction of rotation of the motor.

Rice. 4. DC motor control - unipolar PWM signal.

Rice. 5. DC motor control - bipolar PWM signal.

As an example, we will consider the operation of a bridge circuit for controlling a DC motor using a widely used unipolar PWM.

Rice. 6(a) illustrates the case with T1-T4 closed and motor rotation clockwise. Now there are two options for transistor control: either one switch remains closed (for example, T1) and the second is controlled by pulse-width regulation (T4), or both switches (T1 and T4) are controlled by PWM regulation - fig. 6(c). To begin with, consider the operation when T1 is closed and T4 is controlled by PWM regulation.

When T4 is open - fig. 6(b) - we have:

It is necessary to use protective diodes for this transistor. In the case shown in Fig. 6(b), EMF e will provide current through D3 and T1. Diode D3 will protect transistor T4. With other switching options, it will be necessary to protect other transistors, i.e. all four transistors will have protective diodes: D1, D2, D3, D4.

Another option is when both switches T1 and T4 are turned off at the same time (controlled by PWM regulation). At the moment of closing the transistors - fig. 6(c) - EMF e will cause energy to flow through diodes D2 and D3 to the Vcc source. This is also true for the case shown in Fig. 6(b) at the moment when T1 opens (simultaneously with T4). Obviously, diode D2 is needed.

Motor rotation control in reverse direction is similar, but transistors T2-T3 work instead of T1-T4.

Note:

  1. From the DC motor bridge circuit shown in the diagrams in fig. 6 (a, b, c), the possibility of two-quadrant control can be noted.
  2. When using bipolar PWM, it is possible to quickly change the direction of rotation of the motor, good dynamics. Unipolar PWM provides less current ripple in the motor armature at the same carrier frequency and average current value.


Rice. 6. Bridge circuit for DC motor control using unipolar PWM

Pulse control of a DC motor with series excitation

Until 1990, DC motors were used in many countries as traction drives (trains, trams, subways). Inverters, DC and AC sources and controlled rectifiers were used for control. In addition to the main task of driving the traction motor, inverters were also used to work with external accessories (for example, to control fans for cooling traction motors). The power of the inverters ranged from hundreds of kilowatts to several megawatts.

In modern systems, IGBTs (Insulated Gate Bipolar Transistors) are used to switch electricity and control traction motors. Motor control is implemented using microcontrollers. Three-phase asynchronous motors are mainly used.

Traction systems

On fig. 7 shows the inverter as a mechanical switch. The operating mode δ of the inverter determines the average value:

Determines the rotation speed of the motor.

Rice. 7. Schematic diagram of DC motor control using an inverter.

Current change Δi is defined by the expression:

It's obvious that Δi a= 0 at δ = 0 or at δ = 1.

Maximum value Δi a how the independent quantity can be found:

At δ = 0.5 and = inverter frequency, we get:

(1)

From formula (1) it follows that the range of motor current ripples (Δi a)max will be less if:

  1. Inverter frequency will be more
  2. Self-induction will be more

When using inverters with too low a frequency, it is necessary to include large and expensive electric chokes in the circuit.
High inverter frequency increases losses:

  • In semiconductors from which the inverter is made;
  • In protection circuits for these semiconductors;
  • In the motor itself (losses due to the variable current component).

In normal use of the thyristor inverter, the off time should be at least five times the dead time of the thyristor.

If too high an inverter frequency is used, the maximum value of δ is limited. In this case, most of the electricity from the power source cannot be supplied to the motor.

Note:

Normally, during braking, the series-wound DC motor acts as a generator.

Line filter

When batteries are used as the power source (internal impedance = 0), the inverter can be powered without any problems.

When power is applied through a contact wire, self-induction LR through this wire:

  1. significantly limit the current rise time on the inverter switch;
  2. generate a high self-induction voltage on the inverter switch.

To neutralize these negative phenomena, it is necessary to include at least one inductive-capacitive filter (L1C1 in Fig. 8) in the circuit.

Rice. 8. Self-induction on the contact wire and the input filter of the traction device.

CapacityC1: allows you to absorb current ripples without self-induction of the circuit, limiting the rate of current rise. The tank works as an energy storage. In addition, capacitance reduces the level of overvoltage at the input of the inverter. This overvoltage can occur for two reasons:

  1. overvoltage may be on the contact wire;
  2. overvoltage resulting from switching off inverter current.

CoilL1 : allows you to limit fluctuations in the contact wire so that other consumers of this contact wire will not experience problems that may result from current ripples during intermittent operation. Such intermittent currents in the overhead wire and rail can interfere with telecommunication control circuits.

The capacitance C1 together with the inductance LR+L1 forms a series resonant circuit with a resonant frequency:

(2)

Shared with inverter frequency fc, which is equal to or less than the frequency f1, this frequency can cause large voltage fluctuations. In practice, this occurs when fc > 2*f1 or even fc > 3*f1.

In addition, it is necessary to take into account the fact that LR is a variable depending on the distance between the main switchgear and the consumer.

In order for a DC motor to start rotating, it needs to provide the right amount of energy. As a rule, a few watts are sufficient for low-power motors. The control unit (microcontroller), which makes decisions about starting the engine, cannot directly control the engine, that is, provide the necessary power from its output. This is due to the fact that the ports of the microcontroller have a very limited load capacity (the maximum current at the output of the microcontroller is usually no more than 20 mA).

Therefore, a power amplifier is needed - a device that can generate a signal at its output with a power greater than the power at its input. These devices are the transistor and relay, which are great for driving a DC motor.

The simplest way to drive the motor is shown below:

Stepper motor control

Stepper motors, like commutator motors, consist mainly of coils. That is, for rotation, you need to pass current through the coils. Thus, all of the presented motor control schemes can be used for. (all except H-bridge)
The difference in power amplifier circuit for stepper motors is that there are slightly different voltages and currents, and also basically 4 switches per motor are required (when the motor has five pins).

The rated operating voltage is mainly in the range of 9 - 24 V. With such not small voltages, we are also dealing with a large current: 0.3 - 1A per phase! Below is an example of connecting a 5-pin stepper motor:

In the role of keys, we can also use MOSFETs - transistors. This is an even simpler solution.
Since we need up to 4 transistors, which take up quite a lot of space on the board, a good solution would be to use a chip.

An electric motor is a machine that converts electrical energy into mechanical energy. The first electric motors appeared in the middle of the 19th century. Successes in their development are associated with the names of such outstanding physicists and engineers as N.Tesla, B.Jacobi, G.Ferraris, W.Siemens.

There are electric motors of direct and alternating current. The advantage of the former lies in the possibility of economical and smooth regulation of the shaft speed. The advantage of the latter is a large specific power per unit weight. In microcontroller practice, low-voltage DC motors are often used, used in household and computer fans (Table 2.13). There are also designs with network engines.

Table 2.13. Parameters of Sunon Fans

The motor winding should be considered as a coil with a large inductance, so it can be switched with ordinary transistor switches (Fig. 2.78, a ... t). The main thing is not to forget about protection against self-induction EMF.

In DC motors, it is possible to change the direction of rotation of the rotor depending on the polarity of the operating voltage. In such cases, bridge circuits "H-bridge" are widely used (Fig. 2.79, a ... and).

(Start):

a) air flow control of fan M1. Capacitor C/ reduces RF interference. Diode VD1 protects the transistor VT1 from voltage surges. Resistor R1 determines the degree of saturation of the G77 transistor, and resistor R2 closes it when MK is restarted. The frequency of the PWM pulses at the output of the MC must be at least 30 kHz, i.e. outside the audio range to eliminate unpleasant "whistling". Elements C/ and R2 may be absent;

b) smooth regulation of the rotational speed of the motor shaft M1 through the PWM channel. Capacitor C/ is the primary, and capacitor C2 is the secondary filter of PWM signals; O

Rice. 2.78. Wiring diagrams for electric motors through transistor switches

(continuation):

c) transistors VT1, VT2 are connected in parallel to increase the total collector current. Resistors R1, R2 provide a uniform power load on both transistors, which is associated with a spread in their coefficients AND 2] E and VAC of the base-emitter transitions;

d) The M1 motor (Airtronics) has a "digital" control input, which allows you to connect MK directly to it. Transistor keys (drivers) are inside the motor;

e) two separate power supplies can significantly reduce the effect on MK of electrical noise generated by the M1 motor. The system will work more stable. GB1 is a low power lithium battery, GB2, GB3 are AA batteries with a total voltage of 3.2V and enough power to start and run the motor M1\

f) Parallel resistors R2, R3 serve as current limiters for the motor M1. In addition, they stabilize the current in the load if the transistor VT1 is in active mode or on the verge of entering saturation mode;

g) MK turns on/off the motor M1. Resistor R3 adjusts the speed of its shaft. The stabilizer is a "tape" chip DA1 from Panasonic. With its help, constant parameters are maintained at the terminals of the M1 motor, which are practically independent of fluctuations in temperature and supply voltage;

h) chokes L7, L2 and capacitors C7, C2 filter radio interference emitted by the engine. For the same purpose, the motor is placed in a grounded shielded case;

Rice. 2.78. Wiring diagrams for electric motors through transistor switches

(continuation):

i) The vibration motor M1 is a source of strong electromagnetic and radio frequency interference. The elements L/, L2, C1 serve as filters. Resistor R2 limits the starting current through two open transistors VT1. Diodes VD1, UA2 cut off the peaks of impulse noise;

j) Elements VD1, C1 and VD2, &2 filter power supply noise generated by motor M1 towards MK. The speed of the motor shaft can be smoothly adjusted through the PWM channel MK, while a separate low-pass filter is not required, since the motor has a large inertia and smoothes the RF current pulses passing through it;

l) the use of a key on a field-effect transistor VT1 increases the efficiency compared to a key on a bipolar transistor, due to the lower drain-source resistance. Resistor R1 limits the amplitude of pickups that can "leak" from a running engine M1 into the internal circuits MK through the "gate - drain" capacitance of the transistor VT1;

l) transistor VT2 is a powerful power switch that supplies power to the ML motor, and transistor VT1 is a damper that quickly slows down the rotation of the shaft after turning it off. Resistor R1 reduces the load on the MK output when charging the capacitances of the gates of field-effect transistors VT1, VT2. Resistor R2 turns off the motor M1 when MK is restarted;

m) the key on transistors VT1, VT2 is assembled according to the Darlington circuit and has a large gain. To control the speed of rotation of the shaft of the motor M1, the PWM method or phase-pulse control can be used. The system has no feedback, therefore, when the rotation speed decreases due to external braking, the operating power on the shaft will decrease;

Rice. 2.78. Wiring diagrams for electric motors through transistor switches

(continuation):

l) embedding MK into an existing path for controlling the speed of rotation of the motor shaft Ml. This path includes all elements of the circuit, except for the resistor R2. Resistor R4 sets the "coarse" speed. Fine tuning is carried out by pulses from the MK output. It is possible to organize feedback when the MK monitors any parameter and dynamically adjusts the rotation speed depending on the supply voltage or temperature;

o) the rotation speed of the motor shaft M1 is determined by the duty cycle of the pulses in the PWM channel generated from the lower output MK. The main switching key is the transistor VT2.2, the rest of the transistor switches are involved in the quick stop of the engine M1 by a HIGH level signal from the upper output MK;

n) smooth regulation of the speed of the motor shaft M1 is performed by the resistor R8. The OU TSh serves as a voltage stabilizer with double feedback through the elements R1, R8, C2 and R9, R10, C1. A combination of levels from three outputs MK (DAC) can stepwise change the speed of rotation of the motor shaft M1 (precise selection by resistors R2 ... R4). The MK lines can be put into input mode without a "pull-up" resistor to increase the number of DAC "steps";

Rice. 2.78. Schemes for connecting electric motors through transistor keys (end):

p) pulse-phase control of the AC motor M1. The more time during the period of the mains voltage the transistor VT1 is open, the faster the motor shaft rotates;

c) the powerful AC motor Ml is switched on through the KS7 optothyristor, which provides galvanic isolation from the MK circuits;

r) similar to Fig. 2.78, n, but with one feedback ring through the elements C7, R6, R8. Resistor R4 regulates the motor shaft speed Ml smoothly, and MK discretely.

Rice. 2.79. Bridge diagrams for connecting electric motors to MK (beginning):

a) the direction of rotation of the motor shaft Ml is changed by a bridge "mechanical" circuit on two groups of relay contacts KL1, K1.2. The switching frequency of the relay contacts must be low so that the resource is not quickly exhausted. Inductors L7, L2 reduce switching currents when switching relays and, accordingly, the level of radiated electromagnetic interference;

b) at a HIGH level at the upper and LOW level at the lower output of the MK, transistors K77 ... to TK open, and transistors KG4 ... KG6 close, and vice versa. When the motor supply polarity Ml is reversed, its rotor rotates in the opposite direction. The signals from the two outputs of the MCU should be anti-phase, but with a small LOW pause between pulses to close both arms (eliminate through currents). Diodes VD1..VD4 reduce voltage surges, thereby protecting transistors from breakdown;

c) similar to Fig. 2.79, b, but with other values ​​of the elements, as well as with hardware protection against simultaneous opening of transistors of one arm using diodes VD3, VD4. Diodes VD1, KD2 increase noise immunity at a large distance to MK. Capacitor C/ reduces the "spark" impulse radio interference generated by the engine Ml;

Rice. 2.79. Bridge diagrams for connecting electric motors to MK (continued):

d) similar to Fig. 2.79, b, but with the absence of "locking" resistors in the base circuits of transistors VT2, VT4. It is calculated that the motor winding L / / is sufficiently low-resistance, therefore, when the MK is restarted, external interference on the “hanging in the air” bases of transistors VT1 VT2, VT4, VT6 will not be able to open their collector junctions;

e) similar to Fig. 2.79, b, but with the maximum simplification of the scheme. Recommended for devices that perform secondary functions. The supply voltage is +E and must match the operating voltage of the motor M1\

f) unlike the previous circuits, transistors VT1 ... VT4 are switched on according to the common emitter circuit and are controlled by HIGH / LOW level directly from the MK outputs. The motor M1 must be designed for an operating voltage of 3 ... 3.5 V. Diodes VD1 ... VD4 reduce voltage surges. The LL C1 filter reduces the power supply transients from the M1 motor that can cause the MK to malfunction. Occurring replacement parts: VT1 VT3- KT972; VT2, VT4-KT973; VD1…VD4-KD522B, R x = 3.3 kOhm; R 2 \u003d 3.3 kOhm;

g) a bridge circuit based on four control transistors VT1 VT2, VT4, VT5 of the p-p-p structure. The tuning resistor R4 regulates the voltage on the motor Ml, and hence the speed for two directions of rotation of the rotor at once;

Rice. 2.79. Bridge diagrams for connecting electric motors to MK (end):

h) a bridge circuit for controlling a powerful motor Ml (24 V, 30 A). The voltage polarity change on the motor is performed by anti-phase levels at the middle outputs of MK, and the rotation speed is performed by the PWM method at the upper and lower outputs of MK;

i) transistors VT2, VT5 supply power to the bridge motor control circuit Ml. Their parallelization allows you to connect another of the same circuit to the VD1 diode.