AN1305. Sensorless 3-Phase Brushless Motor Control with the PIC16FXXX TYPICAL MOTOR CONNECTION OVERVIEW DRIVE AND CONTROL CIRCUITRY
|
|
|
- Amie Crawford
- 9 years ago
- Views:
Transcription
1 Sensorless 3-Phase Brushless Motor Control with the PIC16FXXX Author: OVERVIEW Ward Brown Microchip Technology Inc. In 2002, I wrote my first application note on brushless motor control, AN857, which described the operation of sensored and sensorless brushless motors. The basic motor operation concepts described in that application note still apply today, therefore, I will not repeat them here. In the time since then, enhancements to two of the microcontroller peripherals have been made that dramatically improve the microcontroller capabilities for sensorless motor control applications. This application note will describe those enhancements and how they are used to create a sensorless motor control solution with an 8 MHz PIC16FXXX device that has truly stellar performance with seamless operation from 100 RPM to over 90,000 RPM. TYPICAL MOTOR CONNECTION Figure 1 is a simplified block diagram of how a sensorless, 3-phase brushless motor is configured with the drive and control circuitry. Each phase of the motor is connected to three circuits: a FET driver to the motor supply, a FET driver to the motor supply return, and a voltage divider. The voltage divider is necessary to reduce the phase voltage down to a range acceptable to the microcontroller input. During each commutation period the microcontroller drives one motor phase high, one motor phase low, and compares the third undriven motor phase to a fourth voltage divider connected to the motor supply. FIGURE 1: DRIVE AND CONTROL CIRCUITRY Supply PIC16Fxxx ECCP Timers I/O 3 3 Drivers 3 Motor 3 Scaling Voltage to the motor from the motor supply is varied by pulse-width modulating the driver FETs. Only one side of the drive needs to be modulated: either the high side motor supply or the low side supply return. This requires that three of the microcontroller outputs to the FET drivers have PWM capability, while the other three can be general purpose output pins. The microcontroller comparator is used to determine when the undriven phase voltage reaches the mid-point between the motor supply and motor return potentials. Since there are three phase voltages and one reference, this requires multiplexing each of the three phase outputs to one input of the comparator while the other comparator input remains on the fixed reference. We ll now take a look at the new peripheral features to see how they meet the FET driver and comparator input requirements and how they are controlled Microchip Technology Inc. DS01305A-page 1
2 MICROCONTROLLER PERIPHERAL ENHANCEMENTS Two relatively minor enhancements are now incorporated in some PIC16FXXX devices that significantly improve the capabilities of the comparator and the enhanced capture, compare, and PWM (ECCP) peripherals. These enhancements are particularly useful for brushless motor control applications. The comparator now has four independently selectable inputs to the inverting input and the ECCP has up to four individually selectable outputs in single PWM mode. COMPARATOR ENHANCEMENTS Figure 1 shows a block diagram of the new comparator configuration. As seen in the diagram, the non-inverting input can be configured to sense one I/O pin, and the inverting input can be configured to sense one of four I/O pins. Sensorless brushless motor control needs four comparator connections: the single non-inverting comparator input is connected to a voltage divider off of the high motor supply rail, and a voltage divider on each motor terminal is connected to the input MUX of the inverting comparator input. Two bits in the comparator control register select which motor terminal is directed to the inverting comparator input. At each commutation state, when the high and low motor drivers are configured, so are the comparator inputs, so that the floating motor terminal can be compared to the fixed reference. ECCP ENHANCEMENTS The new Enhanced Capture Compare and PWM peripheral (ECCP) has the capability to direct the PWM output to four I/O pins. The PWM output for each pin is individually selected by a bit in the PSTRCON control register. In single PWM mode, the PWM signal can be directed to any combination of the four outputs. For brushless motor control three of the PWM outputs are connected to three of the motor driver devices. The PWM outputs are connected to the high side drivers for high side modulation or the low side drivers for low side modulation. For each of the six commutation states, one PWM output is enabled to drive one motor terminal with modulation, while another motor terminal is driven steady state. The third motor terminal floats and is used to detect motor position. MOTOR CONTROL The motor is controlled by synchronizing the commutation with both the motor position and the motor speed. Motor speed at various supply voltage and load conditions is a function of the motor design. The control algorithm searches for this intrinsic speed and adjusts the commutation period to match. The control algorithm is similar to a Phase Lock Loop (PLL) in that error between the commutation period and what the motor needs is computed and added back into the commutation period. The error eventually accumulates to zero. The biggest difference between motor control and other Phase Lock Loop systems is that the motor control becomes discontinuous at any commutation rate above the ideal rate. In other words, the motor cannot keep up at any commutation rate above the ideal rate. This discontinuity results in an abrupt loss of lock and causes the motor to stop abruptly. The control algorithm must avoid crossing this discontinuity boundary by instantly responding to any condition that may cause this breech. This is accomplished by resetting the time to the next commutation at each zero-crossing event. By definition, zero-crossing occurs in the middle of the commutation period so the time to the next commutation is set to one half of the last computed commutation period. If the commutation period becomes too short, then the commutation will be early, resulting in a late zero-crossing event. When this occurs, then the current commutation period is instantly extended by the amount of the delay. If the commutation period becomes too long, then the zero-crossing event will occur early and the current commutation will be shortened. This keeps the commutation cycles tightly coupled to the motor position and allows for a narrow bandwidth error feedback loop for better stability. The motor position can be determined by sensing the voltage on the undriven motor phase. The first half of the section on Sensorless Motor Control in AN857 covers this in detail. One of the differences between the approach of AN857 and this application note is that we will be using a comparator to determine the voltage instead of using an analog to digital converter. DS01305A-page Microchip Technology Inc.
3 COMMUTATION When commutation is synchronized with the motor position then the voltage of the undriven phase transitions through the point at which it is equal to half the motor supply voltage at the mid-point of the commutation period. This is sometimes referred to as the zero-crossing event. The supply voltage must be applied to the driven phases to bias the undriven phase to the proper level for zero-crossing detection. The control algorithm measures the time from commutation to the zero-crossing event and computes the difference between the actual and expected as the error. In any case, the time from the zero-crossing event to the next commutation is always half the uncorrected commutation period. In other words, even if the zero-crossing is detected immediately after commutation, the time to the next commutation will be half the previously calculated commutation time. Timer1 is used to both measure the time to the zero-crossing event and to time the commutation events. Figure 2 shows a graphical representation of this. The commutation time is N. Timer1 is preset to N so that it overflows after N counts. At the zero-crossing event, the Timer1 count is captured; let s call this time X. The time to zero-crossing can then be calculated as X (-N) or X+N. At the zero-crossing event Timer1 is also preset to N/2, which will cause an overflow, thereby triggering the next commutation one-half commutation period later. FIGURE 2: COMMUTATION Commutation periods FFFFh Timer1 overflow Late zero-cross -N/2 Timer1 -N 0000h Full commutation preset Early zero-cross Half commutation preset Time ZERO-CROSS DETECTION The zero-crossing event cannot be detected on every commutation period because of the nature of the drive and detection circuitry. Consider pictures 3a and 3b in Figure 3. Picture 3a (High Side Modulation) shows one phase of a motor drive waveform for a high-side modulated drive. Picture 3b (Low Side Modulation) shows one phase of the motor drive waveform for a low-side modulated drive Microchip Technology Inc. DS01305A-page 3
4 FIGURE 3: ZERO-CROSS DETECTION Inductive transient Cin+ Cout a. High Side Modulation Cin- Cin- Cin+ Cout BEMF ZC b. Low Side Modulation BEMF ZC In Figure 3, a dotted line represents the comparator reference input, which in our case, is half the motor supply voltage. The motor terminal voltage is represented by the waveform and is on the other comparator input. For the high-side modulated system, when the motor terminal BEMF voltage is rising the comparator output, after the inductive transient, is steady until half-way through the commutation period. Once the comparator transitions the first time, it continues to transition at every PWM drive cycle for the remainder of the commutation period, as shown in the lower half of pictures 3a and 3b. On the same high-side modulated system, when the BEMF is falling, the comparator continues to transition at every PWM cycle until the last half of the commutation period. The opposite is true for low-side modulated systems, that is, when the BEMF is falling, the comparator output is steady in the first half and transitions in the last half of the commutation. Clearly, it is easier to detect the zero-crossing event at the first comparator change than it is to detect when the comparator stops changing. For this reason, the zero-crossing event is detected only during rising BEMF periods on high-side modulated systems and only on falling BEMF periods on low-side modulated systems. Since the BEMF alternates between rising and falling in each commutation cycle, zero-crossing is detected every second cycle. The periods in which the zero-crossing events are not detected are commutation only. The commutation-only interval is also when the new commutation time is computed using the zero-crossing event time captured during the previous commutation and zero-cross period. COMMUTATION DRIVE For speed control and soft start-up, the motor supply voltage is pulse-width modulated. The modulation is applied to the motor driver switches and needs to be applied only to either the high-side or low side drivers. Sometimes it is necessary to modulate the low-side drivers in order to cycle the high-side gate driver charge pumps. Otherwise, high-side or low-side modulation is a matter of personal preference. In each commutation period, one motor terminal is driven high, one terminal is driven low, and the third remaining terminal is left floating. The modulated drive comes from an ECCP PWM output pin. The unmodulated drive comes directly from an output pin. There are four ECCP PWM pins designated: P1A, P1B, P1C, and P1D. The PWM output pins are individually controlled by bits in the PSTRCON register. When the PWM is active a 1 in the PSTRCON register corresponding to the desired active output will modulate that pin. All other PWM pins will output the level in the corresponding PORT output latch. It is important not to perform any output operations directly to the port sharing the PWM outputs. The reason is that all writes to a register are performed as read-modify-write operations. If the active PWM is high when an operation, such as a bit-set, is performed on a non-pwm output in the same port as the PWM, then the output latch for the active PWM pin will be changed to a high level. When the PWM output eventually moves to the next drive phase the output latch will drive the unmodulated pin high. DS01305A-page Microchip Technology Inc.
5 COMMUTATION STATES There are six commutation states in each electrical revolution. Each state drives one motor phase high and one motor phase low. The third undriven motor phase is directed to the comparator inverting input through a voltage divider. These three actions require setting the PSTRCON register for the modulated drive, a PORT latch register for the unmodulated drive, and the CCP1CON register for comparator BEMF detection. FIGURE 4: MOTOR CONTROL CODE System Service Timer1 (Commutation) MOTOR CONTROL CODE When the motor is running the motor control code has two major functions: status monitoring and motor control interrupts. The overall view of the motor control code is shown in Figure 4. The main System Service loop, in addition to status monitoring, controls the start-up sequence. Two interrupt types are enabled to control motor operation: Timer1 and comparator. Timer1 interrupts are always enabled and invoke each and every motor commutation. Comparator interrupts are only enabled every second commutation period to capture the zero-crossing event. Comparator (Zero Cross) Interrupt State Table SYSTEM SERVICES System services control the start-up sequence and monitor system status while the motor is running. start-up consists of system initialization, warm-up, slow start, and Phase Lock search. Status monitoring includes stall monitoring and speed control. The frequency of each start-up event and status check is determined by the time base manager. FIGURE 5: SYSTEM SERVICES Power Up True False STOP? System Init: I/O = Tristate STOP = False Disable Interrupts No Warmup True Warmup Complete? Yes RUN? Startup Complete? False No Enable I/O Yes Stall Detection Slow Start Enable Interrupts Speed Manager: Set PWM Duty Cycle RUN = T/F STOP = U/T 2009 Microchip Technology Inc. DS01305A-page 5
6 TIME BASE MANAGER The time base manager is a 10 millisecond period timer based on Timer0. Each status monitor subroutine keeps track of the time base manager time-ticks by means of a flag. Every 10 milliseconds, the time base manager sets a series of flags, one for each start-up control and status monitor. The flag is an indication to the respective control or status monitor to update its own internal counter. The control or status function is serviced when the corresponding counter reaches zero. The counter is then reset to the time count for that monitor or control and the service is performed. SYSTEM INITIALIZATION System Initialization sets the Special Function Registers (SFRs) to configure the microcontroller and sets all ports to their initial off state. Initialization occurs at power-up and whenever the motor is stopped. The motor may be stopped as a result of a Fault or because the speed request is below the lowest run speed. When initialization is active, all of the status functions, other than speed request, are disabled. WARM-UP Warm-up allows the system to settle after initialization. Warm-up commences immediately after initialization and lasts for the warm-up time specified by the TIMEBASE_WARMUP_ms constant. When warm-up is complete, the motor drivers are enabled and slow start commences. CONTROL SLOW START Control slow start prepositions the motor to a known commutation state so that subsequent commutations can start to accelerate the motor up to speed. Recall that the drive voltage is applied to two of the three motor windings. This causes the permanent magnet rotor to align with the created magnetic field which is between the active windings. Some motors have a strong tendency to align the rotor magnets with one of the motor windings when power is not applied. There are 60 electrical degrees between windings, so that applying power to such a motor will cause the rotor to move at least 30 electrical degrees, or more if the rotor was aligned to the winding not being powered. Other motors have a weak alignment tendency, so that the rotor may be aligned 180 degrees out of phase with the generated magnetic field when power is applied. In this case, the rotor will not move at all and will be in an improper position to accelerate properly when commutation begins. For this reason, motors that have a weak alignment tendency must receive two slow start positioning drive periods of sequential commutation drive states to ensure that the rotor is not stuck 180 degrees out of phase when the actual commutation starts. The amount of time to dwell in each slow start state depends on the inertia of the motor and the drive voltage applied. High inertia motors need more dwell time than low inertia motors. This allows the rotor to settle to a known position which makes the acceleration response to the first commutation drive more consistent and predictable. The dwell time for each slow start step is specified by the TIMEBASE_SLOW_STEP constant. The start-up commutation period is set in Timer1 and interrupts are enabled at the conclusion of slow start. At this point, Timer1 interrupts have complete control of the motor commutation and comparator interrupts determine how to adjust Timer1 to achieve Phase Lock with the BEMF signal. CONTROL START-UP Start-up commences immediately after slow start and looks only slightly different than the normal run condition. The only difference between normal run mode and start-up is the startup_complete flag. The startup_complete flag is cleared during warm-up and remains clear until the zero-crossing event is detected within +/- 12% of the commutation mid-point. The startup_complete flag is necessary to prevent start-up from being detected as a stall condition. The motor accelerates during start-up and the commutation period shortens to catch up, because zero-crossing is detected almost immediately after commutation. See the Section Zero-Crossing During Start-up for more detail on how this works. Control start-up routine does nothing more than check that Phase Lock to the BEMF signal is achieved in a reasonable amount of time. It does this by setting a timer and checking that the startup_complete flag is set when the start-up time is complete. If zero-crossing fails to set the startup_complete flag within the allowed start-up time, then the motor is stopped and the start-up steps repeat from system initialization. STALL MONITORING Stall monitoring checks to make sure that the motor responded properly to the start-up conditions and is actually rotating. If a stall is detected then the motor is stopped and a restart is attempted. There are various reasons why the motor may not be rotating. For example, the rotor could be held in position by some blockage, or the rotor did not settle fully during slow start-up. In both those cases commutation will go through the acceleration process without the motor following. As we will see later, a stalled motor will produce a zero-crossing event almost immediately after commutation. We allow for early zero-crossing for a short while during start-up, because a starting motor is by definition stalled. If the motor does not sense the zero-crossing event in the middle of the commutation period in a reasonable amount of time, then the motor is assumed to be stalled. What sometimes happens though, is that DS01305A-page Microchip Technology Inc.
7 the control algorithm continues to shorten the commutation period as a result of acceleration until the commutation period just happens to be twice the time to the zero-crossing. The time from commutation to zero-crossing did not change, only the commutation period did. The commutation period is compared to the speed control speed request and, if the commutation period is much shorter than expected, then a stall condition is assumed. SPEED MANAGER The speed manager varies the voltage applied to the motor. This is accomplished by pulse-width modulating the motor driver switches. Even in systems where the motor always runs at full speed, speed control is needed to soft start the motor. Without soft start, the start-up currents will be excessive and starting torque could cause system damage. The speed control manager always starts the motor at the same voltage. The speed control manager starts increasing or decreasing the applied voltage up to the desired level when the zero-crossing detection senses that commutation is synchronized with the motor. Voltage is varied by varying the on-period of the ECCP PWM. The value in CCPR1L sets 8 Most Significant bits of the on-period. Two more Least Significant bits of resolution are set by the DC1B[1:0] bits in the CCP1CON register. The duty cycle percentage of the PWM is calculated as (CCPR1L: DC1B[1:0])/(PR2:0b00). INTERRUPTS Two types of interrupts are used to control the motor: Timer1 interrupts set the commutation period and comparator interrupts capture the time of the zero-crossing event. COMMUTATION INTERRUPT At the beginning of each commutation interrupt the commutation subroutine is called in which the motor drivers and BEMF sense lines are switched for the upcoming commutation period. Commutation time is controlled by Timer1. Timer1 is preset so that overflow will occur when the commutation time has elapsed. The interrupt occurs when Timer1 overflows one commutation period later and the process is repeated for the next commutation phase. Timer1, in effect, always contains a negative number representing the time remaining until the next commutation event. FIGURE 6: COMMUTATION INTERRUPT Timer1 Interrupt Commutate True BEMF Flag? False Timer1 = - CommTime Error = ZC_Time CommTime/2 CommTime = CommTime + Error*EGain Blanking Lock Check Enable Comparator interrupts Timer1 = - CommTime Next State = Zero Cross Next State = Commutate Return 2009 Microchip Technology Inc. DS01305A-page 7
8 At each commutation event, the commutation subroutine is called to switch the motor drivers. The commutation subroutine also sets a flag to let the Interrupt Service Routine (ISR) know whether to setup for a zero-crossing event or make error correction calculations. The commutation interrupt has two purposes other than switching the drivers: Zero-crossing setup and commutation time calculation. In the first instance, if the zero-crossing event will be captured in the upcoming period, then the comparator interrupt must set up for that occurrence. In the other instance, the zero-crossing event cannot be captured so there is more time available to make calculations to correct the commutation period. In both cases, Timer1 is preset with the negative of the last calculated commutation time. COMMUTATION PERIOD MATH Since Timer1 is a 16-bit timer, the Timer1 count registers (TMR1H:TMR1L) can contain a number from 0x0000 to 0xFFFF. Timer1 values from 0x8000 to 0xFFFF are treated as negative signed integers. However, Timer1 values from 0x0000 to 0x7FFF are treated as positive signed integers. Normally, this wouldn t matter because Timer1 could be treated as an unsigned integer, but that causes problems when performing math on partial commutation periods such as the mid-commutation point, otherwise known as the expected zero-crossing point. Signed integers are necessary to accommodate positive and negative error calculations. To avoid the need to do all commutation period calculations with long signed integers, one simple trick can keep the math to the size of a signed integer and at the same time realize the full 16-bit count capability of Timer1. Consider that the commutation period as written to Timer1 is a 16-bit negative integer. If we assume that the sign bit is the 17 th unimplemented bit, then that bit will always be 1. The only time the commutation period is measured is at the zero-crossing event. By definition the zero-crossing time is half the commutation period. The expected zero-crossing value can be calculated from the signed 16-bit commutation period value by shifting the commutation value right by 1 and always setting the Most Significant bit to 1 after the shift. Therefore, values that have no sign bit to extend will assume the negative sign of the unimplemented 17 th bit which is always 1. Negative integer values will have their sign bit extended during the shift, so setting the Most Significant bit makes no difference. Once we have the expected zero-crossing value in signed 16-bit integer format, all other calculations, such as the zero-crossing error and next commutation period are calculated with simple 16-bit signed integer math functions. However, remember that the commutation time is stored and used as a signed 16-bit number which is always negative, even when the sign bit says otherwise, because the implied 17 th bit makes it so. Since the value in Timer1 is always negative, the Timer1 value captured at zero-crossing will also be negative. The error between the expected zero-crossing and the actual is computed, scaled, and accumulated in the stored commutation time as follows: EQUATION 1: ZCE = ZCT CT/2 CT = CT + ZCE*EGain Where: ZCE = Zero-Crossing error CT = Commutation time CT/2 = Expected zero-crossing ZCT = Zero-Crossing time EGain = Feedback Gain Factor When zero-crossing occurs early, then ZCT will be a larger negative number than CT/2 and the error will reduce the commutation time. The opposite will be true when zero-crossing occurs late. The scaling factor determines how quickly the system responds to commutation errors. A large scaling factor will provide a slower response. However, a large scaling factor will also introduce larger truncation errors since we are performing all calculations in 16-bit integer math. Small, low-inertia systems respond best to a small scaling factor whereas high-inertia systems work better with a large scaling factor. SETTING UP TO CAPTURE THE ZERO-CROSSING EVENT The zero-crossing event is captured by a comparator interrupt. The comparator interrupts are sensed by an exclusive-or gate comparing two mismatch latch outputs. The two mismatch latches consist of a holding latch and a temporary latch. The holding latch is set to the comparator output value when the comparator control register (CCPxCON) register is accessed (read or written). The temporary latch is set to the comparator output value at each instruction cycle. If the comparator output changes after the holding latch is set, an exclusive-or gate will signal the difference between the holding and temporary latches and set the interrupt. Therefore, it is imperative that when the comparator interrupt is enabled, the comparator output is in the state opposite the state it will change to when the zero-crossing event occurs. The CCPxCON register is accessed as part of the commutation switching routine at which time the comparator output is indeterminate. For this reason it is necessary to access the CCPxCON register again later when setting up the comparator interrupt. DS01305A-page Microchip Technology Inc.
9 There is one major obstacle that can prevent properly setting up the comparator for the zero-crossing event. At commutation, one motor coil is detached from the supply and another is attached. The current in the detached coil does not stop immediately because of the coil inductance. The current must flow somewhere so it flows through the body diode of either the high-side switch or low-side switch. When the broken connection is from the negative supply side then affected current is flowing out of the coil towards the driver switches. Both switches are off so the only path through which the current can continue is the high-side switch body diode. The current continues from there on the motor supply line and back to the motor through the high-side drive switch that is still on. This causes a high transient on the BEMF sense line as shown in Figure 3a (High Side Modulation). A negative spike similarly occurs when the broken connection is from the positive supply side. As motor current varies with the load, so does the energy that must be dissipated in this spike. During acceleration and high load conditions, the energy in the coil inductance increases causing the width of the transient to lengthen. Conversely, during deceleration and light loads the width shortens. The comparator interrupt cannot be setup until all the energy in the transient has been dissipated. Avoiding the transient period is called blanking. BLANKING There are two ways to handle blanking: timed and dynamic. The timed method is just as it sounds. After commutation, a specific time is allowed before the comparator interrupt is setup. The problem with timed blanking is that the wait time for all blanking events must be long enough to accommodate the worst case spike. At high RPM rates, this could be a significant percentage of the commutation period and may limit the maximum speed attainable. Dynamic blanking solves this problem. In dynamic blanking, a short minimum blanking time is allowed to elapse, to make sure the commutation switch is complete, and then the level of the comparator output is tested until the inductive transient is no longer present. The level of the comparator output is in a known good state immediately after the transient, at which time the control register can be read to set the mismatch holding latch. Only then can the comparator interrupt be cleared and enabled. ZERO-CROSSING INTERRUPT The zero-crossing interrupt occurs when the BEMF voltage reaches the BEMF reference voltage. Two things happen in the zero-crossing interrupt service: First, the value of Timer1 is read, and then Timer1 is preset with half the previously computed commutation time. During steady state operation the value read from Timer1 is essentially the same as the value written to Timer1. Regardless of when zero-crossing occurs, early or late, the value written to Timer1 will always be half the previously computed commutation time. During acceleration zero-crossing will occur early and the value read from Timer1 will be a larger negative number than expected. The difference between the read number and the expected number is the zero-crossing error which will be used to correct the commutation time when the new commutation time is computed as part of the next commutation interrupt. FIGURE 7: Comparator Interrupt ZC_Time = -Timer1 Timer1 = -CommTime/2 Disable Comparator Interrupts Next State = Commutate Return ZERO-CROSSING DURING START-UP When the motor is not rotating, it is not generating any voltage. The undriven motor terminal then will be approximately half the motor supply voltage because the high-side and low-side drivers form a low-impedance voltage divider. This is the voltage that will be presented to the zero-crossing comparator input. The inter-winding capacitance of the motor coils will cause a small overshoot in the PWM drive signal so the zero-crossing comparator will sense every PWM pulse from the beginning of each commutation period. This means that when the motor is starting the zero-crossing interrupt will occur almost immediately after the blanking period. At the same time, the motor will start to accelerate and the calculated period for the next commutation will be shorter because of the early zero-crossing event. Until the motor comes up to speed, it will be operating in step response to the applied power. As the motor approaches the ideal commutation rate, and the motor generated voltage grows, the zero-crossing events will move toward the center of the commutation period. When the period is twice the time to zero-crossing, the control will be synchronized with the motor Microchip Technology Inc. DS01305A-page 9
10 HARDWARE The hardware for sensorless brushless motor control is relatively simple. Six supply switches are needed as are four voltage dividers. Of the six supply switches, three are for switching the plus motor supply to the three motor terminals, and the other three are for switching the three motor terminals to the supply return. Of the four voltage dividers, three scale the motor terminal voltage for measurement by the microcontroller and the fourth is used to scale the motor supply voltage as a reference to which the motor terminal voltages are compared. PWM FREQUENCY AND PERIOD The PWM frequency is a function of Timer2 and the PR2 register. Timer2 is an 8-bit counter. When the count reaches the value of PR2, then Timer2 is reset to zero and the cycle repeats. The duty cycle period of the PWM is a function of Timer2 and the CCPR1L register. At the beginning of each PWM period, the PWM output is high. When the Timer2 count equals the CCPR1L register, the output is set low. Smaller values in PR2 will produce higher PWM frequencies at the cost of duty cycle resolution because CCPR1L does not have as many bits to work with. There are actually two more bits of duty cycle resolution in the CCP1CON0 register, labeled DC1B1 and DC1B0. Timer2 increases by one count every fourth system clock, or FOSC/4. The DC1B0 bit changes with every FOSC clock and the DC1B1 bit changes every second FOSC clock. There are several factors to consider when choosing the PWM frequency. Low frequencies will be audible at slow motor speeds. High frequencies will cause greater switching losses, especially under high load high current conditions. A general rule of thumb is to choose a PWM frequency from 16 khz to 20 khz. COMPUTING THE VOLTAGE DIVIDERS Resistive voltage dividers are used to scale the motor supply and motor terminal voltages within a range acceptable to the microcontroller inputs. The dividers will be used to compare the motor BEMF voltage to the motor supply. Compute the voltage divider for the reference such that the reference voltage is well within the common mode range of the microcontroller comparator input. A good rule of thumb is to set the reference voltage to half the microcontroller supply voltage. The reference is connected to the motor voltage so the equation for the reference divider is: EQUATION 2: VDD/2 = Vmotor*Y/(X+Y) Where: VDD = microcontroller supply Vmotor = Motor supply X = Resistor from Vmotor to non-inverting comparator input Y = Resistor from non-inverting comparator input to ground Compute the BEMF voltage dividers from the values of the reference divider: EQUATION 3: A = X B = 2 * Y Where: A = Resistor from motor terminal to inverting comparator input B = Resistor from inverting comparator input to ground X and Y are resistor values determined in Equation 2. TROUBLESHOOTING The most common troubles encountered when attempting to use a new motor or driver circuit are driver configuration, motor acceleration, and zero-crossing detection. The easiest to detect and remedy is the driver configuration. Start-up and zero detect are more difficult because, unless the motor is running, you cannot tell which is the problem and the motor will not run unless the problem is corrected. Debugging then becomes an iterative process by holding one parameter fixed then trying a range of the other parameter. The following sections deal with each aspect separately. DEBUGGING DRIVER CONFIGURATION There are too many possible issues with driver configuration to deal with individually. Here is a simple and safe method to determine that all circuit elements are working properly from the motor terminal back to the microcontroller. The first step is to replace the motor with a resistor network. Construct the network with three resistors. One end of each resistor connects to each of the driver outputs. The other end of all three resistors is connected to a common node. The resistor values must all be the same and high enough to prevent damaging current flow at the maximum motor voltage, but low enough to allow proper biasing of the output driver devices. A good rule of thumb value for a 15 to 20-volt system is 270 Ohms. DS01305A-page Microchip Technology Inc.
11 With the network in place on the driver outputs, invoke motor start-up and observe the waveform on each driver output. For a low side modulated system, the waveforms should look like those shown in Figure 8, if they are then proceeded with debugging start-up with the motor. If they are not, then use standard circuit debugging techniques to determine where the fault lies. For a high side modulated system rotate the figure right by 180 degrees. FIGURE 8: DEBUGGING DRIVER CONFIGURATION Phase U Phase V Phase W DEBUGGING START-UP The most difficult aspect of sensorless motor control is starting the motor. Before the motor starts spinning, and generating a BEMF voltage, the motor is responding to commutation more like a stepping motor than like synchronous motor. Because every motor is different the response to applied voltage will also be different. We want to start the motor as quickly as possible to avoid excessive current in the stepping mode. However, if the ever shortening steps between commutation times are too large, then the steps can easily skip over the zone where BEMF crosses near the middle of the commutation period. If the steps are too small, then more time is spent in Stepping mode with the associated excessive current. The start-up algorithm always begins with a fixed PWM duty cycle. The challenge is to determine what the duty cycle should be for optimum start-up performance when the desired nominal motor voltage is applied. One method is to set the PWM duty cycle to an arbitrary value that will prevent excessive current damage even when the motor is stopped. A good starting point is 25%. Then apply a voltage to the motor below where the motor will operate. Try starting the motor with this combination. It is unlikely that the motor will start reliably. Gradually increase the applied voltage and retry to start the motor at each level until the motor starts reliably. Use the combination of fixed PWM duty cycle and the reliable starting voltage to compute the duty cycle needed to start the motor when the desired nominal voltage is applied. DEBUGGING ZERO-CROSS A perfectly sinusoidal motor with perfectly balanced windings and perfectly equal drivers will produce a back EMF on the open terminal that is exactly equal to half the motor supply voltage at exactly midway through the commutation period. Nothing in the real world is perfect but it s usually close enough. However, in some cases adjustments need to be made. This is especially true for non-sinusoidal wave shapes. Offsetting the zero-crossing reference voltage can compensate for just about every imperfection. Consider the waveforms in Figure 9. Pictures 9a and 9b show the phase wave shapes for a balanced sinusoidal motor running at about 30% and 60% of maximum speed, respectively. These diagrams are for a high-side modulated system. Notice the symmetry of the wave shapes: the slope and relative position to mid-voltage of the rising voltage on the left is reflected mirror image on the right Microchip Technology Inc. DS01305A-page 11
12 Now consider the waveforms in pictures 9c and 9d. In picture 9c, the left and right slopes are equal, but appear to be offset to the right. In fact, the left slope in picture 9c is offset down and the right side is offset up by the same amount. This is because the zero-crossing is being detected when the motor is only about 25% through the commutation period. In other words, zero-cross is being detected early. That moves the left slope down and the right slope up by an equal amount. Moving the zero-cross reference voltage up, as shown in picture 9d, moves the zero-cross detection later in the commutation period and aligns the drive cycle with the maximum motor generated back EMF for optimum performance. If there is a problem with the zero-cross reference voltage, then that will also offset the BEMF waveform. Consider pictures 9e and 9f. Picture 9e shows the response when the reference is too high, and picture 9f shows the response when the reference is too low. FIGURE 9: DEBUGGING DRIVER CONFIGURATION a. b. c. d. e. f. PERFORMANCE Maximum speed is a function of how quickly the microcontroller can capture and process zero-crossing events and compute the necessary corrections. The time it takes to commutate and compute will determine the minimum commutation period. The time it takes to commutate and setup for zero-cross will determine the minimum half commutation period. The shorter of these two will determine the maximum speed. Minimum speed will be determined on the longest period that can be measured by Timer1. I claimed at the beginning a speed range from 100 RPM to over 90,000 RPM with a system clock of 8 MHz. This is easily verified with the MPLAB simulator. There are six commutations in one electrical revolution. RPM is converted to commutation time with the formula: 10/RPM = Seconds/Commutation Period. At 90,000 RPM, the commutation period is µs and half the commutation period is µs. Using the MPLAB simulator with options set for 8 MHz system clock, the debug stopwatch indicates a total elapsed time 100 µs for the commutation interrupt and 55 µs for the commutation with blanking setup. Those times include context saving and restore before and after the interrupt service. DRIVER CIRCUIT AND SOFTWARE An example circuit for evaluating the concepts of this application note is shown in Appendix A. Schematics. This circuit is of the PIC16F1937 evaluation board (F1 Starter Kit) with BLDC add-on. The software to operate a brushless motor with the starter kit is available for download from the Microchip web site in the same location as this application note. The BLDC add-on board is supplied with a motor to ensure the best possible initial experience. The default code configuration is for the supplied motor. A terminal strip on the BLDC board permits connection of any BLDC motor requiring less than 7 amps peak current. Driving motors other than the supplied motor will most likely require some modifications to the motor header file as mentioned in the Debugging Start-up section of this document. DS01305A-page Microchip Technology Inc.
13 The software is divided into several separate files to simplify mixing and matching different drivers, motors, speed controllers, and microcontrollers. In most applications, changing from one speed control technique or microcontroller is simply a matter of swapping out the corresponding file in the software project. The software has three header files: one for the motor type, one for the driver circuit, and the main header file. The header files are easily identified in the Project View window of MPLAB. The motor type and driver header files contain definitions unique to the motor type or driver circuit. The main header file has definitions common to all motor types and drivers. The main header file also determines which motor and driver header files to include in the project by means of definition macros. Those definition macros are defined in the build options dialog of MPLAB. The dialog is accessed with the pull-down menu Project->Build Options->Project. Select the Compiler tab and Add or Remove defines as appropriate. See the main header file, BLDC.h, for examples. User adjustable parameters are contained, and explained, in the motor header file Microchip Technology Inc. DS01305A-page 13
14 NOTES: DS01305A-page Microchip Technology Inc.
15 Sensorless 3-Phase Brushless Motor Control with the PIC16FXXX Appendix A. Schematics FIGURE A-1: F1 EVALUATION PLATFORM 2009 Microchip Technology Inc. DS01305A-page 15
16 Sensorless 3-Phase Brushless Motor Control with the PIC16FXXX FIGURE A-2: F1 EVALUATION PLATFORM BLDC ADD-ON BD DS01305A-page Microchip Technology Inc.
17 Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular Microchip Data Sheet. Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. Microchip is willing to work with the customer who is concerned about the integrity of their code. Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as unbreakable. Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, dspic, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, rfpic and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MXDEV, MXLAB, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, CodeGuard, dspicdem, dspicdem.net, dspicworks, dsspeak, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, mtouch, Octopus, Omniscient Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, PIC 32 logo, REAL ICE, rflab, Select Mode, Total Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. 2009, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company s quality system processes and procedures are for its PIC MCUs and dspic DSCs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip s quality system for the design and manufacture of development systems is ISO 9001:2000 certified Microchip Technology Inc. DS01305A-page 17
18 WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd. Chandler, AZ Tel: Fax: Technical Support: Web Address: Atlanta Duluth, GA Tel: Fax: Boston Westborough, MA Tel: Fax: Chicago Itasca, IL Tel: Fax: Cleveland Independence, OH Tel: Fax: Dallas Addison, TX Tel: Fax: Detroit Farmington Hills, MI Tel: Fax: Kokomo Kokomo, IN Tel: Fax: Los Angeles Mission Viejo, CA Tel: Fax: Santa Clara Santa Clara, CA Tel: Fax: Toronto Mississauga, Ontario, Canada Tel: Fax: ASIA/PACIFIC Asia Pacific Office Suites , 37th Floor Tower 6, The Gateway Harbour City, Kowloon Hong Kong Tel: Fax: Australia - Sydney Tel: Fax: China - Beijing Tel: Fax: China - Chengdu Tel: Fax: China - Hong Kong SAR Tel: Fax: China - Nanjing Tel: Fax: China - Qingdao Tel: Fax: China - Shanghai Tel: Fax: China - Shenyang Tel: Fax: China - Shenzhen Tel: Fax: China - Wuhan Tel: Fax: China - Xiamen Tel: Fax: China - Xian Tel: Fax: China - Zhuhai Tel: Fax: ASIA/PACIFIC India - Bangalore Tel: Fax: India - New Delhi Tel: Fax: India - Pune Tel: Fax: Japan - Yokohama Tel: Fax: Korea - Daegu Tel: Fax: Korea - Seoul Tel: Fax: or Malaysia - Kuala Lumpur Tel: Fax: Malaysia - Penang Tel: Fax: Philippines - Manila Tel: Fax: Singapore Tel: Fax: Taiwan - Hsin Chu Tel: Fax: Taiwan - Kaohsiung Tel: Fax: Taiwan - Taipei Tel: Fax: Thailand - Bangkok Tel: Fax: EUROPE Austria - Wels Tel: Fax: Denmark - Copenhagen Tel: Fax: France - Paris Tel: Fax: Germany - Munich Tel: Fax: Italy - Milan Tel: Fax: Netherlands - Drunen Tel: Fax: Spain - Madrid Tel: Fax: UK - Wokingham Tel: Fax: /26/09 DS01305A-page Microchip Technology Inc.
AN1286. Water-Resistant Capacitive Sensing INTRODUCTION THEORY OF OPERATION. Sensing Steps. Sensing Steps Description DESIGN
Water-Resistant Capacitive Sensing AN1286 Author: INTRODUCTION Thomas Perme Steven Lin Microchip Technology Inc. This application note describes a new hardware sensing method which is resilient to water
TB3016. Using the PIC MCU CTMU for Temperature Measurement IMPLEMENTATION BASIC PRINCIPLE MEASUREMENT CIRCUIT
Using the PIC MCU CTMU for Temperature Measurement Author: Padmaraja Yedamale Microchip Technology Inc. The Charge Time Measurement Unit (CTMU), introduced on the latest generation of PIC24F and PIC18F
Application Note AN-1187
Application Note AN-1187 IR3230 Sensorless BLDC Motor Drive By Alex Lollio Table of Contents Application Note AN-1234... 1 Introduction... 2 Basic Working Principle... 3 Motor Control... 4 Motor Control
AN1303. Software Real-Time Clock and Calendar Using PIC16F1827 DATA INTERFACE INTRODUCTION IMPLEMENTATION INTERNAL REGISTER MAP
Software Real-Time Clock and Calendar Using PIC16F1827 Author: INTRODUCTION Cristian Toma Microchip Technology Inc. This application note describes the implementation of software Real-Time Clock and Calendar
Recommended Usage of Microchip 23X256/23X640 SPI Serial SRAM Devices RECOMMENDED CONNECTIONS FOR 23X256,23X640 SERIES DEVICES VCC 23X256/ HOLD.
Recommended Usage of Microchip 23X256/23X640 SPI Serial SRAM Devices Author: INTRODUCTION Martin Bowman Microchip Technology Inc. This document details recommended usage of the Microchip 23X256 and 23X640
Installing and Licensing MPLAB XC C Compilers
Installing and Licensing MPLAB XC C Compilers DS50002059G Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular
AN1142. USB Mass Storage Class on an Embedded Host INTRODUCTION. USB Mass Storage Class. Overview
USB Mass Storage Class on an Embedded Host Author: INTRODUCTION With the introduction of Microchip's microcontrollers with the USB OTG peripheral, microcontroller applications can easily support USB Embedded
AN1325. mtouch Metal Over Cap Technology THEORY OF OPERATION INTRODUCTION CROSS SECTION OF METAL OVER CAPACITIVE (UNPRESSED)
mtouch Metal Over Cap Technology AN1325 Authors: INTRODUCTION Keith Curtis Dieter Peter Microchip Technology Inc. As a user interface, capacitive touch has several advantages: it is low power, low cost,
AN687. Precision Temperature-Sensing With RTD Circuits RTD OVERVIEW INTRODUCTION EQUATION 1:
Precision Temperature-Sensing With RTD Circuits Author: INTRODUCTION Bonnie C. Baker Microchip Technology Inc. The most widely measured phenomena in the process control environment is temperature. Common
AN1199. 1-Wire Communication with PIC Microcontroller INTRODUCTION. OVERVIEW OF THE 1-Wire BUS. 1-Wire Protocol. Prerequisites
1-Wire Communication with PIC Microcontroller Author: INTRODUCTION This application note introduces the user to the 1-Wire communication protocol and describes how a 1-Wire device can be interfaced to
Universal Programming Module 2
Universal Programming Module OVERVIEW The Universal Programming Module (UPM) is a handy, low-cost board that supports the programming of Microchip devices using MPLAB in-circuit emulators and debuggers.
AN905. Brushed DC Motor Fundamentals INTRODUCTION PRINCIPLES OF OPERATION. Stator. Rotor SIMPLE TWO-POLE BRUSHED DC MOTOR. Microchip Technology Inc.
Brushed DC Motor Fundamentals AN905 Author: Reston Condit Microchip Technology Inc. INTRODUCTION Brushed DC motors are widely used in applications ranging from toys to push-button adjustable car seats.
AN1470. Manchester Decoder Using the CLC and NCO ABSTRACT INTRODUCTION MANCHESTER ENCODED DATA (AS PER G.E. THOMAS)
Manchester Decoder Using the CLC and NCO Authors: ABSTRACT A Manchester decoder can be built using Microchip s award winning CLC (Configurable Logic Cell) blocks and NCO (Numerically Controlled Oscillator)
Features, Value and Benefits of Digital Control for Power Supplies
Author: INTRODUCTION Sagar Khare Microchip Technology Inc. Control of Switch Mode Power Supplies (SMPSs) has traditionally been a purely analog domain. The advent of low-cost, high-performance Digital
Uninstalling Incorrect USB Device Drivers
DEVELOPMENT SYSTEMS Uninstalling Incorrect USB Device Drivers RECOMMENDED UNINSTALL METHODS When using the Microchip development tools listed below, trouble may be experienced as a result of incorrect
TC1047/TC1047A. Precision Temperature-to-Voltage Converter. General Description. Applications. Block Diagram. Features.
Precision Temperature-to-Voltage Converter Features Supply Voltage Range: - TC147: 2.7V to 4.4V - TC147A: 2.V to.v Wide Temperature Measurement Range: - -4 o C to +12 o C High Temperature Converter Accuracy:
AN1332. Current Sensing Circuit Concepts and Fundamentals CURRENT SENSING RESISTOR INTRODUCTION. Description. Microchip Technology Inc.
Current Sensing Circuit Concepts and Fundamentals Author: INTRODUCTION Yang Zhen Microchip Technology Inc. Current sensing is a fundamental requirement in a wide range of electronic applications. Typical
AN1275. KEELOQ with Advanced Encryption Standard (AES) Receiver/Decoder KEY FEATURES OVERVIEW. Microchip Technology Inc.
KEELOQ with Advanced Encryption Standard (AES) Receiver/Decoder Author: OVERVIEW Enrique Aleman Microchip Technology Inc. This application note describes a KEELOQ with AES code hopping decoder implemented
AN1156. Battery Fuel Measurement Using Delta-Sigma ADC Devices INTRODUCTION REVIEW OF BATTERY CHARGING AND DISCHARGING CHARACTERISTICS
Battery Fuel Measurement Using Delta-Sigma ADC Devices Author: INTRODUCTION Youbok Lee, Ph.D. Microchip Technology Inc. The battery fuel status indicator is a common feature of the battery-supported handheld
Section 15. Input Capture
Section 15. Input Capture HIGHLIGHTS This section of the manual contains the following topics: 15.1 Introduction...15-2 15.2 Input Capture Registers...15-4 15.3 Timer Selection...15-8 15.4 Input Capture
AN1353. Op Amp Rectifiers, Peak Detectors and Clamps INTRODUCTION BASIC RECTIFIERS. Choosing the Components. Positive Half-Wave Rectifier.
Op Amp Rectifiers, Peak Detectors and Clamps Author: Dragos Ducu, Microchip Technology Inc. INTRODUCTION This application note covers a wide range of applications, such as halfwave rectifiers, fullwave
Timers: Timer0 Tutorial (Part 1)
Timers: Timer0 Tutorial (Part 1) 2007 Microchip Technology Inc. DS51682A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained
AN1492. Microchip Capacitive Proximity Design Guide INTRODUCTION CAPACITIVE SENSING BASICS SENSING
Microchip Capacitive Proximity Design Guide Author: INTRODUCTION Xiang Gao Microchip Technology Inc. Proximity detection provides a new way for users to interact with electronic devices without having
AN1857. RGBW Color Mixing DALI Control Gear. COLOR MIXING USING RED, GREEN, BLUE AND WHITE LEDs INTRODUCTION HARDWARE
RGBW Color Mixing DALI Control Gear AN1857 Author: INTRODUCTION Mihai Cuciuc Microchip Technology Inc. This application note provides an example of obtaining custom colors by combining the spectra of the
TC7660. Charge Pump DC-to-DC Voltage Converter. Package Types. Features. General Description. Applications. Functional Block Diagram TC7660
Charge Pump DC-to-DC Voltage Converter Features Wide Input Voltage Range:.V to V Efficient Voltage Conversion (99.9%, typ) Excellent Power Efficiency (9%, typ) Low Power Consumption: µa (typ) @ V IN =
AN1307 FULL STEP MODE PHASE VOLTAGE AND PHASE CURRENT MICROSTEPPING WITH 1/4 STEP SIZE
Stepper Motor Control with dspic DSCs AN1307 Author: INTRODUCTION Sorin Manea Microchip Technology Inc. This application note describes how to drive a stepper motor with a dspic33f motor control family
AN1265. KEELOQ with AES Microcontroller-Based Code Hopping Encoder INTRODUCTION DUAL ENCODER OPERATION BACKGROUND FUNCTIONAL INPUTS AND
KEELOQ with AES Microcontroller-Based Code Hopping Encoder Authors: INTRODUCTION This application note describes the design of a microcontroller-based KEELOQ Hopping Encoder using the AES encryption algorithm.
MCP73X23 Lithium Iron Phosphate (LiFePO 4 ) Battery Charger Evaluation Board User s Guide
MCP73X23 Lithium Iron Phosphate (LiFePO 4 ) Battery Charger Evaluation Board User s Guide 2009 Microchip Technology Inc. DS51850A Note the following details of the code protection feature on Microchip
AN1543. Using MRF24W with PIC32 Internal Program Flash Memory For EZ_CONFIG_STORE ALTERNATIVE LOW-COST SOLUTIONS OVERVIEW SCOPE
Using MRF24W with PIC32 Internal Program Flash Memory For EZ_CONFIG_STORE Author: OVERVIEW This application note describes the EZ_CONFIG_STORE feature used in the Wi-Fi G Demo Board and TCPIP-WiFi EZConfig
PIC32 Microcontroller Families
32-bit Microcontrollers Winter 2009 PIC32 Microcontroller Families With USB, CAN and Ethernet www.microchip.com/pic32 Building on the heritage of Microchip Technology s world-leading 8- and 16-bit PIC
Touch Through Metal. mtouch Metal Over Capacitive Technology Part 1
Touch Through Metal mtouch Metal Over Capacitive Technology Part 1 2010 Microchip Technology Incorporated. All Rights Reserved. Touch Through Metal Slide 1 Hello and welcome to Microchip s Touch Through
Integrated Development Environment
Development Tools Integrated Development Environment Transforming Ideas Into Realities The typical product development life cycle is comprised of smaller cycles each representing an iterative process toward
Designing A Li-Ion Battery Charger and Load Sharing System With Microchip s Stand-Alone Li-Ion Battery Charge Management Controller
Designing A Li-Ion Battery Charger and Load Sharing System With Microchip s Stand-Alone Li-Ion Battery Charge Management Controller Author: INTRODUCTION Brian Chu Microchip Technology Inc. Batteries often
AN1066. Microchip MiWi Wireless Networking Protocol Stack INTRODUCTION CONSIDERATIONS TERMINOLOGY FEATURES
Microchip MiWi Wireless Networking Protocol Stack Author: INTRODUCTION Implementing applications with wireless networking is now common. From consumer devices to industrial applications, there is a growing
Peripheral Brief: Programmable Switch Mode Controller (PSMC) 1, 2, 4, 8 PSMCXTMR CLR PSMCXPR = Period. Event PSMCXPRS. Rising.
Peripheral Brief: Programmable Switch Mode Controller (PSMC) Author: INTRODUCTION John Mouton Microchip Technology Inc. This peripheral brief reviews the basic functionality of the Programmable Switch
MPLAB XC8 GETTING STARTED GUIDE. MPLAB XC8 Getting Started Guide
MPLAB XC8 GETTING STARTED GUIDE MPLAB XC8 Getting Started Guide This document provides a starting point for programmers who are just starting out with the MPLAB XC8 C Compiler, particularly those who are
WORKSHOP-IN-A-BOX 2: LOW POWER SOLUTIONS DEMONSTRATION BOARD
WORKSHOP-IN-A-BOX 2: LOW POWER SOLUTIONS DEMONSTRATION BOARD 2004 Microchip Technology Inc. DS51512A Note the following details of the code protection feature on Microchip devices: Microchip products meet
MCP2200 USB to RS-232 Demo Board User s Guide
MCP2200 USB to RS-232 Demo Board User s Guide DS51901A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular
Analog-to-Digital Converters
Analog-to-Digital Converters In this presentation we will look at the Analog-to-Digital Converter Peripherals with Microchip s midrange PICmicro Microcontrollers series. 1 Analog-to-Digital Converters
AN1160. Sensorless BLDC Control with Back-EMF Filtering Using a Majority Function SENSORED CONTROL VERSUS SENSORLESS CONTROL INTRODUCTION
Sensorless BLDC Control with Back-EMF Filtering Using a Majority Function Author: INTRODUCTION Adrian Lita and Mihai Cheles Microchip Technology Inc. This application note describes a sensorless Brushless
Integrated Development Environment
Development Tools Integrated Development Environment Transforming Ideas Into Realities The typical product development life cycle is comprised of smaller cycles each representing an iterative process toward
AN1212. Using USB Keyboard with an Embedded Host INTRODUCTION. USB Keyboard Overview. USB Keyboard with an Embedded Host USB KEYBOARD OUTPUT REPORT
Using USB Keyboard with an Embedded Host Author: INTRODUCTION Amardeep Gupta Microchip Technology Inc. Microcontroller applications can easily support USB embedded host functionality with the introduction
PIC18F26K20/46K20 Rev. B2/B3/B5/B6 Silicon Errata and Data Sheet Clarification
PIC18F26K20/46K20 Rev. B2/B3/B5/B6 Silicon Errata and Data Sheet Clarification The PIC18F26K20/46K20 family devices that you have received conform functionally to the current Device Data Sheet (DS41303G),
Resistive Temperature Detector (RTD) Reference Design
Resistive Temperature Detector (RTD) Reference Design DS51891A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their
TCP/IP Networking: Web-Based Status Monitoring
TCP/IP Networking: Web-Based Status Monitoring Microchip TCP/IP Stack HTTP2 Module 2007 Microchip Technology Incorporated. All Rights Reserved. Web-Based Status Monitoring Slide 1 Welcome to the first
APPLICATION NOTE. Atmel AVR443: Sensor-based Control of Three Phase Brushless DC Motor. Atmel AVR 8-bit Microcontrollers. Features.
APPLICATION NOTE Features Atmel AVR443: Sensor-based Control of Three Phase Brushless DC Motor Less than 5µs response time on Hall sensor output change Theoretical maximum of 1600k RPM Over-current sensing
Section 5. Flash Programming
Section 5. Flash Programming HIGHLIGHTS This section of the manual contains the following topics: 5.1 Introduction...5-2 5.2 Control Registers... 5-3 5.3 Run-Time Self-Programming (RTSP) Operation... 5-10
AN1256. Microchip s Power MOSFET Driver Simulation Models INTRODUCTION MODEL DESCRIPTION. Using The Power MOSFET Simulation Models
Microchip s Power MOSFET Driver Simulation Models Author: INTRODUCTION Cliff Ellison (Microchip Technology Inc.) Ron Wunderlich (Innovative Ideas and Design) The simulation models for Microchip s power
AN2680 Application note
Application note Fan speed controller based on STDS75 or STLM75 digital temperature sensor and ST72651AR6 MCU Introduction This application note describes the method of defining the system for regulating
dspic30f3012/3013 dspic30f3012/3013 Rev. B0 Silicon Errata dspic30f3012/3013 (Rev. B0) Silicon Errata Silicon Errata Summary
dspic30f3012/3013 Rev. B0 Silicon Errata dspic30f3012/3013 (Rev. B0) Silicon Errata The dspic30f3012/3013 (Rev. B0) samples you have received were found to conform to the specifications and functionality
Flexible Active Shutter Control Interface using the MC1323x
Freescale Semiconductor Document Number: AN4353 Application Note Rev. 0, 9/2011 Flexible Active Shutter Control Interface using the MC1323x by: Dennis Lui Freescale Hong Kong 1 Introduction This application
AN1465. Digitally Addressable Lighting Interface (DALI) Communication TERMINOLOGY PHYSICAL LAYER DALI FREE-FORM LAYOUT. Topology FIGURE 1:
Digitally Addressable Lighting Interface (DALI) Communication Author: Shaima Husain Microchip Technology Inc. The Digitally Addressable Lighting Interface (DALI) has emerged as a standard in Europe to
MPLAB Code Configurator User s Guide
MPLAB Code Configurator User s Guide 2013-2014 Microchip Technology Inc. DS40001725B MPLAB CODE CONFIGURATOR USER S GUIDE Note the following details of the code protection feature on Microchip devices:
MCP2515 CAN Bus Monitor Demo Board User s Guide
MCP2515 CAN Bus Monitor Demo Board User s Guide 2008 Microchip Technology Inc. DS51757A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification
PICmicro DC Motor Control Tips n Tricks
PICmicro DC Motor Control Tips n Tricks M Table of Contents Tips n Tricks Tips N Tricks Introduction TIP #1: Brushed DC Motor Drive Circuits...2 TIP #2: Brushless DC Motor Drive Circuits...5 TIP #3: Stepper
MPLAB ICD 3 In-Circuit Debugger User s Guide For MPLAB X IDE
MPLAB ICD 3 In-Circuit Debugger User s Guide For MPLAB X IDE DS52081A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained
How to Turn an AC Induction Motor Into a DC Motor (A Matter of Perspective) Steve Bowling Application Segments Engineer Microchip Technology, Inc.
1 How to Turn an AC Induction Motor Into a DC Motor (A Matter of Perspective) Steve Bowling Application Segments Engineer Microchip Technology, Inc. The territory of high-performance motor control has
28-PIN DEMO BOARD USER S GUIDE
28-PIN DEMO BOARD USER S GUIDE 2006-2015 Microchip Technology Inc. DS40001301B Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification
TABLE 1: BUCK REGULATOR
A Digital Constant Current Power LED Driver Author: INTRODUCTION Stephen Bowling Microchip Technology Inc. This document describes a power LED driver solution using the PIC12HV615 microcontroller (MCU).
F1 LV Evaluation Platform Motor Control Add-Ons User s Guide
F1 LV Evaluation Platform Motor Control Add-Ons User s Guide DS41629A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained
MCP1701A. 2 µa Low-Dropout Positive Voltage Regulator. Features. General Description. Applications. Package Types
2 µa Low-Dropout Positive Voltage Regulator Features 2.0 µa Typical Quiescent Current Input Operating Voltage Range up to 10.0V Low-Dropout Voltage (LDO): - 120 mv (typical) @ 100 ma - 380 mv (typical)
AN709. System Level Design Considerations When Using I 2 C TM Serial EEPROM Devices INTRODUCTION INSURING BUS-FREE DURING POWER-UP
M AN709 System Level Design Considerations When Using I 2 C TM Serial EEPROM Devices Author: INTRODUCTION Rick Stoneking Developing systems that implement the I 2 C protocol for communicating with serial
APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.
APPLICATION NOTE Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer Introduction Atmel AVR 8-bit Microcontroller This application note describes how to implement a real time counter (RTC)
PICkit 3 Programmer/Debugger User s Guide
PICkit 3 Programmer/Debugger User s Guide 2009 Microchip Technology Inc. DS51795A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification
Microcontroller for Variable Speed BLDC Fan Control System. T.C. Lun System Engineer, Freescale Semiconductor, Inc.
Microcontroller for Variable Speed BLDC Fan Control System T.C. Lun System Engineer, Freescale Semiconductor, Inc. 1 Introduction Portable, feature rich, high-performance and compact in size are typical
AN1370. Smart Card Communication Using PIC MCUs INTRODUCTION SMART CARD COMMUNICATION USING PC APPLICATION
Smart Card Communication Using PIC MCUs Author: INTRODUCTION Abhay Deshmukh Microchip Technology Inc. This application note describes the fundamentals of the contact type smart cards and how they are communicated
AN645. PIC16C57 Based Code Hopping Security System PINOUT OVERVIEW FEATURES BLOCK DIAGRAM RECOMMENDED READING
PI657 Based ode Hopping Security System Author: OVERVIEW This document describes a PI657 based code hopping automotive security system. The security system implements all the basic features found on security
AN3332 Application note
Application note Generating PWM signals using STM8S-DISCOVERY Application overview This application user manual provides a short description of how to use the Timer 2 peripheral (TIM2) to generate three
AN956. Migrating Applications to USB from RS-232 UART with Minimal Impact on PC Software OVERVIEW INTRODUCTION. Microchip Technology Inc.
Migrating Applications to USB from RS-232 UART with Minimal Impact on PC Software Author: INTRODUCTION Rawin Rojvanit Microchip Technology Inc. The RS-232 serial interface is no longer a common port found
Serial EEPROM Powered for Automotive
Automotive Memory Products Serial EEPROM Powered for Automotive www.microchip.com/memory Microchip Serial Memory Products Microchip Technology has developed industry-leading processes for each step in
AN232. Low-Frequency Magnetic Transmitter Design ABOUT THIS APPLICATION NOTE INTRODUCTION LFMC LINK COMPONENTS
Low-Frequency Magnetic Transmitter Design AN232 Author: INTRODUCTION Ruan Lourens Microchip Technology Inc. Low-frequency magnetic communications (LFMC) is a viable wireless communications alternative
AN3265 Application note
Application note Handling hardware and software failures with the STM8S-DISCOVERY Application overview This application is based on the STM8S-DISCOVERY. It demonstrates how to use the STM8S window watchdog
AN1767. Solutions for Radio Frequency Electromagnetic Interference in Amplifier Circuits WHAT IS ELECTROMAGNETIC INTERFERENCE (EMI)
Solutions for Radio Frequency Electromagnetic Interference in Amplifier Circuits Author: Dragos-George Ducu Microchip Technology Inc. WHAT IS ELECTROMAGNETIC INTERFERENCE (EMI) Nowadays, the number of
AN1861. Bluetooth Smart Communication Using Microchip RN4020 Module and 16-bit PIC Microcontroller BLUETOOTH SMART COMMUNICATION INTRODUCTION
Bluetooth Smart Communication Using Microchip RN4020 Module and 16-bit PIC Microcontroller Author: Venkatesh Bengeri and Pradeep Shamanna INTRODUCTION Most of the embedded applications require real-time
TCM809/TCM810. 3-Pin Microcontroller Reset Monitors. General Description. Features. Applications. Pin Configurations. Typical Application Circuit
3-Pin Microcontroller Reset Monitors Features Precision Monitor for 2.5V, 3.V, 3.3V, 5.V Nominal System Voltage Supplies 14 msec Minimum RESET Time-Out Period RESET Output to = 1.V (TCM89) Low Supply Current,
Section 14. Compare/Capture/PWM (CCP)
M Section 14. Compare/Capture/PWM (CCP) HIGHLIGHTS This section of the manual contains the following major topics: 14.1 Introduction...14-2 14.2 Control Register...14-3 14.3 Capture Mode...14-4 14.4 Compare
An Introduction to MPLAB Integrated Development Environment
An Introduction to MPLAB Integrated Development Environment 2004 Microchip Technology Incorporated An introduction to MPLAB Integrated Development Environment Slide 1 This seminar is an introduction to
How To Use Microchip.Com
PICkit 2 Programmer/Debugger User s Guide 2008 Microchip Technology Inc. DS51553E Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification
AN3252 Application note
Application note Building a wave generator using STM8L-DISCOVERY Application overview This application note provides a short description of how to use the STM8L-DISCOVERY as a basic wave generator for
AN1387. Using PIC32 MCUs to Develop Low-Cost Controllerless (LCC) Graphics Solutions INTRODUCTION. Basic Graphics Definitions
Using PIC32 MCUs to Develop Low-Cost Controllerless (LCC) Graphics Solutions Author: INTRODUCTION Adam Folts, Microchip Technology Inc. As the demand for Graphical Embedded Applications becomes more popular,
Software Real Time Clock Implementation on MC9S08LG32
Freescale Semiconductor Document Number: AN4478 Rev. 0, 03/2012 Software Real Time Clock Implementation on MC9S08LG32 by: Nitin Gupta Automotive and Industrial Solutions Group 1 Introduction The MC9S08LG32
Section 15. Quadratrure Encoder Interface (QEI)
Section 15. Quadratrure Encoder Interface (QEI) HIGHLIGHTS This section of the manual contains the following major topics: 15.1 Introduction... 15-2 15.2 Control and Status Registers... 15-4 15.3 Programmable
Timer A (0 and 1) and PWM EE3376
Timer A (0 and 1) and PWM EE3376 General Peripheral Programming Model Each peripheral has a range of addresses in the memory map peripheral has base address (i.e. 0x00A0) each register used in the peripheral
AN3327 Application note
AN3327 Application note L9942 back EMF stall detection algorithm Introduction The L9942 is an integrated stepper motor driver for bipolar stepper motors used primarily in automotive head lamp leveling.
AVR127: Understanding ADC Parameters. Introduction. Features. Atmel 8-bit and 32-bit Microcontrollers APPLICATION NOTE
Atmel 8-bit and 32-bit Microcontrollers AVR127: Understanding ADC Parameters APPLICATION NOTE Introduction This application note explains the basic concepts of analog-to-digital converter (ADC) and the
Controlling a Dot Matrix LED Display with a Microcontroller
Controlling a Dot Matrix LED Display with a Microcontroller By Matt Stabile and programming will be explained in general terms as well to allow for adaptation to any comparable microcontroller or LED matrix.
ETEC 421 - Digital Controls PIC Lab 10 Pulse Width Modulation
ETEC 421 - Digital Controls PIC Lab 10 Pulse Width Modulation Program Definition: Write a program to control the speed of a dc motor using pulse width modulation. Discussion: The speed of a dc motor is
Current Loop Tuning Procedure. Servo Drive Current Loop Tuning Procedure (intended for Analog input PWM output servo drives) General Procedure AN-015
Servo Drive Current Loop Tuning Procedure (intended for Analog input PWM output servo drives) The standard tuning values used in ADVANCED Motion Controls drives are conservative and work well in over 90%
Display Board Pulse Width Modulation (PWM) Power/Speed Controller Module
Display Board Pulse Width Modulation (PWM) Power/Speed Controller Module RS0 Microcontroller LEDs Motor Control Pushbuttons Purpose: To demonstrate an easy way of using a Freescale RS0K2 microcontroller
AN1426. Design Tips for the MCP3911 INTRODUCTION. Addressable Devices on Single SPI Bus. Addressable SPI for Poly-phase Meter Designs.
Design Tips for the MCP3911 AN1426 Author: Craig King Microchip Technology Inc. Here, pushing the limits of the analog-to-digital conversion will be the focus, showing the true performance limits of the
Introduction to SMPS Control Techniques
Introduction to SMPS Control Techniques 2006 Microchip Technology Incorporated. All Rights Reserved. Introduction to SMPS Control Techniques Slide 1 Welcome to the Introduction to SMPS Control Techniques
AN990. Analog Sensor Conditioning Circuits An Overview INTRODUCTION SENSOR APPLICATIONS. Target Audience. Goals. Description.
Analog Conditioning Circuits An Overview Author: INTRODUCTION Target Audience This application note is intended for hardware design engineers that need to condition the output of common analog sensors.
8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter
AVR400: Low Cost A/D Converter Features Interrupt Driven : 23 Words Low Use of External Components Resolution: 6 Bits Measurement Range: 0-2 V Runs on Any AVR Device with 8-bit Timer/Counter and Analog
AN2389 Application note
Application note An MCU-based low cost non-inverting buck-boost converter for battery chargers Introduction As the demand for rechargeable batteries increases, so does the demand for battery chargers.
8-bit RISC Microcontroller. Application Note. AVR182: Zero Cross Detector
AVR182: Zero Cross Detector Features Interrupt Driven Modular C Source Code Size Efficient Code Accurate and Fast Detection A Minimum of External Components Introduction One of the many issues with developing
3-Phase BLDC Motor Control with Hall Sensors Using 56800/E Digital Signal Controllers
Freescale Semiconductor Application Note AN1916 Rev. 2.0, 11/2005 3-Phase BLDC Motor Control with Hall Sensors Using 56800/E Digital Signal Controllers Leonard N. Elevich Contents 1. Application Benefits...1
Real-Time Clock. * Real-Time Computing, edited by Duncan A. Mellichamp, Van Nostrand Reinhold
REAL-TIME CLOCK Real-Time Clock The device is not a clock! It does not tell time! It has nothing to do with actual or real-time! The Real-Time Clock is no more than an interval timer connected to the computer
BLDC Motor Control with Hall Effect Sensors Using the 9S08MP
Freescale Semiconductor Application Note Document Number: AN458 Rev., 4/2 BLDC Motor Control with Hall Effect Sensors Using the 9S8MP by: Eduardo Viramontes Systems and Applications Engineering Freescale
LIN Serial Analyzer User s Guide Rev2.0
LIN Serial Analyzer User s Guide Rev2.0 2008 Microchip Technology Inc. DS51675B Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification
