








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Class: ENGINEERING DESIGN PROJECT; Subject: Electrical & Computer Engineer; University: Oregon State University; Term: Spring 2007;
Typology: Study Guides, Projects, Research
1 / 14
This page cannot be seen from the preview
Don't miss anything!









Oregon State University ECE 44X – Group 24
Version 1.
May 11, 2007
Version Date Author Comments 1.0 5/11/2007 Perry Initial Document
This controller was designed to control three-phase AC induction motors. Control of such a motor includes everything needed to interface the user to the motor and its application. The intended application of this controller system is for use in an electric car. However, this controller could be ideal for any applications where both space constraints, and control of motors rated above 50 horsepower are required.
This document is intended for experienced users who will be using this motor controller to implement a complete motor control system.
Regenerative braking is accomplished through software; no additional hardware necessary. By using the momentum of the car to generate reverse current, regenerative braking allows the batteries to be charged while the car is running.
The on-board diagnostic LEDs provide users with vital feedback on system status. This feature allows for quick troubleshooting of the system. A full description of these LEDs is in Section 6.
With consideration for electric vehicles, the controller consists of small components and digital control, making it an ideal solution for compact spaces. The design is based on a small and inexpensive Microchip dsPIC6015 Microcontroller. The PWM signals could be synthesized using analog electronics with oscillators, comparators, and related components. AC propulsion uses a complicated system comprised exclusively of analog electronics due to the prevalence of analog when their system was designed. With
modern and advanced microcontrollers, the sine wave PWM signals can be synthesized directly on the chip for much lower cost and greater flexibility in output waveforms and drive techniques. A dsPIC30 was chosen for this task because it has sufficient processing power to implement nearly any drive technique, including simple Voltage/Frequency control to more advanced vector control techniques, and has six PWM outputs. The dsPIC30 was designed for motor control solutions and the manufacturer offers an application note complete with code and schematics for an induction motor vector control using the dsPIC30. The A PWM frequency of 10 kHz was chosen to minimize IGBT switching losses while providing sufficient PWM resolution at the projected maximum motor frequency of 400 Hz.
The motor control board is based on Microchips dsPIC6015 microcontroller. The dsPIC6015 is a 16-bit high performance digital signal RISC architecture controller which includes 8KB of RAM and 4KB of EEPROM. The main clock runs on a 10MHz crystal with active x8 phase locked loop. Our control scheme implements the controller complimentary PWM module, Quadrature encoder interface, SRAM, Data EEPROM, Watchdog timer, A/D converter, SPI, and 16-bit Timers. The rest of section 5 describes the interface of this microcontroller to the rest of the board and environment.
Figure 5.1: Motor Controller connector Diagram
Connector Pins Function Board Connector J23 8 SPI RJ- J22 4 Voltage sensor input Tyco/AMP 1445120 J15,J16,J17 4 Current Sensor inputs Tyco/AMP 1445120 J24 4 Quadrature encoder input Tyco/AMP 1445120 J2,J3,J11,J13,J19,J21 14 Gate driver outputs Tyco/AMP 5103309- J7 6 JTAG Programming 6-pin Telco J1 2 Input power 10-24 V 2 Pin header
5.2.1 Current Sensor Input Hall-effect sensors are ideal and recommended for the system. They are more advantageous than shunt type sensors because they alleviate the common mode voltage problems shunt current sensors can create. Hall sensors are also cheaper than high current shunts. Connectors J15, J16, and J17 are for phases A, B, and C respectively. The 4-pin connectors constitute VDD, VSS, and phase current signals.
5.2.2 Quadrature Encoder Input The motor speed sensor input is nearly a requirement in this application as there needs to be a relationship between the electrical frequency output from the controller and the motor mechanical frequency (rotational speed). The motor speed sensor is user supplied, and should be a quadrature input.
5.2.3 Gate Driver (PWM) Outputs These connectors output the PWM control from the microcontroller to the power switches. They also connect temperature sensor data to the motor controller for over- temperature functionality.
Connector Description J3 Phase A high, control and temperature signals J2 Phase A low, control and temperature signals J13 Phase B high, control and temperature signals J11 Phase B low, control and temperature signals J21 Phase C high, control and temperature signals J19 Phase C low, control and temperature signals
5.2.4 JTAG Programming Port For programming J5 and J6 must be set as described in section 5.3. The pin out of the 6- pin Telco connector (J23) is described below:
Pin# Signal Description 1 Reset Pin (low on reset) 2 VDD 3 GND 4 Program Data 5 Program Clock 6 NC
The motor controller is set to operate in slave mode with the user interface device. The J23 pin out for the motor controllers serial interface is described below:
Pin# Signal Description 1 User Interface GND 2 SPI MISO 3 SPI Clock (user interface as master) 4 SPI Slave Select (not implemented) 5 User Interface GND 6 14V+ supply (user interface) 7 SPI MOSI 8 14V+ supply (user interface)
SPI Fault (2) – This occurs when 10 SPI packet timeouts occur in a row, or 10 CRC mismatches occur in a row. This fault deactivates all PWM outputs.
Oscillator Fail Trap (2) – This indicates that the external crystal oscillator has failed to come up. The PWM outputs are overridden. This trap may occur on the first reset after reprogramming the controller.
Desaturation Fault (3) – The gate drivers have signaled that the power switches have come out of saturation. This fault overrides all PWM outputs.
Address Error Trap (3) – The controller will enter this trap if the software attempts to reference an illegal address. This fault overrides all PWM outputs.
Over-Current Fault (4) – The current drawn by the drivers has exceeded the hard limit. This fault overrides all PWM outputs.
Stack Pointer Trap (4) – This trap indicates that an illegal push or pop has occurred to the stack in software. This fault overrides all PWM outputs.
Over-Temperature Fault (5) – The temperature of the gate drivers has exceeded the hard limit. This fault overrides all PWM outputs.
Math Error Trap (5) – An illegal math operation has been attempted in the software. This fault overrides all PWM outputs.
Quadrature Encoder Fault (6) – The quadrature encoder has failed or been disconnected during operation. This fault overrides all PWM outputs. Watchdog Timer Fault – The watchdog timer has reset at least once since the last programming. PWM outputs are not overridden
Male header Signal J4 Phase A low side control J8 Phase A high side control J14 Phase B low side control J12 Phase B high side control J18 Phase C low side control J20 Phase C high side control J9 GND
These test pins will give you easy access to the PWM control outputs for all three phases, during testing and debugging.
The software was developed with assembly language using Microchip’s MPLAB IDE V7.5. Microchips IDC (in-circuit debugging) tool was used for programming and troubleshooting code. It is important to note that without revision the program is dependant on a motor with 128 encoder ticks per revolution and a quadrature encoder speed input. The temperature, current and voltage measurements are also calibrated for the motor control board tested in prototyping. The following describes key features of the motor control code and control scheme.
SPI faults are handled by a function in the main loop that checks for an SPI timeout, SPI overflow, and CRC error check. The controller receives target torque, target speed, brake signal, and reverse signal bytes from the user interface device via SPI. A function loads and send transmit packets containing motor controller calculations and sensor values to the user interface device.
Conversion of A/D channels is caused by the special event trigger of the PWM module. The trigger is set to occur mid PWM cycles to avoid switching noise on A/D inputs. Each time through the main loop the A/D buffer is checked, if full all four 10-bit buffer values are written to memory. The first three channels are dedicated to the phase current sensors, so new data is obtained for phase current at every conversion. The fourth channel cycles through the remaining inputs.
The A/D routine that writes A/D values to memory also calculates the soft current voltage scaling variable and performs the hard current limit. The Hard limit is based on individual phase currents and sum of phase currents, while proportional soft limit voltage scaling is based on sum of squares calculations.
The target torque value, from the user interface device derived from the pedal, is scaled to achieve a target slip value. It is then scaled by the current speed calculation to achieve the slip value.
Out speed calculation is based on the quadrature encoder module mode and the number of encoder ticks in the motor. Target speed is calculated and it correspond to a certain number of skips through a single-period sine table in the EEPROM during PWM modulation. Each phase is separated by the value of table entries corresponding to 180 degrees.
Quadrature encoder – A device with two output signals that have a 90 degree phase separation that allows determination of velocity and direction. SPI – Serial Peripheral interface: A serial communication interface commonly used with microcontrollers. Trap – A place in software where the program stops due to an illegal software or software operation. IGBT – Insulated Gate Bipolar Transistor uC – Microcontroller
Content Authors: Ben Perry, Chee Sing Lee, Jon Boro, and Kevin Kaatz were members of Electrical and Computer Engineering Senior Design Group 24 at Oregon State University 2006-07.
For questions or further information contact by email at: [email protected] ATTN: Jon Boro
*Schematic document disclosures may be available upon request.