Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Схемы МК.docx
Скачиваний:
17
Добавлен:
02.06.2015
Размер:
12.01 Mб
Скачать

Шаговый двигатель (Step Motor Step Sequence)

This application note describes how to implement a compact size and high speed interrupt driven step motor controller. Step motors are typically used in applications like camera zoom/film feeder, fax machines, printers, copying machines, paper feeders/sorters and disk drives. The high performance of the AVR controller enables the designer to implement high speed step motor applications with low computing requirements of the controller.

Theory of Operation

A DC step motor translates current pulses into motor rotation. A typical motor contains four winding coils. The coils are often labeled red, yellow/white, red/white and yellow, but may have other colors. Applying voltage to these coils forces the motor to step one step. In normal operation, two winding coils are activated at the same time. The step motor moves clockwise one step per change in winding activated. If the sequence is applied in reverse order, the motor will run counterclockwise. The speed of rotation is controlled by the frequency of the pulses. Every time a pulse is applied to the step motor the motor will rotate a fixed distance. A typical step rotation is 1.8 degrees. With 1.8 degree rotation in each step will a complete rotation of the motor (360 degrees) require 200 steps. By changing the interval of the timer interrupts, the speed of the motor can be regulated, and by counting the number of steps, the rotation angle can be controlled.

Table shows the hexadecimal values to be output to the step motor to perform each step:

Рисунок 17 – Временная диаграмма работы

DC MOTOR CONTROLLER USING THE ZILOG Z86E06 MCU – рисунок 18:

Several DC motor design topologies exist, but certainly the most widely used method is the “H-bridge” configuration. This method uses four Bi-polar Junction Transistor (BJT) or Metal-Oxide Silicon Field Effect Transistor (MOSFET) devices configured in an “H” pattern. In the center of the “H” is the motor itself. To drive the motor in the forward direction, current flows through Q1 and Q4. To turn the motor in the reverse direction, Q1 and Q4 are turned off, and Q2 and Q3 are energized. External logic is needed to gate the devices. Motor speed is controlled by the average current flowing in the legs. This is regulated by a Pulse-Width Modulation (PWM) drive method, which relies on the duty cycle of a digital output to control the drive voltage to the MOSFETs. Conventional designs require low-pass filtration to produce a constant DC voltage. Varying the duty cycle of the output varies the DC voltage. This DC voltage would then drive the power MOSFETs. The necessary steering logic is incorporated inside the LMD18200. The PWM is also accepted without the need for an external low-pass filter.

Since the voltage drop across the collector and emitter can reach more than 1V during saturation, high heat dissipation is encountered using BJT devices. MOSFETs, with their intrinsically low Rds (drain to source turn-on resistance), are better suited for motor driver applications. Typically, power MOSFETs need a gate voltage of least 8V to turn on, which is a problem when using an MCU whose outputs swing from 0–5V. Special logic MOSFETs have been developed that have gate turn-on voltages of 5V.

This works fine for the lower legs of the “H” motor drive, but what about the upper legs? Unfortunately, the upper legs need a higher gate voltage, due to the fact that the motor's winding resistance raises the MOSFETs source reference above ground potential. A separate DC-DC convertor chip can be used, but this adds more cost and complexity to the design. The LMD18200 solves this problem by having a built-in DC-DC convertor.

Рисунок 19 - DC Motor Controller Schematic

Рисунок 20 - DC Motor Controller Schematic

Рисунок 21 - PID Motor Control with the Z8PE003

Limit Sensors

The limit sensors consist of a slotted detector with an optical IR light-emitting diode (LED) and a phototransistor in a plastic housing. The signal is broken when an object is passed through the gap in the housing. Breaking this transmit signal turns off the base current to the phototransistor, turning off the phototransistor. The output signal is then pulled to a logic High level on the Z8PE003.

The LED turns on the phototransistor when there is no object in the optical path, pulling the output signal to a Low. A resistor in series with the LED limits the current to 18 mA. LEDs DLIM1 and DLIM2 illustrate when the phototransistor is turned on.

H-Bridge

The H-Bridge regulates motor speed by controlling the average current applied to the motor. The pulse-width modulated signal from the Z8PE003 controls the amount of time each leg of the H-Bridge is on or off. The longer the on time, the more average current is applied, and the faster the motor spins. The LMD18200 features special logic inputs that are TTL- and CMOS-compatible to turn on the MOSFETs. The voltage developed across R11 sets the current limit flag. The following equation determines the R11 value. Note that the value used in the calculation is the load current for this application, not the stall current, because of the near no-load condition on the motor.

R = 5 Volts ÷ (377 µA ÷ A x 275 mA) = 48KΩ

The function of the thermal overload flag is to warn the Z8PE003 when the temperature inside the H-Bridge reaches the 145∞C warning limit. Should this limit be reached, the Z8PE003 can shut down the system before the H-Bridge reaches the shut-down temperature of 170∞C. The motor is a generic, permanent magnet DC motor with a 100:1 ratio output gear train. It operates in a 4.5 to 12 VDC operating range, 75-mA no-load current, and 69 rpm no-load speed.