#Motor control circuit design software software#
This software based PWM code uses three PCA modules and a single Interrupt Service Routine. Half-bridge DC motor drives require Center-Aligned PWM with dead-time.Įxample 7 of AN191 - Motor Control Software Examples provides software example code for Center Aligned PWM with dead-time. The power losses in the upper power MOSFET may be much lower than using a Schottky diode. The half-bridge circuit may also be used to reduce the power losses for larger DC motors. This example uses the window detector feature of the C8051F300 ADC to measure the back-EMF.Ī half-bridge is useful in applications that require unidirectional control with active braking. Additional circuitry can be used to sense the back-EMF of the motor and provide safe reversing once the motor comes to a stop.Įxample 3 of AN191 - Motor Control Software Examples provides example code for DC motor with soft reversing using this circuit configuration. In this example circuit, the low-side N-channel transistors are used for PWM speed control and the upper transistors are used to chose the motor direction.Įxample 2 of AN191 - Motor Control Software Examples provides example code for DC motor with reversing using this circuit configuration.Ībrupt reversal of a DC motor can potentially damage the power MOSFETs. Four power MOSFETs are used to provide variable speed and reversing for DC motors. The hardware based PWM does not require any CPU overhead and leaves 25 MIPS available for user code.Ī full-bridge circuit can be used to drive a DC motor when reversing is required. The software example uses the ADC and one PCA module configured for 8-bit PWM mode. This circuit provides variable speed control of a DC motor with rotation in a single direction.Įxample 1 of AN191 - Motor Control Software Examples provides simple example code for a DC motor using the C8051F300 MCU. The simplest DC motor drive circuit consists of a single N-channel power MOSFET and a Schottky diode. The bipolar stepper motor has a higher parts count and Bill of Materials cost. Note that the polarity must be inverted for the high-side port pins. Four inexpensive NPN transistors in the common-base configuration can be used for bipolar stepper motors up to about 24 volts, (depending on the availability of 3 V Logic-Level Power MOSFETs). The upper transistors require a high-side drive circuit. The lower transistors can be driven directly from the MCU.
Bipolar motors are driven by a dual H-bridge and utilize the entire motor winding. The software provided in AN155 can also be used to drive bipolar stepper motors with minor modifications. The software demonstrates a linear-velocity profiler with adjustable acceleration. The reference design board includes a C8051F300 MCU, four power MOSFETs to drive the stepper motor, a diode clamping circuit, a voltage regulator and a RS232 interface. The unipolar stepper motor system provides accurate positioning with the lowest parts count and bill of materials cost. The MCU can directly drive 3 V logic-level power MOSFETs. AN155 provides a complete reference design for unipolar stepper motors using the C8051F300 MCU.