Electronics for Stepper Motor Driving

Total Page:16

File Type:pdf, Size:1020Kb

Electronics for Stepper Motor Driving

Supporting material # 5

Electronics for stepper motor driving

Each stepper motor is driven using a dual H bridge (L298 integrated circuit

(IC)) connected to a microcontroller (L297 IC). The coordinates of the volume of interest are sent by the computer to the microcontroller using the parallel port. These signals decide the direction of rotation and number of steps, which are used by the microcontroller to generate the motor phase sequence of the dual H Bridge. The microcontroller also contained a pulse width modulation circuit used to regulate the current flowing through the motor windings.

Each motor winding was connected to the output of the dual H Bridge with 8 fast recovery diodes connected in between. The recovery diodes were used to protect the circuit from the back electromotive force (EMF) generated by the motors. The

Capacitor C1 (33 nF) and the resistor R1 (22 kΩ) set the chopper rate, which equals 1 /

(0.69* R1* C1) ≈ 2 kHz.

The current induced by each of the motor windings flows through the resistors

Rs1 and Rs2 (both are 0.5 Ω). The L297 IC measures the voltage across these resistors to control the current flowing through the motor windings by controlling the pulse width modulation circuit. When the voltage equals Vref (pin 15 of IC L297) the drive current is interrupted. A voltage divider circuit was used to set the value of Vref.

Pin 17 of the microcontroller is used to set the direction of rotation of the motors. Pin 18 is an active low input which is used to rotate the motor by one step at each rising edge of the input signal. Pin 19 is used to toggle the operating mode between half step and full step rotation, while Pin 20 is an active low input which resets the microcontroller to its initial state. Pins 4, 6, 7, and 9 of the microcontroller are connected to pins 5, 7, 10, and 12 of the dual H Bridge, respectively. These pins are for motor phase inputs A, B, C and D, respectively. A 5V bias voltage is fed into pin 12 of IC L297 and pin 9 of IC L298. IC L297 is connected to ground through pin

2, and the power supply for the motors is connected to IC L298 at pin 4.

Transducer's switching circuit

The microcontroller controls the operation of the transducer through the switching circuit. When the input to the transistor (Q1) is low, the driver (function generator) is not connected to the power amplifier and the transducer is off. When the input goes high, the relay switch closes and the signal from the function generator reaches the power amplifier, turning the transducer on.

An interface board, with 4.7 kΩ resistors to limit the current, was used to protect the electronic circuits and the parallel port.

Interface software

The software used to control the positioning system, Kcam©, is based on GM- code; a set of instructions that specify the coordinates of a point in the effective field.

GM-code is widely used in computer numerically controlled (CNC) machines to provide accurate and repetitive results; two features that are necessary in the positioning of the ultrasound transducer. The positioning could also be done manually using the keyboard cursor keys by specifying the coordinates of the required focal point (x, y, z) and the amplitude of the driving signal.

A visual basic programme was written to generate the GM-code needed for the complete treatment session. The dimensions of the region to be ablated (‘Radius’ and

‘Height’), as well as the on and off times (‘Time for ultrasound’ and ‘Delay’) of the ultrasound wave, are input into the programme to generate the required code. The generated GM-code is executed using Kcam©, which in turn moves the transducer accordingly. This way, a treatment plan that is developed beforehand, can be carried out using the software.

Recommended publications