Академический Документы
Профессиональный Документы
Культура Документы
Chapter 1
INTRODUCTION
Recent developments in power electronics, fast digital signal processors (DSPs) and modern control technologies have significantly influenced the wide spread use of permanent magnet brushless (BLDC) motor [3] drives in order to meet the competitive worldwide market demands of manufactured goods, devices, products and processors. Large, medium, small as well as micro BLDC motors are extensively sought for applications in all sorts of motion control [5] apparatus and systems. The availability of smart power electronics devices and their optimal topologies has accelerated unprecedented growth of cost effective and reliable inverter and converter systems. Software controlled online implementation of sophisticated robust controllers has advanced the art of digital control of BLDC motor drives.
In electric traction, like in other applications, a wide range in speed and torque control for the electric motor is desired. The DC machine fulfils these requirements but these machines needs periodic maintenance. The AC machines like induction motors and brushless DC [1] motor does not have brushes, and their rotors are robust because commutator and or rings do not exist. That means very low maintenance. This also increases the power to weight ratio and efficiency. For induction motors flux control has been developed, which offers a high dynamic performance for electric traction application however this control type is complex and sophisticated.
The development of BLDC has permitted an important simplification in the hardware for electric traction control. The term Brushless DC motor [1] is used to identify the combination of AC machine, solid state inverter and rotor position sensor that results in a drive system having a linear torque speed characteristic as in an conventional DC machine High efficiency due to reduced losses, low maintenance and low rotor inertia of the BLDC motor have increased the demand of BLDC motors in high power servo and robotic applications.
Page 1
The invention of modern solid state devices like MOSFET, IGBT and high energy have widely enhanced the applications of BLDC motors in variable speed drives. In this work, a digital controller is developed for this drive which uses minimum number of components employing a recently introduced DSP (dsPIC0F2010) by Microchip for power electronics applications. First the control scheme of the drive is analysed and its simulated results are validated with test results obtained from developed digital controller.
Page 2
Chapter 2
As the name implies, BLDC motors do not use brushes for commutation; instead, they are electronically commutated. BLDC motors have many advantages over brushed DC motors and induction motors. A few of these are:
Better speed versus torque characteristics High dynamic response High efficiency Long operating life Noiseless operation Higher speed ranges
In addition, the ratio of torque delivered to the size of the motor is higher, making it useful in applications where space and weight are critical factors. In this application note, we will discuss in detail the construction, working principle, characteristics and typical applications of BLDC motors.
Page 3
BLDC motors come in single-phase, 2-phase and 3-phase configurations. Corresponding to its type, the stator has the same number of windings. Out of these, 3-phase motors are the most popular and widely used. This application note focuses on 3-phase motors
2.2.1 Stator
The stator of a BLDC motor consists of stacked steel laminations with windings placed in the slots that are axially cut along the inner periphery. Traditionally, the stator resembles that of an induction motor; however, the windings are distributed in a different manner. Most BLDC motors have three stator windings connected in star fashion. Each of these windings is constructed with numerous coils interconnected to form a winding. One or more coils are placed in the slots and they are interconnected to make a winding. Each of these windings is distributed over the stator periphery to form an even numbers of poles.
There are two types of stator windings variants: Trapezoidal motors Sinusoidal motors
This differentiation is made on the basis of the interconnection of coils in the stator windings to give the different types of back Electromotive Force (EMF). As their names
AMC Engineering College | Dept. of EEE Page 4
indicate, the trapezoidal motor gives a back EMF in trapezoidal fashion and the sinusoidal motors back EMF is sinusoidal, as shown in Figure 1 and Figure 2. In addition to the back EMF, the phase current also has trapezoidal and sinusoidal variations in the respective types of motor. This makes the torque output by a sinusoidal motor smoother than that of a trapezoidal motor. However, this comes with an extra cost, as the sinusoidal motors take extra winding interconnections because of the coils distribution on the stator periphery, thereby increasing the copper intake by the stator windings. Depending upon the control power supply capability, the motor with the correct voltage rating of the stator can be chosen. Forty-eight volts, or less voltage rated motors are used in automotive, robotics, small arm movements and so on. Motors with 100 volts, or higher ratings, are used in appliances, automation and in industrial applications.
Page 5
2.2.2 Rotor
The rotor is made of permanent magnet and can vary from two to eight pole pairs with alternate North (N) and South (S) poles. Based on the required magnetic field density in the rotor, the proper magnetic material is chosen to make the rotor. Ferrite magnets are traditionally used to make permanent magnets. As the technology advances, rare earth alloy magnets are gaining popularity. The ferrite magnets are less expensive but they
AMC Engineering College | Dept. of EEE Page 6
have the disadvantage of low flux density for a given volume. In contrast, the alloy material has high magnetic density per volume and enables the rotor to compress further for the same torque. Also, these alloy magnets improve the size-to-weight ratio and give higher torque for the same size motor using ferrite magnets. Neodymium (Nd), Samarium Cobalt (SmCo) and the alloy of Neodymium, Ferrite and Boron (NdFeB) are some examples of rare earth alloy magnets. Continuous research is going on to improve the flux density to compress the rotor further. Figure below shows cross sections of different arrangements of magnets in a rotor.
Most BLDC motors have three Hall sensors embedded into the stator on the non-driving end of the motor. Whenever the rotor magnetic poles pass near the Hall sensors, they give a high or low signal, indicating the N or S pole is passing near the sensors. Based on the combination of these three Hall sensor signals, the exact sequence of commutation can be determined.
AMC Engineering College | Dept. of EEE Page 7
Above figure shows a transverse section of a BLDC motor with a rotor that has alternate N and S permanent magnets. Hall sensors are embedded into the stationary part of the motor. Embedding the Hall sensors into the stator is a complex process because any misalignment in these Hall sensors, with respect to the rotor magnets, will generate an error in determination of the rotor position. To simplify the process of mtounting the Hall sensors onto the stator, some motors may have the Hall sensor magnets on the rotor, in addition to the main rotor magnets. These are a scaled down replica version of the rotor. Therefore, whenever the rotor rotates, the Hall sensor magnets give the same effect as the main magnets. The Hall sensors are normally mounted on a PC board and fixed to the enclosure cap on the non-driving end. This enables users to adjust the complete assembly of Hall sensors, to align with the rotor magnets, in order to achieve the best performance.
Based on the physical position of the Hall sensors, there are two versions of output. The Hall sensors may be at 60 or 120 phase shift to each other. Based on this, the motor manufacturer defines the commutation sequence, which should be followed when controlling the motor.
Page 8
Applications that have frequent starts and stops and frequent reversals of rotation with load on the motor, demand more torque than the rated torque. This requirement comes for a brief period, especially when the motor starts from a standstill and during acceleration. During this period, extra torque is required to overcome the inertia of the load and the rotor itself. The motor can deliver a higher torque, maximum up to peak torque, as long as it follows the speed torque curve.
Page 9
Every 60 electrical degrees of rotation, one of the Hall sensors changes the state. Given this, it takes six steps to complete an electrical cycle. In synchronous, with every 60 electrical degrees, the phase current switching should be updated. However, one electrical cycle may not correspond to a complete mechanical revolution of the rotor. The number of electrical cycles to be repeated to complete a mechanical rotation is
Page 10
determined by the rotor pole pairs. For each rotor pole pairs, one electrical cycle is completed. So, the number of electrical cycles/rotations equals the rotor pole pairs.
Table 3 and Table 4 show the sequence in which these power switches should be switched based on the Hall sensor inputs, A, B and C. Table 3 is for clockwise rotation of the motor and Table 4 is for counter clockwise motor rotation. This is an example of Hall sensor signals having a 60 degree phase shift with respect to each other.
Page 11
Page 12
Chapter 3
dsPIC30F2010
3.1 Introduction
The dsPIC30F2010 [2] is a 28-pin 16-bit MCU specifically designed for embedded motor control applications. AC Induction Motors (ACIM), Brushless DC (BLDC) and DC are some typical motor types for which the dsPIC30F2010 has been specifically designed.
3.2 Features
Modified Harvard architecture C compiler optimized instruction set architecture 84 base instructions with flexible addressing modes 24-bit wide instructions, 16-bit wide data path 12 Kbytes on-chip Flash program space 512 bytes on-chip data RAM 1 Kbyte non-volatile data EEPROM 16 x 16-bit working register array Up to 30 MIPs operation o DC to 40 MHz external clock input o 4 MHz-10 MHz oscillator input with PLL active (4x, 8x, 16x) 27 interrupt sources Three external interrupt sources 8 user selectable priority levels for each interrupt 4 processor exceptions and software traps
Page 13
Page 14
Programmable code protection In-Circuit Serial Programming (ICSP) Selectable Power Management modes o Sleep, Idle and Alternate Clock modes
Page 16
Page 17
CN0 CN7 EMUD EMUC EMUD1 EMUC1 EMUD2 EMUC2 EMUD3 EMUC3 IC1, IC2, IC7, IC8 INDX QEA QEB
ST ST ST ST ST ST ST ST ST ST
I I I
ST ST ST
INT0 INT1 INT2 FLTA PWM1L PWM1H PWM2L PWM2H PWM3L PWM3H MCLR
I I I I O O O O O O I/P
ST ST ST ST ST ST
Page 18
PGD PGC RB0-RB5 RC13RC14 RD0RD1 RE0-RE5, RE8 RF2, RF3 SCK1 SDI1 SDO1 SS1 SCL SDA SOSCO SOSCI T1CK T2CK U1RX U1TX U1ARX U1ATX VDD VSS VREF+ VREFLegend CMOS Analog ST O I P
Buffer Description Type ST/CMOS Oscillator crystal input. ST buffer when configured in RC mode; CMOS otherwise. Oscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode. Optionally functions as CLKO in RC and EC modes. ST In-Circuit Serial Programming data input/output pin. ST In-Circuit Serial Programming clock input pin. ST PORTB is a bidirectional I/O port. ST PORTC is a bidirectional I/O port. ST ST ST ST ST ST ST ST ST/CMOS ST ST ST ST Analog Analog PORTD is a bidirectional I/O port. PORTE is a bidirectional I/O port. PORTF is a bidirectional I/O port. Synchronous serial clock input/output for SPI #1. SPI #1 Data In. SPI #1 Data Out. SPI #1 Slave Synchronization. Synchronous serial clock input/output for I2CTM Synchronous serial data input/output for I2CTM. 32 kHz low power oscillator crystal output. 32 kHz low power oscillator crystal input. ST buffer when configured in RC mode; CMOS otherwise. Timer1 external clock input. Timer2 external clock input. UART1 Receive. UART1 Transmit. UART1 Alternate Receive. UART1 Alternate Transmit. Positive supply for logic and I/O pins. Ground reference for logic and I/O pins. Analog Voltage Reference (High) input. Analog Voltage Reference (Low) input.
CMOS compatible input or output Analog input Schmitt Trigger input with CMOS levels Output Input Power
Page 19
The working register array consists of 16x16-bit registers, each of which can act as data, address or offset registers. One working register (W15) operates as a software stack pointer for interrupts and calls. The data space is 64 Kbytes (32K words) and is split into two blocks, referred to as X and Y data memory. Each block has its own independent Address Generation Unit (AGU). Most instructions operate solely through the X memory AGU, which provides the appearance of a single unified data space. The MultiplyAccumulate (MAC) class of dual source DSP instructions operate through both the X and Y AGUs, splitting the data address space into two parts (see Section 3.2). The X and Y data space boundary is device specific and cannot be altered by the user. Each data word consists of 2 bytes, and most instructions can address data either as words or bytes. There are two methods of accessing data stored in program memory: The upper 32 Kbytes of data space memory can be mapped into the lower half (user space) of program space at any 16K program word boundary, defined by the 8-bit Program Space Visibility Page (PSVPAG) register. This lets any instruction access program space as if it were data space, with a limitation that the access requires an additional cycle. Moreover, only the lower 16 bits of each instruction word can be accessed using this method. Linear indirect access of 32K word pages within program space is also possible using any working register, via table read and write instructions. Table read and write instructions can be used to access all 24 bits of an instruction word.
Page 20
Overhead-free circular buffers (modulo addressing) are supported in both X and Y address spaces. This is primarily intended to remove the loop overhead for DSP algorithms.
The X AGU also supports bit-reversed addressing on destination effective addresses, to greatly simplify input or output data reordering for radix-2 FFT algorithms. Refer to Section 4.0 for details on modulo and bit-reversed addressing. The core supports Inherent (no operand), Relative, Literal, Memory Direct, Register Direct, Register Indirect, Register Offset and Literal Offset Addressing modes. Instructions are associated with predefined Addressing modes, depending upon their functional requirements.
For most instructions, the core is capable of executing a data (or program data) memory read, a working register (data) read, a data memory write and a program (instruction) memory read per instruction cycle. As a result, 3-operand instructions are supported, allowing C = A+B operations to be executed in a single cycle.
A DSP engine has been included to significantly enhance the core arithmetic capability and throughput. It features a high speed 17-bit by 17-bit multiplier, a 40-bit ALU, two 40-bit saturating accumulators and a 40-bit bidirectional barrel shifter. Data in the accumulator or any working register can be shifted up to 15 bits right or 16 bits left in a single cycle. The DSP instructions operate seamlessly with all other instructions and have been designed for optimal real-time performance. The MAC class of instructions can concurrently fetch two data operands from memory, while multiplying two W registers. To enable this concurrent fetching of data operands, the data space has been split for these instructions and linear for all others. This has been achieved in a transparent and flexible manner, by dedicating certain working registers to each address space for the MAC class of instructions.
The core does not support a multi-stage instruction pipeline. However, a single stage instruction pre-fetch mechanism is used, which accesses and partially decodes instructions a cycle ahead of execution, in order to maximize available execution time. Most instructions execute in a single cycle, with certain exceptions.
AMC Engineering College | Dept. of EEE Page 21
The core features a vectored exception processing structure for traps and interrupts, with 62 independent vectors. The exceptions consist of up to 8 traps (of which 4 are reserved) and 54 interrupts. Each interrupt is prioritized based on a user assigned priority between 1 and 7 (1 being the lowest priority and 7 being the highest) in conjunction with a predetermined natural order. Traps have fixed priorities, ranging from 8 to 15.
Page 22
Page 23
Page 24
The DSP engine also has the capability to perform inherent accumulator-to-accumulator operations, which require no additional data. These instructions are ADD, SUB and NEG. The DSP engine has various options selected through various bits in the CPU Core Configuration Register (CORCON), as listed below: Fractional or integer DSP multiply (IF). Signed or unsigned DSP multiply (US). Conventional or convergent rounding (RND). Automatic saturation on/off for AccA (SATA). Automatic saturation on/off for AccB (SATB). Automatic saturation on/off for writes to data memory (SATDW). Accumulator Saturation mode selection (ACCSAT).
Page 25
Chapter 4
CHANGE NOTIFICATION
4.1 Introduction
The Change Notification (CN) [3] pins provide dsPIC30F devices the ability to generate interrupt requests to the processor in response to a change of state on selected input pins. Up to 24 input pins may be selected (enabled) for generating CN interrupts. The total number of available CN inputs is dependent on the selected dsPIC30F device.
There are four control registers associated with the CN module. The CNEN1 and CNEN2 registers contain the CNxIE control bits, where x denotes the number of the CN input pin. The CNxIE bit must be set for a CN input pin to interrupt the CPU.
The CNPU1 and CNPU2 registers contain the CNxPUE control bits. Each CN pin has a weak pull-up device connected to the pin, which can be enabled or disabled using the CNxPUE control bits. The weak pull-up devices act as a current source that is connected
AMC Engineering College | Dept. of EEE Page 26
to the pin and eliminate the need for external resistors when push button or keypad devices are connected.
1. Ensure that the CN pin is configured as a digital input by setting the associated bit in the TRISx register. 2. Enable interrupts for the selected CN pins by setting the appropriate bits in the CNEN1 and CNEN2 registers. 3. Turn on the weak pull-up devices (if desired) for the selected CN pins by setting the appropriate bits in the CNPU1 and CNPU2 registers. 4. Clear the CNIF (IFS0<15>) interrupt flag. 5. Select the desired interrupt priority for CN interrupts using the CNIP<2:0> control bits (IPC3<14:12>). 6. Enable CN interrupts using the CNIE (IEC0<15>) control bit.
When a CN interrupt occurs, the user should read the PORT register associated with the CN pin(s). This will clear the mismatch condition and setup the CN logic to detect the next pin change. The current PORT value can be compared to the PORT read value obtained at the last CN interrupt to determine the pin that changed.
Page 27
If the assigned priority level of the CN interrupt is equal to or less than the current CPU priority level, device execution will continue from the instruction immediately following the SLEEP or IDLE instruction.
If the assigned priority level of the CN interrupt is greater than the current CPU priority level, device execution will continue from the CN interrupt vector address.
Page 28
Chapter 5
The PWM module has the following features: Dedicated time base supports TCY/2 PWM edge resolution Two output pins for each PWM generator Complementary or independent operation for each output pin pair Hardware dead time generators for complementary mode Output pin polarity programmed by device configuration bits Multiple output modes: o Edge aligned mode o Center aligned mode o Center aligned mode with double updates o Single event mode Manual override register for PWM output pins Duty cycle updates are configurable to be immediate or synchronized to the PWM Hardware fault input pins with programmable function Special Event Trigger for synchronizing A/D conversions Each output pin associated with the PWM can be individually enabled
Page 29
PWM is provided by the dsPIC30F2010s dedicated Motor Control (MC) PWM. The MCPWM module has been designed specifically for motor control applications. (Please refer to Figure 3 as you follow this discussion of the MCPWM module.)
The MCPWM has a dedicated 16-bit PTMR time base register. This timer is incremented by a user defined clock tick, which can be as low as TCY. The user also decides the period required for the PWM by selecting a value and loading it in the PTPER registers. The PTMR is compared to the PTPER value at every TCY. When there is a match, a new period is started.
Page 30
The duty cycle is controlled similarly, by loading a value in the three duty cycle registers. Unlike the period compare, the value in the duty cycle register is compared at every TCY/2 interval (i.e., twice as fast as the period compare). If there is a match between the PTMR value and the PDCx value, then the corresponding duty cycle output is driven low or high as dictated by the PWM mode selected. The three outputs from the duty cycle compare are channelled to a complementary output pair where one output is high while the other is low, and vice versa. The two outputs can also be configured as independent outputs. When driven as complementary outputs, a dead time can be inserted between the time the high level goes low and the low level goes high. This dead time is hardware configured and has a minimum value of TCY. Dead time insertion prevents inadvertent shoot-thru in output drivers.
Page 31
There are several modes in which the MCPWM module can be configured. Edge aligned output is probably the most common mode. Figure 4 depicts the operation of an edge aligned PWM. At the start of the period, the outputs are all driven high. As the PTMR increments, a match with the duty cycle registers causes the corresponding duty cycle output to go low thereby marking the end of the duty cycle. The PTMR match with
AMC Engineering College | Dept. of EEE Page 32
PTPER register caused a new period to start and all outputs go high to start a whole new cycle.
The important feature of the MCPWM used in this application is the Override Control. The Override Control is the last stage of the MCPWM module. It allows the user to directly write to the OVDCON register and control the output pins. The OVDCON register has two 6 bit fields in it. Each of the six bit fields corresponds to an output pin. The high byte portion of the OVDCON register, determines if the corresponding output pin is driven by a PWM signal (when set to 1) or (when set to 0) driven Active/Inactive by the corresponding bit field in the low byte portion of the OVDCON register. This feature allows the user to have PWM signals available, but not driving, at all output stages of the pins. For BLDC motors, the same value is written to all PDCx registers.
Depending on the value in the OVDCON register, the user can select which pin gets the PWM signal and which pin is driven active or inactive. When controlling the BLDC sensored motor it is necessary to excite two winding pairs depending on where the rotor is located and dictated by the value of the hall sensors. In the CN Interrupt Service routine the hall sensors are read and then the value of the sensors is used as an offset in a lookup table which corresponds to the value which will be loaded in the OVDCON register. Table 1 and Figure 5 show how different values are loaded in the OVDCON register depending on which sector the rotor is located in and thereby which windings need to be excited.
Page 33
Chapter 6
The purpose of motor speed control is to control the speed, direction of rotation or position of the motor shaft. This requires that the voltage applied to the motor is modulated in some manner. This is where the power-switching element (bipolar transistor, MOSFET, IGBT) is used. By turning the power-switching elements on and off in a controlled manner, the voltage applied to the motor can be varied in order to vary the speed or position of the motor shaft.
Page 34
The three pairs of Motor Control PWM outputs are connected to three MOSFET driver pairs (BC547), which in turn are connected to six MOSFETs (IRF547 and IRF9540). These MOSFETs are connected in a three-phase bridge format to the three BLDC motor windings. In the current implementation, the maximum MOSFET voltage is 70Volts, and the maximum MOSFET current is 18 Amps.
Page 35
The base resistor RB and collector RC values are found using the formulae,
Page 36
The emitter resistor RE and collector RC values are found using the formulae,
Page 37
Page 38
Chapter 7
PI CONTROLLER
7.1 Introduction
Commutation ensures proper rotor rotation of the BLDC motor, while the motor speed depends only on the amplitude of the applied voltage. The amplitude of the applied voltage is adjusted by using the PWM technique. The required speed is controlled by a speed controller. The speed controller is implemented as a conventional PI controller. The difference between the actual and required speed is input to the PI controller and, based on this difference, the PI controller controls the duty cycle of PWM pulses, which corresponds to the voltage amplitude required to keep the required speed.
The speed controller calculates a Proportional-Integral (PI) [5] algorithm according to the following equations: ( ) [ ( ) ( ) ]
Transformation to a discrete time domain using an integral approximation by a Backward Euler method yields the following equations for the numerical PI controller calculation:
AMC Engineering College | Dept. of EEE Page 39
( )
( )
( ) ( )
( )
( Where, e(k) w(k) m(k) u(k) up(k) uI(k) uI(k-1) TI T Kc = = = = = = = = = = Input error in step k Desired value in step k Measured value in step k Controller output in step k
( )
Proportional output portion in step k Integral output portion in step k Integral output portion in step k-1 Integral time constant Sampling time Controller gain
Page 40
Page 41
Chapter 8
UART
8.1 Introduction
The Universal Asynchronous Receiver Transmitter (UART) [4] module is one of the serial I/O modules available in the dsPIC30F device family. The UART is a full-duplex asynchronous system that can communicate with peripheral devices, such as personal computers, RS-232 and RS-485 interfaces. The primary features of the UART module are: Full-duplex 8- or 9-bit data transmission through the UxTX and UxRX pins Even, Odd or No Parity options (for 8-bit data) One or two Stop bits Fully integrated Baud Rate Generator with 16-bit prescaler Baud rates ranging from 29 bps to 1.875 Mbps at FCY = 30 MHz 4-deep First-In-First-Out (FIFO) transmit data buffer 4-deep FIFO receive data buffer Parity, Framing and Buffer Overrun error detection Support for 9-bit mode with Address Detect (9th bit = 1) Transmit and Receive Interrupts Loopback mode for diagnostic support
Page 42
A simplified block diagram of the UART is shown in Figure 18. The UART module consists of the key important hardware elements: Baud Rate Generator Asynchronous Transmitter Asynchronous Receiver
Page 43
Transmission is enabled by setting the UTXEN enable bit (UxSTA<10>). The actual transmission will not occur until the UxTXREG register has been loaded with data and the Baud Rate Generator (UxBRG) has produced a shift clock (Figure 19-2). The transmission can also be started by first loading the UxTXREG register and then setting the UTXEN enable bit. Normally when transmission is first started, the UxTSR register is empty, so a transfer to the UxTXREG register will result in an immediate transfer to UxTSR. Clearing the UTXEN bit during a transmission will cause the transmission to be
AMC Engineering College | Dept. of EEE Page 44
aborted and will reset the transmitter. As a result, the UxTX pin will revert to a highimpedance state.
In order to select 9-bit transmission, the PDSEL<1:0> bits (UxMODE<2:1>) should be set to 11 and the ninth bit should be written to the UTX9 bit (UxTXREG<8>). A word write should be performed to UxTXREG so that all nine bits are written at the same time.
The FIFO is reset during any device Reset, but is not affected when the device enters a Power saving mode or wakes up from a Power saving mode.
The transmit interrupt flag (UxTXIF) is located in the corresponding interrupt flag status (IFS) register. The UTXISEL control bit (UxSTA<15>) determines when the UART will generate a transmit interrupt. 1. If UTXISEL = 0, an interrupt is generated when a word is transferred from the transmit buffer to the Transmit Shift register (UxTSR). This implies that the transmit buffer has at least one empty word. Since an interrupt is generated after the transfer of each individual word, this mode is useful if interrupts can be handled frequently (i.e., the ISR is completed before the transmission of the next word). 2. If UTXISEL = 1, an interrupt is generated when a word is transferred from the transmit buffer to the Transmit Shift register (UxTSR) and the transmit buffer is empty. Since an interrupt is generated only after all 4 words have been transmitted,
Page 45
this Block Transmit mode is useful if the users code cannot handle interrupts quickly enough (i.e., the ISR is completed before the transmission of the next word).
The UxTXIF bit will be set when the module is first enabled. The user should clear the UxTXIF bit in the ISR. Switching between the two Interrupt modes during operation is possible. While the UxTXIF flag bit indicates the status of the UxTXREG register, the TRMT bit (UxSTA<8>) shows the status of the UxTSR register. The TRMT status bit is a read only bit, which is set when the UxTSR register is empty. No interrupt logic is tied to this bit, so the user has to poll this bit in order to determine if the UxTSR register is empty.
Page 46
Chapter 9
The analog inputs are connected via multiplexers to four S/H amplifiers, designated CH0CH3. One, two, or four of the S/H amplifiers may be enabled for acquiring input data. The analog input multiplexers can be switched between two sets of analog inputs during conversions. Unipolar differential conversions are possible on all channels using certain input pins.
AMC Engineering College | Dept. of EEE Page 47
An Analog Input Scan mode may be enabled for the CH0 S/H amplifier. A Control register specifies which analog input channels will be included in the scanning sequence.
The 10-bit A/D is connected to a 16-word result buffer. Each 10-bit result is converted to one of four 16-bit output formats when it is read from the buffer.
Page 48
Page 49
The ADCON1, ADCON2 and ADCON3 registers control the operation of the A/D module. The ADCHS register selects the input pins to be connected to the S/H amplifiers. The ADPCFG register configures the analog input pins as analog inputs or as digital I/O. The ADCSSL register selects inputs to be sequentially scanned.
Page 50
Chapter 10
CONCLUSION
The dsPIC30F2010 is well suited for closed loop control of a sensored BLDC motor. The peripherals and DSP engine provide an excellent bandwidth for sensored BLDC applications with sufficient code space available for the customers application program.
Page 51
Chapter 11
Page 52
Page 53
Chapter 12
REFERENCES
[1] N. Hemati and M. C. Leu, A complete model characterization of brushless dc motors, IEEE Trans. Ind. Applicat., vol. 28, pp. 172180, Jan./Feb. 1992. [2] [3] dsPIC30F reference manual A. R. Millner, Multi-hundred horsepower permanent magnet brushless disc motors, in Proc. IEEE Appl. Power Electron. Conf. (APEC94), Feb. 1317, 1994, pp. 351355. [4] [5] dsPIC30F2010 datasheet Yasuhiko Dote. Servo Motor and Motion Control using Digital Signal Processors Prentice Hall, Eagle Wood, Cliffs, New Jersey, 1990.
Page 54