* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Designing a Three Phase Inverter for a Permanent Magnet Synchronous Motor
Oscilloscope history wikipedia , lookup
Analog-to-digital converter wikipedia , lookup
Radio transmitter design wikipedia , lookup
Integrating ADC wikipedia , lookup
Nanofluidic circuitry wikipedia , lookup
Immunity-aware programming wikipedia , lookup
Spark-gap transmitter wikipedia , lookup
Josephson voltage standard wikipedia , lookup
Index of electronics articles wikipedia , lookup
Operational amplifier wikipedia , lookup
Schmitt trigger wikipedia , lookup
Valve RF amplifier wikipedia , lookup
Current source wikipedia , lookup
Voltage regulator wikipedia , lookup
Resistive opto-isolator wikipedia , lookup
Surge protector wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Current mirror wikipedia , lookup
Power electronics wikipedia , lookup
Opto-isolator wikipedia , lookup
Lars Dautermann Designing a Three Phase Inverter for a Permanent Magnet Synchronous Motor Helsinki Metropolia University of Applied Sciences Bachelor of Science Electronics Thesis June 19, 2013 Abstract Author Title Lars Dautermann Designing a Three Phase Inverter for a Permanent Magnet Synchronous Motor Number of Pages Date 51 pages + 7 appendices June 19, 2013 Degree Bachelor of Science Degree Programme European Electrical Engineering Specialisation option Power electronics Instructor Arja Ristola, Technology Manager The motivation for this thesis is to provide a three phase inverter for an electric car in the Formula Student. Designing a inverter is a challenge that requires combined knowledge in microcontroller programming, pcb layout, electric analysis and the principals of how to control a motor. The theory of electrical motors and especially permanent magnet synchronous motors is shortly introduced. The physical and electrical characteristics were studied to understand how the motor can be controlled with a three phase inverter. The schematics, the design of drivers and safety features for the switching elements in the inverter are shown. The software to control the inverter and to communicate with other devices in a car to obtain the information about the desired torque and power is explained. A model of a space vector control in Matlab is simulated. The advantages and disadvantages of different control methods like direct torque control and field oriented control are discussed. During the study of the thesis two inverter designs were designed. A low voltage, low power version to study the concept and a high voltage, high power version for the practical usage in the car. Due to the limitation of time only the low voltage inverter is built and demonstrated. Keywords inverter, permanent magnet synchronous motor, mosfet, igbt Contents Nomenclature 1 1 Introduction 1.1 Formula Student . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Metropolia Motorsport . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 3 2 Car System Overview 4 3 Theory 3.1 History of Synchronous Motors . . . . . . . . . . . . . . . . . . . . 3.2 Permanent Magnet Motor . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Physical Types of Permant Magnet Motors . . . . . . . . . . 3.2.2 Parameters of PMSM . . . . . . . . . . . . . . . . . . . . . 3.2.3 Dynamic Model of IPMSM - Flux Linkage . . . . . . . . . . 3.2.4 Dynamic Model of IPMSM - Stationary and Synchronous Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.5 Torque Control . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Square Wave Conversion . . . . . . . . . . . . . . . . . . . 3.3.2 Modified Sine Wave Conversion . . . . . . . . . . . . . . . 3.3.3 Pure Sine Wave Conversion . . . . . . . . . . . . . . . . . . 3.3.4 Space Vector PWM . . . . . . . . . . . . . . . . . . . . . . 3.4 Control loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Direct Torque Control . . . . . . . . . . . . . . . . . . . . . 3.4.2 Field Orientated Control . . . . . . . . . . . . . . . . . . . . 3.4.3 Clark-Park Transformation . . . . . . . . . . . . . . . . . . . 3.5 Switching Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 MOSFET . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2 IGBT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 6 7 10 11 12 14 15 15 16 17 18 20 20 20 23 24 24 24 4 Matlab Simulation 27 5 Schematic 5.1 Power Supply Module . . . . . . . . 5.2 Microcontroller Modules . . . . . . . 5.3 Optocoupler Module . . . . . . . . . 5.4 CAN Bus Module . . . . . . . . . . . 5.5 Inverter Module . . . . . . . . . . . . 5.6 Resolver to Digital Converter Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 28 29 30 30 31 31 6 Inverter Parts 6.1 Switching Devices . . . . . . . . . . . . . . . 6.1.1 MOSFET Driver . . . . . . . . . . . . 6.1.1.1 Bootstrap Driver Calculation 6.1.2 IGBT Driver . . . . . . . . . . . . . . . 6.2 Protection . . . . . . . . . . . . . . . . . . . . 6.2.1 Short Circuit Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 33 34 34 36 38 38 . . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 RCD Snubber . . . . . 6.3 Microcontroller . . . . . . . . 6.4 Sensors . . . . . . . . . . . . 6.4.1 Temperature Sensors 6.4.2 Current Sensors . . . 6.4.3 Voltage Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 40 40 40 40 41 7 Measurements 7.1 Voltage Divider Resistance . . . . . . . . . . . . . . . . . . . . . . 7.2 Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 42 44 8 Program 46 9 Summary and Conclusion 47 List of Figures 48 List of Tables 50 Bibliography 51 A Matlab Code A.1 Matlab code for square wave generation . . . . A.2 Matlab code for modified sine wave generation A.3 Matlab code for pure sine wave generation . . A.4 Matlab code for space vector PWM . . . . . . . 52 52 53 54 56 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Nomenclature λa Flux linkage phase a λb Flux linkage phase b λc Flux linkage phase c λsd , λα Flux linkage in stationary d-axis λsq , λβ Flux linkage in stationary q-axis µ0 Permeability of the vacuum ωr , ωe = P ω 2 r Magnetic flux of the permanent magnets ψm θr , θ = θe = Rotor speed P θ 2 r Rotor flux angle ea Back EMF phase a eb Back EMF phase b ec Back EMF phase c ia Stationary current phase a ib Stationary current phase b ic Stationary current phase c ied , id D-axis synchronous current isd , iα D-axis stationary current ieq , iq Q-axis synchronous current isq , iβ Q-axis stationary current kphase Back EMF constant Ld D-axis synchronous inductance Lq Q-axis synchronous inductance Lδ Reluctance inductance component Labcs Inductance corresponding to the uniform air gap Lrlc Reluctance matrix m Space vector sector number N Number of turns of the d-axis winding Pe Electric power 2 Te Torque Ts Switching period vde , vd D-axis synchronous voltage vds , vα D-axis stationary voltage vqe , vq Q-axis synchronous voltage vqs , vβ Q-axis stationary voltage Vdc Battery voltage BLDC Brushless direct current motor CAN Controller area network CEMF Counter electromotive eorce f Frequency FOC Field oriented control I2C Inter-integrated circuit MOSFET Metal oxide semiconductor field effect transistor P Number of motor poles PM Permanent magnet PMSM Permanent magnet synchronous motor PWM Pulse width modulation SPI Serial peripheral interface SVPWM Space vector pulse width modulation 3 1 Introduction The motivation for this thesis was to provide a three phase inverter for an electric car in the Formula Student. The Formula Student is an engineering competition where students design and build a car under the rules of the Formula Student. Points can be scored in different engineering and business events throughout the competition. Writing this thesis and creating a three phase inverter helps to understand the electric car in more detail and gain points in the design event. A self built and self designed inverter in the car can be better tailored for the desired purposes and also helps to assess electromagnetic interference problems better that might occur in the car’s communication network. This study is carried out for the Metropolia Motorsport team. 1.1 Formula Student The Formula Student is an engineering competition that took place the first time in the USA in 1981. The American competition is the Formula SAE (Society of Automotive Engineers ). In 2013 there are 11 official competitions internationally: three in the USA, one in Australia, Figure 1: Formula Student logos one Brazil, one in Italy, one in the United Kingdom, one in Germany, one in Austria, one in Hungary and one in Japan.[6, p. 6] [2] The Formula Student in these countries use the same basic set of rules for its competitions which are slightly changed depending on the event. Teams are created by students to represent their universities. To the right the logo of the overall formula student and the logo of the German competition can be seen. 1.2 Metropolia Motorsport The Metropolia Motosport team was formerly known as Helsinki Polytechnic Formula Engineering Team, which was founded in 2000. The first competition participation was in 2002 in Birmingham UK with the car HPF002. In Figure 2: Metropolia Motorsport 2008 the team changed its name to Metropo- logo lia Motorsport due to the name change of the university to Helsinki Metropolia University of Applied Sciences. Since then the team has constructed a car each year and participated in several competitions. 4 In 2013 the team constructed its first fully electric car. In cooperation with ABB they built their own permanent magnet synchronous motor, which is controlled by a inverter from ABB.[1] In figure 2 the logo of the Metropolia Motorsport team can be seen. 2 Car System Overview Controller Inverter 1 Motor 1 Inverter 2 Motor 2 DC Bank Dashboard Driver Information Pedals Torque Control Input Drive Train Figure 3: System Overview In figure 3 the top view of the electric car can be seen. The drive train is located in the rear of the car behind the driver’s seat. At the front of the car the pedals for acceleration and braking can be found. The car has a lot of electrical devices and sensors on board. To control all those devices a central control unit is used which runs a self developed software. This controller is also called main control unit (MCU). The separate electrical systems in the car communicate by using a CAN bus. The CAN bus was specifically created to guarantee stable communication in automotive environments. It uses a differential signal. This helps to prevent coupling of electromagnetic interferences. For the driver to be able to control the car, the input devices have to be transformed into electrical signals. The two front pedals positions are sensed using a high precision linear resistor. The steering wheel has an encoder implemented which reveals the momentary angle. These signals are evaluated by the main 5 controller. According to the software the acceleration and steering angle information is calculated into torque and speed demands for the rear wheels. Via the CAN bus this information is send to the inverters in the drive train. The inverters use the received information to each separately control one motor. Before the car can be set into ready to drive mode a series of safety procedures have to be executed by the driver. All systems are constantly monitored for failures by software implemented routines as well as hardware implemented safety features. 3 3.1 Theory History of Synchronous Motors Synchronous machines were first development during the middle of the 19th century as single phase generators to supply lighting systems. In the early development the salient pole rotor motor and the turbo generator formed as the typical design type. Being closely connected with the development of power plants the usage and size of synchronous motors grew with the size of the power plants. In an industrial manufacturing environment the synchronous motor was used where a constant speed or usage as a phase shifter was needed. With the development of frequency inverters the synchronous motor can now be used as a speed controlled motor and only recently found its way to new applications ranging from smallest sizes, like watches, phonographs and precision mechanics up to the biggest sizes and powers used in cement mills, conveyors and steel mills. [3, p. 289] The trend is to use high efficiency motors like Permanent Magnet Synchronous Motors (PMSM) in home applications such as refrigerators, air conditioners and washing machines. A nice side effect is that the efficiency of permanent electric motors can play an important role to reduce greenhouse gases and help reduce the air pollution caused by exhausts. The requirement of a clean environment and the reduction of a petroleum dependency has lead to a a paradigm shift. Slowly gasoline engines are replaced or at least assisted by electrical machines. In vehicle power trains more and more vehicles are using hybrid or fully electrical systems. Ongoing progress in CPU and power semi conductor performance has made it possible to easily implement complicated control techniques and algorithms using cost effective components. [4, p. xi] 6 3.2 Permanent Magnet Motor As seen in Figure 4 AC motors can be divided into asynchronous and synchronous motors. Like any AC motor asynchronous motors work on the principle of creating a rotating field. [3, p. 170]. Technically asynchronous motors resemble transformers. The stator being the primary and the rotor being the secondary side. Asynchronous motors are called asynchronous because the speed of the rotor is less than the speed of the rotating field. This behaviour is called slip. Synchronous motors use the stator’s and rotor’s magnetic field to lock with each other in respect to their position leading to a synchronous rotation of the rotor with the stator’s magnetic field. The speed of a synchronous motor is n = 120∗f . If a motor had 4 poles and was supplied with a 50Hz frequency the speed P would be 1500rpm. Reluctance motors use the effect of attraction experienced when holding a magnet to a magnetisable material like an iron nail. The rotor consisting of a magnetisable material is attracted to the magnetic field created by the stator’s coils. Permanent magnet motors use the effect of repulsion of equally magnetic polarized fields experienced when bringing two magnets together with the same pole. The rotor’s magnets are being pushed away by the magnetic field created in the stator coils. AC-Motors Asynchronous Squirrel Cage Induction Motor Synchronous Doubly Fed Induction Motor BLDC Motor Permanent Magnet Motor Reluctance Motor PMSM Surface PM Motor Switched Reluctance Synchronous Reluctance Interior PM Motor Figure 4: Taxonomy of AC motors Permanent magnet motors are classified into two categories based on the shape of their counter clectromotive force (CEMF). According to Faraday’s law RR ΦB =P B(r, t)dA, CEMF is created when a coil rotates in a magnetic field or the (t) 7 other way round a static coil experiences a rotating magnetic field. The change in magnetic flux then induces a voltage according to eb = Kb ωr , where Kb is the back EMF constant, and ωr is the rotor angular speed. [4, p. 2] Counter EMF PMSM e e e c e a e b e c Voltage[V] b Voltage[V] a Counter EMF BLDC Time [s] Time [s] (a) (b) Figure 5: (a) Continuous Counter EMF of a PMSM, (b) Trapezoidal Counter EMF of a BLDC Because the thesis concentrates on a inverter used for a PMSM this type of permanent magnet motor will be focused on. 3.2.1 Physical Types of Permant Magnet Motors In Figure 6 typical PMSM structures are shown. Motors where the PMs are attached to the surface of the rotor are called surface PMSM (SPMSM). Motors where the PMs are inserted into the rotor are called interior PMSM (IPMSM). The different arrangement of the permanent magnets leads to different reluctances and inductances. Because modern PMs have a permeability close to 1 they can be treated like air regarding the magnetic reluctance. PMs embedded in the rotor almost always lead to the q-axis synchronous inductance being larger than the d-axis synchronous inductance, Lq > Ld , with Ld = µ0 N 2 A 2(g + hm ) and Lq = µ0 N 2 A . 2g 8 Figure 6: Typical PMSM structures: (a) surface magnet, (b) inset magnet, (c) pole shoe rotor, (d) tangentially embedded magnets, (e) radially embedded magnets (flux-concentration), (f) two magnets per pole in the V position, (g) a synchronous reluctance motor equipped with permanent magnets.[8, p. 397] while PMs on the rotor surface lead to the q-axis synchronous inductance being equal to the d-axis synchronous inductance. Lq = Ld , with Ld = Lq = µ0 N 2 A . 2(g + hm ) With the arrangement in Figure 6(e) a flux concentration can be achieved, for example an effective flux density of 0,8T using magnets with 0,4T flux density. Though the use of PM mounted on the surface makes better use of the PMs flux, because the magnets in SPMSMs are mounted on the surface the speed range and power density is smaller compared to IPMSMs due to the centrifugal force that acts upon them and magnet flux leakage, which can even lead to demagnatisation of surface mounted PMs due to the heat created by the losses. [4, p. 140],[8] Figure 7 shows the physical structure of the stator and rotor of the motor from the Metropolia Motorsport team. It has 24 slots in the stator and 4 magnetic poles on the rotor. The magnets are tangentially embedded. This design was chosen to allow speed up to 6000 rpm and and efficient use of power of 8kW-22kW. 9 S lo t Stator North Rotor South South Slot Slot Rotor Slot North Figure 7: Structure of the Metropolia Motorsport’s motor: interior magnet 10 3.2.2 Parameters of PMSM Given the physical description of a PMSM the most important parameters to describe the motor mathematically are shown in table 1. Physical tion representa- Parameter representation Dimension Resistance of the motor’s stator winding RS Ω D-axis inductance of one motor phase. This is a transformed value derived by the Park transformation. Ld H Q-axis inductance of one motor phase. This is a transformed value derived by the Park transformation. Lq H Back EMF constant. Kp Vs rad Rotor Pole Pair. P 1 Table 1: PMSM parameter overview 11 3.2.3 Dynamic Model of IPMSM - Flux Linkage A simplified equivalent circuit of any AC machine can be seen in Figure 8. The inductance can be divided into stator and rotor inductance. The inductance can be described as [4, p. 149] Labcs = Labcs − Lrlc (θ), where cos 2θ cos(2θ − 2π/3) cos(2θ + 2π/3) Lrlc (θ) = Lδ cos(2θ − 2π/3) cos(2θ + 2π/3) cos 2θ , cos(2θ + 2π/3) cos 2θ cos(2θ − 2π/3) with N 2A γ2 . 2 Lδ describes the reluctance component. θ is the rotor angle. µ0 is the permeability of the vacuum. A is the air gap area through which the flux crosses. N is the number of turns of the d-axis winding. γ2 is a positive constant describing the air gap. Lrlc is called reluctance matrix and varies along with the rotor angle. Lδ ≡ µ0 L ia va ea vc ec ib vb L eb ib L Figure 8: Simplified equivalent circuit of a 3 Phase AC motor. 12 Labcs is the inductance corresponding to the uniform air gap described as Labcs Lms + Lls −1/2Lms −1/2Lms = −1/2Lms Lms + Lls −1/2Lms , −1/2Lms −1/2Lms Lms + Lls with Lms ≡ µ0 N 2A γ0 . 2 γ0 and γ2 are positive constants. The total flux linkage is λa ia cos θ λb = [Labcs − Lrlc (θ)] ib + ψm cos(θ − 2π/3 . λc ic cos(θ + 2π/3 Figure 9: Stationary equivalent circuit of a PMSM (one phase) 3.2.4 Dynamic Model of IPMSM - Stationary and Synchronous Frame The flux linkage in (3.2.3) is transformed into the stationary d,q frame as " # " #" # " # λsd Ls − 3/2Lδ cos 2θ −3/2Lδ sin 2θ isd cos θ = + ψm . λsq −3/2Lδ sin 2θ Ls + 3/2Lδ cos 2θ isq sin θ From this the stationary IPMSM dynamic model is obtained through d s λ dt dq An overview of the dynamic models of SPMSM and IPMSM can be seen in Table 2. s vdq = rs isdq + 13 SPMSM in the stationary frame d dt s id = isq rs Ls s id − isq ψm ωe Ls − sin θe + cos θe 1 Ls s vd vqs IPMSM in the stationary frame s s s vd id Ls − 32 Lδ cos 2θe − 32 Lδ sin 2θe d id = rs s + dt is vqs iq − 32 Lδ sin 2θe Ls + 32 Lδ cos 2θ e q − sin 2θe cos 2θe isd − sin θe −3ωe Lδ + ωe ψm cos 2θe sin 2θe isq cos θe SPMSM in the synchronous frame d dt e −rs e ω id id e L s − rs e = iq −ωe − Ls ieq ψωe Ls 0 + 1 1 Ls e vd vqe IPMSM in the synchronous frame d dt # e " −rs Lq e ω id id e Ld Ld − = Ld rs ieq ieq −ωe Lq − Ls ψωe Lq " 1 e# v 0 + L1d de v 1 Lq q Table 2: PMSM dynamic equations[4, p. 154] 3 Ld = Ls − Lδ 2 3 Lq = Ls + Lδ 2 3 Ls = Lms + Lls 2 14 3.2.5 Torque Control Torque in the rotating frame (synchronous) is calculated as: Te = 3P ψm ieq − (Lq − Ld )ied ieq . 4 ψm ieq is the electro-magnetic torque based on the Lorentz force, which is build by the quadrature current. −(Lq − Ld )ied ieq is the reluctance torque caused by the Ld − Lq asymmetry. Using a lossless model where vde = −ωe Lq ieq and vqe = ωe Ld ied + ωe ψm the total electric power is 3P ωr ψm ieq + (Ld − Lq )ied ieq . 4 From this the torque equation in the stationary frame can be derived as Pe = Te = 3P s s (λ i − λsqs isd ). 4 ds q where 3 λsd = Ls isd − Lδ (−isd cos 2θe + isq sin 2θe ) + ψm cos θe , 2 3 λsq = Ls isq − Lδ (isd sin 2θe − isq cos 2θe ) + ψm sin θe . 2 15 3.3 Inverter There are several methods to convert DC to AC. They differ mainly in their approximation to a perfect sinusoidal signal. As one would expect the best approximation yields the best transfer of power to a device that expects a sinusoidal signal. A better approximation comes with more complexity and cost. A compromise between functionality, cost and complexity has to be made. In this part the advantages and disadvantages of different conversion methods will be discussed and evaluated. 3.3.1 Square Wave Conversion The simplest form of DC to AC conversion is a square wave. As shown in figure 10 it uses the full DC voltage and switches between this maximum level at 50% duty cycle. This hard switching could be used for a BLDC as this type of motor expects a DC signal. For a PMSM it is not desirable because it expects a sinusoidal signal. The advantages of square wave conversion are its simplicity and low cost of components. The disadvantages are high amplitude harmonics (Figure 11) and unsmooth behaviour of devices that expect a sinusoidal signal, which leads to physical stress. SquareWave 1.5 Voltage[V] 1 0.5 0 −0.5 −1 0 0.2 0.4 0.6 0.8 1 Time [s] 1.2 1.4 1.6 1.8 2 Figure 10: Square wave conversion The Matlab code to create figure 10 and 11 can be seen in appendix A.1. 16 Amplitude Spectrum of SquareWave 1 |Voltage[V]| 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 Frequency [Hz] 7 8 9 10 Figure 11: Square wave amplitude spectrum 3.3.2 Modified Sine Wave Conversion In figure 12 a modified sine wave conversion can be seen. It is an improvement in comparison to the square wave conversion. Instead of just two levels and a 50 % duty cycle it uses three levels. The Modified Sinus Wave 1 Voltage[V] 0.5 0 −0.5 −1 0 0.2 0.4 0.6 0.8 1 Time [s] 1.2 1.4 1.6 1.8 2 Figure 12: Modified sine wave conversion The Matlab code to create figure 12 and 13 can be seen in appendix A.2. 17 Amplitude Spectrum of Modified Sine Wave 1 |Voltage[V]| 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 Frequency [Hz] 7 8 9 10 Figure 13: Modified sine wave amplitude spectrum 3.3.3 Pure Sine Wave Conversion In a pure sine wave conversion, the desired sinusoidal signal is compared against a sawtooth wave. Whenever the desired sinusoidal signal and the desired value intersects with the sawtooth sampling frequency a new pulse is started until the sawtooth signal reaches the maximum amplitude. A Matlab generated example can be seen in figure 14. Pure Sine Wave PWM switching 1 Vdc Vdc/2 |Voltage[V]| 0.5 0 −0.5 −1 0 0.1 0.2 0.3 0.4 0.5 Time [s] 0.6 0.7 0.8 0.9 1 Figure 14: Simulated PWM signal for a pure sine wave In figure 15 the amplitude spectrum of the pure sine wave PWM signal can be seen. It has components spread across a wide range of frequencies because of the changing duty cycles during the modulation. The Matlab code to create figure 14 and 15 can be seen in appendix A.3. 18 Amplitude Spectrum of sine wave 1 |Voltage[V]| 0.8 0.6 0.4 0.2 0 0 10 20 30 40 50 60 Frequency [Hz] 70 80 90 100 Figure 15: Simulated PWM signal for a pure sine wave amplitude spectrum 3.3.4 Space Vector PWM In space vector PWM the different switching states of the inverter are mapped into a hexagon. The state vectors are placed analog to the abc frame. By doing so the synchronous voltage vectors can be obtained by their amplitude and angle. When they fall into the designated sector a sequence of vector states is run to synthesize the desired output voltage. To reduce the computing that has to be done the values from the stationary abc frame are transformed into the dq synchronous frame. The voltages vde and vqe are calculated in the rotating frame as: e e vde = (P I)(ie∗ d − id ) − ωLq iq , (3.1) e e vqe = (P I)(ie∗ q − iq ) − ωLd id + ωψm . (3.2) These values are then transformed back into the stationary α,β frame as seen in figure 16. The maximum rms voltages in space vector PWM that can be achieved are higher than with sinusoidal PWM. This is because of the utilisation of the 3rd harmonic. √ The maximum rms voltage for sinusoidal PWM is 2·√32 · Vdc ≈ 0.612 · Vdc . The maximum rms voltage for space vector PWM is √12 · Vdc ≈ 0.707 · Vdc Because space vector PWM utilizes a higher voltage, more or equal power can be transferred using less current. In figure 17 it can be seen how the voltage vector is synthesized. The desired voltage vector is Va . The vector V1 and V2 represent the configuration of the upper switches of the inverter. To create vector Va the switch configuration V1 is switched on for a proportional time T1 of Va1 . Then V2 is switched on for a proportional time T2 of Va2 . The duration of each switch position is calculated from vα and vβ as: [4, p. 278] 19 β β b V3 (0, 1, 0) V2 (1, 1, 0) Sector 2 a Sector 3 α Sector 1 V0 (0, 0, 0) V4 (0, 1, 1) V7 (1, 1, 1) Sector 4 Sector 6 α V1 (1, 0, 0) Sector 5 V5 (0, 0, 1) c (a) V6 (1, 0, 1) (b) Figure 16: Stationary frame of the three phases abc with overlayed stationary α,β frame (a), Space dector diagram (b) √ 3 · Ts T1 = V √ dc 3 · Ts T2 = Vdc h i πm πm · sin( · vα − cos( · vβ 3 3 π(m − 1) π(m − 1) · − sin( · vα − cos( · vβ . 3 3 T0 = Ts − (T1 + T2 ); Ts is the the switching period. T0 is the zero vector switching time. m is the number of the sector. Vdc is the battery voltage. β V2 (1, 1, 0) Va2 Va Sector 1 Va1 α V1 (1, 0, 0) Figure 17: Space vector synthesizing 20 3.4 Control loop To control the speed and torque of a PMSM the frequency and voltage have to be controlled. Thus the devices to control such a motor are called variable frequency drive (VFD). Mainly two different control types are distinguished: scalar control and vector control. Scalar control uses the effect of changing the operating parameters such as voltage and frequency to drive the motor at different sets of characteristic curve families. It is called scalar control because it scales the operating parameters. [9, p. 671] Vector control dynamically controls the motor’s torque directly by observing the motor’s current and keeping the magnitude of the instantaneous magnetizing current space vector constant so that the rotor flux linkage remains constant.[9, p. 645] It is called vector control because it analysis voltage, current and magnetic flux based on their vector representation. Two types of vector control, direct torque control (DTC) and field oriented control (FOC), are discussed in more detail in the following section. 3.4.1 Direct Torque Control Direct torque control uses the measurement of voltage and current to calculate and estimate the magnetic flux and torque. It can be divided into direct self-control (DSC) and space vector modulation (SVM). 3.4.2 Field Orientated Control The overall control loop looks similar to figure 18. The torque is controlled by the quadrature current (iq ) of the rotor. The current component id does not need to be controlled. id is normally used to create the flux of the excitation circuit. In a PMSM this flux is constantly present because of the magnets. id can be used to induce field weakening. As seen in figure 18 the three phase current are measured with an ADC (analog to digital inverter) of a microcontroller. This information is then transformed from the stationary three phase stator frame into the rotating rotor frame. Further this information is subtracted from the desired current. A PI controller regulates how much the current has to be increased or decreased. This is then calculated into the corresponding voltage values. After an inverse park transformation from the rotating dq frame into the stationary αβ frame the appropriate switching sequence is executed. 21 Figure 18: Control loop overview In a more compact way it can be said that field oriented control is the technique used to achieve the decoupled control of torque and flux by transforming the stator current quantities (phase currents) from the stationary reference frame to torque and flux producing currents components in the rotating (synchronous) reference frame(Figure 19).[7] A comparison overview between DTC and FOC can be seen in table 3 [10]. 22 Comparison property DTC FOC Dynamic response to torque Coordinates reference frame Low speed (¡ 5% of nominal) behavior Very fast Fast alpha, beta (stator) d, q (rotor) Requires speed sensor for continuous braking Controlled variables torque & stator flux Good with position or speed sensor rotor flux, torque current iq & rotor flux current id vector components Steady-state torque/current/flux ripple & distortion Parameter sensitivity, sensorless Low (requires high quality current sensors) Low Stator resistance Parameter closed-loop d, q inductances, flux (near zero speed only) d, q inductances, rotor resistance d, q inductances, rotor resistance Required (either sensor or estimation) sensitivity, Rotor position measurement Not required Current control Not required Required PWM modulator Not required Required Coordinate transformations Switching frequency Not required Required Varies widely around average frequency Lower (requires high quality current sensors) spread spectrum sizzling noise Constant Switching losses Audible noise Control tuning loops speed (PID control) Low constant frequency whistling noise speed (PID control), rotor flux control (PI), id and iq current controls (PI) Complexity/processing Lower Higher requirements Typical control cycle 10-30 microseconds 100-500 microseconds time Table 3: Comparison between DTC and FOC 23 3.4.3 Clark-Park Transformation Magnet Synchronous Motor ThePermanent Clark-Park transformation combines two steps. The Clark transformation and the Park transformation. With the Clark transformation the stationary 3 phase Transformations Iq and Id are referenced the rotating reference frame. Hence ithe measured currents ia , iInb FOC, andtheiccomponents are transformed into thetostationary components iβ . In α and stator currents have to be transformed from the three phase time variant stator reference frame to the figure 19 thistwofirst step dq is rotor visualized. axis rotating reference frame. This can be done in two steps as shown in Figure 1-5. ia iD Z Z id F Z F q-axis F ib ic Clarke Transformation iq iE d-axis Park Transformation Figure 1-5 • Forward Transformations Figure 19: Clarke and Park transformation [7, p. 9] The transformation from the 3-phase 120 degree reference frame to two axis orthogonal reference frame is known as Clarke transform. Similarly the transformation from two axis orthogonal reference frame to the two axis rotating reference frame is known as Park transform. The Clark transformation is mathematically described as: Clarke Transformation " # " # ia The measured motor currents are first translated reference frame to the two axis 1 from the iα The transform − 12 by3-phase 2 1 − following orthogonal reference frame. is the equations. 2 √expressed √ = i b 3 0 23 − 23 Iα = Ia iβ ic Iβ = (Ia + 2Ib)/√3 Where Ia+Ib+Ic = 0 In the next step the park transformation is applied. Here the stationary comParkiβTransformation ponents iα and are transformed into the rotating (synchronous) components id The two axis orthogonal stationary reference frame quantities are then transformed to rotating reference and id . In figure 19 this second step is visualized. frame quantities. The transform is expressed by the following equations: Id = Iα cosθ + Iβ sinθis mathematically described as: The Park transformation Iq = Iβ cosθ – Iα sinθ " # r " #" # i cos θ sin θ iα 2 d Inverse Park Transformation = 3 provide − sin coscomponents θ iβ in the rotating reference frame. Now the outputs of theiqPI controllers theθvoltage These Thus an inverse of the previous process has to be applied to get the reference voltage waveforms in stationary reference frame. At first, the quantities in rotating reference frame are transformed to two axis orthogonal reference frameinto usingone Inverse Park transformation. Park two stepsstationary can be formed step known as The dq0Inverse transformation: transformation is expressed by the following equations: Vα = Vd cosθ - Vq sinθ # ia cos θ − 2π sin θ + 2π 3 3 ib 2π 2π 3 − sin θ − sin θ − 3 − sin θ + 3 ic " =# r+ Vd"sinθ Vβ Vq cosθ id 2 cos θ iq = To regain the stationary three phase components reverse transformations can be applied. In FOC it is necessary to inverse transform the stationary voltage components vd and vq into the stationary vα and vβ . 10 R ev is icomponents on 0 " # " #" # vα cos θ − sin θ vd = vβ sinθ cosθ vq given in terms of the device data sheet parameters Ciss , Coss , and Crss as follows: Cgd ¼ Crss Cgs ¼ Ciss ÿ Crss power supplies and brushless dc motor driv large conduction losses, its power rating is kilowatts. Because of its many advantages o 24have received hig modern MOSFET devices tance. Cds ¼ Coss ÿ Crss 3.5 Switching where Devices Crss is the small-signal reverse transfer capacitance; Ciss 6.6 MOSFET Regions of Oper is the small-signal input capacitance with the drain and source terminals shorted; and Coss is the small-signal output capaci- Most MOSFET devices used in power electro 3.5.1 MOSFET tance with the gate and source terminals shorted. are of the n-channel, enhancement type, lik The MOSFET capacitances Cgs , Cgd and Cds are nonlinear Fig. 6.6a. For the MOSFET to carry drain c and a function of the dc bias voltage. The variations in transistor. Coss between the Mosfet stands for metal-oxide-semiconductor field-effect The drainmosfet and the source must be cre and Ciss are signi®cant as the drain-to-source voltage and the when the gate-to-source voltage exceeds the nowadays has replaced the bipolar transistor low power switching gate-to-source voltage each cross zero.inThe objective of the voltage Vapplications Th . For vGS > VTh, the device can drive circuit is to charge and discharge the gate-to-source and triode region, which is also called ‘‘constant r almost completely. Being a voltage is off more and faster. gate-to-drain parasitic controlled capacitances todevice turn on it and the efficient or in the saturation region, depending on the device, respectively. given v , with small v (v < v ÿ V ) GS Cgd Cds Cgs (a) G S S SiO2 n+ Cds p n+ Cgs Cg d DS DS GS Th ates in the triode region (saturation region in larger vDS ðvDS > vGS ÿ VTh ), the device ent region (active region in the BJT). For vGS < turns off, with drain current almost equal to regions of operation, the gate current is alm why the MOSFET is known as a voltage-d therefore, requires simple gate control circui The characteristic curves in Fig. 6.6b sho three distinct regions of operation labeled saturation region, and cut-off region. When ing device, only triode and cut-off regions a when it is used as an ampli®er, the MOSFET the saturation region, which corresponds to in the BJT. The device operates in the cut-off region vGS < vTh , resulting in no induced channel. In the MOSFET in either the triode or satu channel must ®rst be induced. This can be applying gate-to-source voltage that exceeds n- vGS > VTh n+ Once the channel is induced, the MOSFET either the triode region (when the channel is no pinch-off, resulting in drain current pro D channel resistance) or the saturation regi (b) pinches off, resulting in constant ID ). The g FIGURE 6.9 (a) Equivalent MOSFET representation including junc- voltage (vGD ) determines whether the induc tion capacitances; and (b) representation of this physical location. or not.capaciThis is subject to the follo Equivalent MOSFET representation includingpinch-off junction Figure 20: (a) tances; and (b) representation of this physical location.[9, p. 83] In figure 20 you can see the physical structure of a mosfet with the location of the capacitances (b) and an equivalent representation (a). The behaviour of the capacitance charging and discharging is almost exactly the same as with an igbt. In the following section this is explained in more detail. To understand the similar behaviour in can be assumed that the drain of a mosfet is the collector of an igbt and the source of a mosfet is the emitter of an igbt. 3.5.2 IGBT Igbt stands for insulated-gate bipolar transistor. The igbt combines the advantages of a mosfet and a bipolar transistor. The gate of an igbt, like a mosfet, is voltage driven and needs little to ideally zero gate current. Like a bipolar transistor it is capable of conducting high currents. In figure 21 the physical structure, the equivalent circuit and the capacitance model are shown. driver outputbetween performance forprevents switching mited interaction biased, which any current ¯ow andrequirements the device is in its for an IGBT driver circuit, the ctronic circuit designers. rmation given in this note is the gate charge. This gate cha reverseapplication blocking state. If the gate terminalparameter is kept at ground ce reliability are observed potential but a positive potential is applied to the collector, the ly and does not constitute complete characterised by the equivalent input 25 capacitance ÿ tual circuits. This signi®- pn-junction between the p-base and n -drift region is reverseepower information is not exhaustive. The and CGEis. in its electronic system biased. This prevents any current ¯ow and the device proper remains with the user. ment timedesign can be signi®e performance and reliaIGBT Capacitances the design stage. As high n circuit applications, it is ent to model the IGBT s. However, development nent of every power electronic system is ower modules themselves – the IGBT ms the vital interface between the power e controller. For this reason, the choice the calculation of the right driver output y linked with the degree of reliability of a n. Insufficient driver power or the wrong (a) r may result in module and driver(a) ation of MOSFET and BJT. (b) (b) FIGURE 7.2 The IGBT (a) half-cell vertical cross section and (b) equivalent 21: circuit The model.IGBT (a) half-cell vertical cross Figure section and equivalent circuit model[9, p. 102], (b) IGBT capacitances The following table explains the designation capacitances. In IGBT data sheets these capaci arecircuit specified voltage-dependent low Curve Take a look at the igbt equivalent in figure 21 as (a). The igbt works as if capacitances of IGBTs in the “off” state. a bipolar npn transistor’s gate was driven by a mosfet’s gate. This npn transistor capacitances are independent of temperature haviour (turn-on andbecomes turn-off)conductive of an IGBT and drives the gate of the high power pnp transistor. dependent on the collector-emitter voltage, as sh ermined by its structural, internal To switch an igbt efficiently the gate needs to be driven into saturation is substa the mosfet following curve. This dependency arges) and the internal and outer as quickly as possible. Thereforehigher the capacitances seen in figure 21 (b) voltage. have at a very low collector-emitter N to be charged. In figure 22 (a) the sequence of charging the capacitances is shown. At first the gate-emitter capacitor is charged. When the gate-emitter voltage VGE(th) is reached, the igbt begins to conduct. When VGE(pl) is reached the gate-collector capacitance is charged in parallel. After crossing the Miller plateau the gate-emitter capacitance becomes fully charged an VGE(on) is reached. The 2007-10-31 – Rev00 gate charge of an igbt plays an important role in selecting and calculating a driver. The information about the gate charge can be found in the datasheet of the igbt manufacturer. In 22 (b) an example gate charge curve can be seen. Depending on the voltage applied to the collector and emitter and the ambient temperature, the capacitance varies. capacitance, IGBT saturation.charging of the gate-collector capacitance and charging of the gate-emitter capacitance until full saturation. To IGBT calculate the switching behaviour and the driver, the input capacitances may only be applied to a certain To calculate the switching behaviour and the driver, the input capacitances may only be applied to a certain The charge increases in to linea with the extent. current At rating the gate DC-Link voltage, albeit lesser higher of IGBT modules. The charge is also dependent operation voltages thegate gate charge increases due on to the the DC-Link voltage,ofalbeit a lesser extent. At higher larger influence the toMiller capacitance. In most 26 operation voltages the gate charge increases due to the applications this effect is negligible. larger influence of the Miller capacitance. In most applications this effect is negligible. Simplified Gate Charge Waveforms Gate Charge Characteristic Simplified Gate Charge Waveforms Gate Charge Characteristic VGE(on) VGE(on) GE(off) VV GE(off) QGE QGE (a) QGCQGC QGEQGE (b) t0 switching interval:The Thegate gatecurrent currentIGIG charges charges the the input input capacitance voltage VGEVrises to to t0 switching interval: capacitance CCGEGEand andthe thegate-emitter gate-emitter voltage GE rises . Depending onthe the gate gate resistor, resistor, several may in in this state. As As VGEVis still VGE(th) Figure 22: (a) VSimplified gate charge waveforms, (b) Gate charge characteristic . Depending on several amperes amperes maybeberunning running this state. GE(th) GE is still below VGE(th) , nocollector collectorcurrent current flows flows during maintained at V below VGE(th) , no during this thisperiod periodand andVCE VCEis is maintained atCCVlevel. CC level. [5, p. 2] 2/8 2/8 2007-10-31 – Rev00 2007-10-31 – Rev00 © by SEMIKRON © by SEMIKRON 27 4 Matlab Simulation Continuous Ideal Switch powergui current ia current ib g current ic C C g C g Constant4 + - v 0 IGBT/S3/Sb E Vdc Scope5 Scope IGBT/S5/Sc E IGBT/S1/Sa E Voltage Measurement + i - Voltage Measurement1 + - v Current Measurement A + i - B ??? m Current Measurement1 E g Permanent Magnet Synchronous Machine C C g IGBT/S6/Sb' IGBT/S2/Sc' E IGBT/S4/Sa' Voltage Measurement2 E + - v C g C Scope2 current ib Scope1 Scope4 id_e_synchronous iq_e_synchronous desired id_e ramptime vd_e_synchronous Scope3 Constant2 vq_e_synchronous Product Rotor speed (rpm) Gain3 Lq 60/(2*pi) i_Sdref PI desired iq_e Constant abc to dq transformation ramptime Discrete PI Controller S2 vq_e ramptime Ts Repeating Sequence Constant6 S3 ramptime theta_e S4 S5 fcn S1 id iq S3 S3 fcn <Rotor angle thetam (rad)> ic theta_e S4 S4 S5 ib S2 S2 S6 Ts S5 S6 S6 Gain1 sector Vdc t1 P/2 <Rotor angle thetam (rad)> Space Vector Generator and Gate Drive Vdc Constant5 i_Sqref ia S1 S1 vd_e Product1 Constant3 PI Ld Gain9 Gain2 Constant1 Discrete PI Controller1 P/2 <Rotor speed wm (rad/s)> psim Figure 23: Matlab simulation of space vector pwm As seen in figure 23 a Matlab simulation has been created to simulate the dynamic behaviour of a PMSM. Until now the results from the situation are not as expected. The simulation needs to be studied in more detail to see where the problem is. The code for the space vector PWM and Clark-Park transformation can be found in appendix A.4. 6 5 5 D 4 28 3 Schematic 5.1 Power Supply Module Voltage Supplies +12V D-SUB Connector Power HEATSINK F1 D17 1 +12V J1-2 +12V J1-3 J2-1 C 1 J1-5 J2-3 IN OUT 3 GND C1 330nF 2 J1-6 J2-4 +5V U1 J1-4 J2-2 2 HEAT1 J1-1 LM7805 C2 100nF J1-7 J2-5 J2-6 +12V_ISOLATED +12V J1-8 J1-9 AEE03A18-L J2-7 2 J2-8 C34 100µF + 1 +IN +OUT -IN -OUT 3 C35 10µF 4 + DCDC1 J2-9 GND_ISOLATED J2-10 J2-11 B +12V_ISOLATED J2-12 +5V_ISOLATED U6 J2-13 1 J2-14 C13 330nF J2-15 IN OUT 3 GND 2 LM7805 C14 100nF J2-16 J2-17 +5V_ISOLATED J2-18 J2-19 Figure 24: Power supply schematic J2-20 A In figure 24 the schematic of the power supply can be seen. The 12VDRAWN: power <Drawn By> from the car’s system is converted to 5V by a linear voltage regulator to supply CHECKED: the low voltage parts. To supply the galvanically isolated parts on the high voltage <Checked By> QUALITY CONTROL: side a DC to DC inverter is used. Because some parts on the high voltage side <QC By> require 5V as well another linear voltage regulator is used to supply 5V. RELEASED: <Released By> D < D < D < D < GTC-16026 3 PE6/INT.6/AIN.0 10nF 11 PE0/WR C5 GND C6 AREF SCL SCL2 2 1 SDA TEMP_OS2 1k2R R54 NC NC GND GND2 GND GND2 GND GND2 13 12 11 39 40 C25 C21 C24 C22 PF4/TCK_TEENSY C20 2 1 D49 1k2R R102 R2D_A0 10nF 120R R101 C52 2 1 10nF 2 C53 10nF D52 1k2R R108 1 R2D_LOT D PF6/TDO_TEENSY PF7/TDI_TEENSY R2D_RESET D171 2 D53 1k2R R110 1 PF5/TMS_TEENSY R2D_A1 C51 1R104 C17 C50 C16 C15 +5V RST 43 42 41 2 1k2R SPI_MISO_C2000 PF3_TEENSY R2D_WR/FSYNC 120R R109 R2D_SAMPLE 120R R107 C SPI_CLK_C2000 1 1 93 2 92 NC R58 120R PE0_TEENSY NC PE1_TEENSY NC OVER_CURRENT_FAULT_RESET NC NC NC NC NC SDA_ISOLATED NC SCL_ISOLATED NC TEMP_OS_ISOLATED NC NC NC NC NC NC NC NC TEMP_OS_ISOLATED NC NC EPWM2A EPWM3A EPWM1A NC +5V CURRENT_SENS3_OUT NC NC NC NC GND NC CURRENT_SENS1_OUT NC +5V NC INVERTERMODULEMOSFET 2 1 J1-3 J1-4 J1-5 J1-6 R119 1k2R 2 R120 1k2R C59 J1-7 J1-8 10nF C60 J1-9 10nF J1-10 R2D_WR/FSYNC EPWM3B EPWM2B EPWM3A R2D_SAMPLE EPWM2A EPWM1A ADCINA6 GPIO28/SCIRXDA/SDAA/TZ2 GPIO29/SCITXDA/SCLA/TZ3 GPIO34/COMP2OUT/RSVD/RSVD ADCINA4 ADCINA2 ADCINB2 +3.3V 86 +5V 85 84 83 120R R115 10nF 10nF 10nF C35 J6-10 2 NC J6-9 2 NC RESET GPIO16^32/SPISIMOA^SDAA/RSVD^EPWMSYNCI GPIO17^33/SPISOMIA^SCLA/RSVD^EPWMSYNCO GPIO6/EPWM4A/EPWMSYNCI/EPWMSYNCO GPIO7/EPWM4B/SCIRXDA/RSVD J3-1 GND J3-2 GND J3-3 +3.3V 87 GPIO12/TZ1/SCITXDA/RSVD ADCINB4 89 88 R70 1k2R C34 1 1 R72 1k2R 2 GPIO18/SPICLK/SCITXDA GND GPIO19/SPISTEA/SCIRXDA/ECAP1 ADCINB6 80 1k2R R53 79 2 SDA J2-3 C44 2 SCL J2-4 C45 10nF J2-5 J2-7 2 J2-9 C56 J2-10 10nF C57 1 2 120R R93 2 R58 120R R118 1k2R R60 1k2R 2 1 1 120RR89 120R R97 2 10nF 2 1 R2D_A1 R55 120R 1 SPI_MOSI_C2000 R119 1k2R C59 SPI_MISO_C2000 2 R2D_LOT R120 1k2R 10nF 1 R2D_RESET C60 120RR95 10nF 10nF C2000LAUNCHPAD 2 120R R125 2 2 120R R124 1 CURRENT_SENS1_OUT 1 CURRENT_SENS2_OUT 1 CURRENT_SENS3_OUT 120R R123 77 A 76 Figure 26: C2000 launchpad schematic 74 COMPANY: <Company Name> 73 72 SDA_ISOLATED 71 SCL_ISOLATED 70 TEMP_OS_ISOLATED TITLE: DRAWN: QUALITY CONTROL: 65 64 63 62 61 <Checked Date> CODE: SIZE: DRAWING NO: REV: EPWM3A 67 66 <Drawn Date> DATED: <Checked By> 68 <Title> DATED: <Drawn By> CHECKED: 69 <QC By> CURRENT_SENS3_OUT 10 1 78 75 2 R56 1k2R 2 1 1 120R R91 2 2 1 2 2 R57 120R 1 R2D_A0 1 R59 120R 1 1 D28 D30 1 120R R87 2 2 1 C46 SPI_CLK_C2000 1k2R R98 2 1 1k2R R116 C4710nF 2 1 J2-8 2 1 FET1 TEMP_OS 1k2R R96 10nF J2-6 1k2R R92 1 1k2R R94 +3 2 1 1k2R R121 2 1 81 J2-2 10nF 1k2R R122 2 1 82 J2-1 R85 47k +3.3V 1 J1-2 47k R86 10nF R56 1k2R C30 1 C29 R55 120R 2 1 91 90 10nF D57 R60 1k2R 2 2 1 2 NC R57 120R PC0_TEENSY EPWM1B C36 J1-1 D28 D30 1 C2000 Launch D29 NC 942 D58 95 J2-10 FET2 96 R59 120R B PF7/TDI_TEENSY J2-9 1 1 TEMP_OS PC1_TEENSY NC NC FET1 +3.3V J2-8 B1 D46 SCL JTAG_NSRST J2-7 D44 PC2_TEENSY NC PF5/TMS_TEENSY J2-6 D45 SDA J2-5 D43 PC3_TEENSY 97 J2-4 D42 PC4_TEENSY C2000 Launchpad 98 +5V PF6/TDO_TEENSY J2-3 NC NC 99 PF4/TCK_TEENSY J5-10 J2-10 100 NC J2-9 PC5_TEENSY JTAG Connector J2-2 ADCINB7 PC6_TEENSY NC 101 J5-9 NC +3.3V PF7/TDI_TEENSY J1-8 10nF J2-8 102 J6-8 PC7_TEENSY NC SCL_ISOLATED 60 PF2_TEENSY 1 R40 1k2R 10nF J2-1 GPIO17^33/SPISOMIA^SCLA/RSVD^EPWMSYNCO NC J2-7 103 ADCINB3 J2-6 NC D34 104 10nF C37 GND JTAG_NSRST D38 C39 NC PF5/TMS_TEENSY D39 D35 105 10nFC38 NC J2-4 106 J6-7 J2-3 J2-5 NC NC +5V PF6/TDO_TEENSY J6-6 NC D47 D36 J6-5 +5V NC J2-2 NC 59 PF1_TEENSY D23 120R R37 J1-9 D56 D37 107 PF4/TCK_TEENSY NC 58 1 CANMODULE 108 GPIO4/EPWM3A/RSVD/RSVD OVERCURRENT3_FAULT 109 GPIO5/EPWM3B/RSVD/ECAP1 OVERCURRENT2_FAULT NC J2-1 110 GPIO3/EPWM2B/RSVD/COMP2OUT +12V_ISOLATED JTAG Connector OVERCURRENT1_FAULT SDA_ISOLATED 57 120RR45 CANH GPIO16^32/SPISIMOA^SDAA/RSVD^EPWMSYNCI NC 111 ADCINB1 8 9 CURRENT_SENS2_OUT 10 NC 56 2 1 PF0_TEENSY 2 1 J1-7 CANL ADCINA0 +5V_ISOLATED 112 1 2 3 4 5 6 7 8 9 10 GND CANL GND NC NC NC CANH NC NC GND ADCINA1 NC J1-9 6 7 CURRENT_SENS1_OUT CANH 113 VCC SPI_CS_TEENSY SPI_MISO_TEENSY SPI_MOSI_TEENSY SPI_CLK_TEENSY SPI_INT_TEENSY NC GND GND GND 10nF CANL EPWM3B 5 NC J1-8 NC 55 10nF 1k2R R38 1 R46 1k2R J1-6 120RR77 1 R79 2 120R 1 120RR71 1 R73 2 120R 1 R75 2 120R 1 R69 2 120R 1 2 120R 1 R117 2 2 1 J1-7 EPWM1B 3 4 NC 20 19 18 17 16 15 14 13 12 11 SPI_SS_TEENSY SPI_MISO_TEENSY SPI_MOSI_TEENSY SPI_CLK_TEENSY INT.7_TEENSY J6-1 CANH NC 54 2 2 J1-6 EPWM2A 114 CANH 2 NC J6-4 J1-5 EPWM2B CANMODULE1 115 J6-3 NC 116 J6-2 NC J1-4 +5V NC 53 120R R43 D22 2 D18 2 1 1 21 J1-5 117 GPIO2/EPWM2A/RSVD/RSVD NC J1-3 EPWM3A NC 52 1k2RR44 120RR35 22 J1-4 GPIO0/EPWM1A/RSVD/RSVD NC NC 51 2 1 JTAG_NSRST D59 38 1k2R R36 D60 37 37 D27 36 36 10nF 1 118 J5-8 35 2 J1-2 J5-7 34 10nF 35 2 119 J5-6 33 GND C13 J1-2 J5-5 32 DATE: 1k2R R54 C27 31 APPROVED: OVERCURRENT1_FAULT 10nF 30 ECO NO: 10nF 29 R84 1 NC CANL 10nF C28 28 SPI_SS_TEENSY LTR 1 GND_ISOLATED J1-1 NC GPIO1/EPWM1B/RSVD/COMP1OUT 27 2 34 C19 C10 C11 C23 CAN Connector NC ADCINA3 26 D26 120 ADCINA7 25 10nF J1-3 2 24 1 REVISION RECORD INT.7_TEENSY J1-1 GND 23 2 CANL +5V 22 120R R65 2 NC J5-4 21 2 1 1 D31 TEENSY++2.0 NC J5-3 20 1k2R R66 120RR51 32 29 R2D_SAMPLE GND J5-2 19 10nF 30 R2D_WR/FSYNC SPI_CLK_C2000 C61 18 2 2 CAN Connector C42 17 1k2R R52 2 1 SPI_CLK_TEENSY 1 D25 120R R39 2 2 1 1 10nF D19 120R R29 1k2R R30 22 1 1 38 2 2 1 10nF D20 34 PF5/ADC5/TMS 10nF D48 R2D_A0 1k2R 120RR991k2R R32 R100 2120R R311 2 1 33 39 10nF 2 2 R2D_A1 1 1 D15 10nF D51 PF6/ADC6/TDO 1k2R 120R R105 32 R106 2 2 R2D_LOT 1 1 1k2R R34 120RR33 10nF 31 40 2 2 1 1 10nF 1k2R D50 D16 120R R2D_RESET R103 PF7/ADC7/TDI PF4/ADC4/TCK C43 16 10nF SPI_MOSI_TEENSY 2 1 In figure 25 and 26 the schematic of the Teensy2++ and the C2000 launchpad can be seen. The I/Os of the microcontrollers are protected by a zener diode against voltage transients. Also a resistor directly at the input protects the interior diodes of the microcontroller against too high currents. 10nF 15 2 C55 J5-1 14 C54 NC 1 CANMODULE 20 1 D17 GND GND 10 2 CANL EPWM1A GND 11 NC NC 12NC CANH 13NC NC GND PF7/TDI_TEENSY C30 9 CANMODULE1 1 C29 8 PF3/ADC3 D24 120RR130 D69 30 31 2 120RR49 1 Figure 25: Teensy2++ schematic PF6/TDO_TEENSY 120RR33 D57 7 2 1 2 6 1k2R R34 R85 47k 5 1k2R R131 1 1k2R R50 RESOLVER2DIGITALMODULE 1 4 40 PF2/ADC2 39 SPI_MOSI_C2000 19 JTAG_NSRST TEMP_OS_ISOLATED 14 29 10nF GND SPI_MISO_C2000 18 R83 SCL_ISOLATED 15 17 PF5/TMS_TEENSY D29 3 PF4/TCK_TEENSY SDA_ISOLATED 16 2 SPI_MISO_TEENSY 120RR47 1 2 10nF 17 10nF 28 C18 C7 PF1/ADC1 +12V C12 C14 10nF 1 NC TEMP_OS SDA2 INV1 2 2 120R R39 D20 18 TEENSY++2.0 NC OPTOCOUPLERMODULE 1 1 D16 19 PF3_TEENSY 2 1 27 1 1k2RR48 1 2 D21 33 PF0/ADC0+12V C9 10nF 1 R40 1k2R 2 10nF 120R R31 2 1 2 2 1 D55 1k2R R114 9 10 2 D15 2 D19 1 1k2R R32 1k2R 1 SPI_MISO_C2000 2 8 GND2 1 10nF 120R R29 2 1 R41 120R 2 1 R113120R 7 39 10nF 1k2R R30 PF2_TEENSY 1 6 2 D23 120R R37 SPI_CLK_C2000 5 38 +5V2 PF7/ADC7/TDI NC 10nF R42 1k2R PF1_TEENSY 10nF SCL SDA 37 20 40 +5V 2 D18 1 1k2R R38 1 2 1 D54 1k2R R112 4 120RR35 120RR45 2 41 3 2 1 PF0_TEENSY 2 1 R111120R PC7/A15/IC.3/CLKO TEMP_OS 36 10nF 1k2R R36 1 R46 1k2R 2 2 26 10nF C26 PE7/INT.7/AIN.1/UVCON PD7/T0 25 C23 PD6/T1 24 C48 10 23 C58 2 PB0/SS/PCINT0 22 C33 PB1/PCINT1/SCLK 21 C49 C40 C1 C31 C41 C3 1k2R 2 1 R8 D4 PB2/PDI/PCINT2/MOSI PD4/ICP1 9 1k2R 2 1 R10 2 PB3/PDO/PCINT3/MISO 10nF 8 PD5/XCK1 10nF 2 PB4/PCINT4/OC.2A PD3/TXD1/INT3 7 SPI_MOSI_C2000 1 2 TEENSY O_TEENSY I_TEENSY _TEENSY _TEENSY D1 PD1/OC2B/SDA/INT1 C8 PF6/ADC6/TDO 2 2 D22 47k R86 10nF 20 OPTO1 PC6/A14/OC.3A 35 1 FET2 19 10nF 1 2 PF4/ADC4/TCK PF5/ADC5/TMS PC5/A13/OC.3B RST 18 2 R7 120R C25 C26 PF3/ADC3 PC3/A11/T.3 10nF 17 PC4/A12/OC.3C 2 34 C20 PF2/ADC2 PC2/A10 33 C17 16 1 1k2R 2 1 R2 C4 +12V PF1/ADC1 2 6 C24 PF0/ADC0 15 C10 C21 PC0/A8 GND C7 13 10nF 14 PC1/A9 C22 12 R9 120R 4 PB7/PCINT7/OC.0A/OC.1C NC PB6/PCINT6/OC.1B C19 10nF 11 1 D40 PB5/PCINT5/OC.1A 10nF 5 PD2/RXD1/INT2 10nF R1 120R D2 10nF PE1_TEENSY C16 9 10 D3 4 1 R4 1k2R 2 2 R6 1k2R 2 C58 10nF 8 2 1 2 PD0/OC0B/SCL/INT0 40 R12 1k2R +12V R11120R 39 21 2 2 12 1 1 D5 10nF PE0_TEENSY VCC+12V PE1/RD 38 +12V R13 120R R14 1k2R 22 37 D6 2 2 1 1 10nF PC7_TEENSY +12V13 PC0/A8 NC 5 36 NC NC 23 1k2R R16 120R R15 PB5/PCINT5/OC.1A 6 R2D1 PD0/OC0B/SCL/INT0 2 2 1 1 10nF 14 PC1/A9 PC6_TEENSY D7 NC 7 1 NC PB4/PCINT4/OC.2A 24 R18 R42 PD1/OC2B/SDA/INT1 +12V R17120R 1k2R R41 8 2 2 15 2 1 1 D8 10nF NC PC5_TEENSY 1k2R PC2/A10 9 25 2 2 120R 1 1 NC SPI_MISO_TEENSY PB3/PDO/PCINT3/MISO PD2/RXD1/INT2 GND R20 1k2R 10 31 R19120R R47 1k2RR48 120R 2 2 16 GND +12V_ISOLATED 1 1 D9 10nF 26 10nF30 2 2 PC4_TEENSY 1 1 D21 SPI_MOSI_TEENSY 11 PC3/A11/T.3 PB2/PDI/PCINT2/MOSI PD3/TXD1/INT3 GND +12V_ISOLATED R22 1k2R 12 29 R49 1k2R R50 R21120R 27 D24 2 2 120R 1 1 NC +12V_ISOLATED 10nF 2 2 1 SPI_CLK_TEENSY 1 10nF 17 PC4/A12/OC.3C PC3_TEENSY D10 PB1/PCINT1/SCLK 13 28 PD4/ICP1 NC NC 120RR130 14 272 1k2R R1311 R24 1k2R R23120RSPI_SS_TEENSY 28 2 D25 1 10nF GND_ISOLATED PB0/SS/PCINT0 2 2 D11 18 1 1 10nF PD5/XCK1 15 NC PC2_TEENSY 26 PC5/A13/OC.3B 1k2R R52 120RR51 NC GND_ISOLATED 29 10nF25 2 2 1 1 16 D69 INT.7_TEENSY R26 1k2R R25120R PE7/INT.7/AIN.1/UVCON NC GND_ISOLATED PD6/T1 D12 2 2 19 1 1 10nF 17 24 PC1_TEENSY 120R R65 1k2R R66 9PC6/A14/OC.3A NC NC 30 2 2 1 1 10nF D26 NC OVERCURRENT1_FAULT 18 23 PE6/INT.6/AIN.0 PD7/T0 R28 1k2R R27120R +5V +5V_ISOLATED 2 2 20 10 GND 1 1 19 22 D13 10nF PC0_TEENSY 31 PC7/A15/IC.3/CLKO 10nF D31 +5V +5V_ISOLATED 11 GND 20 21 PE0/WR NC +5V +5V_ISOLATED D14 10nF 32 AREF PE1/RD POWERSUPPLYMODULE 1k2RR44 120R R43 GND +5V C1 7 1 +12V 2 +12V 3 +12V 1 3 R3 120R C33 6 2 POWER1 C18 10nF 5 2 1 D32 10nF 1 R5 120R 1 PD7_LCD_RS 43 C40 4 R641k2R 2 PD5_LCD_EN C15 +12V 3 1 D33 OVER_CURRENT_FAULT_RESET 4 B18 2 2 C2 R63120R 1 C32 OVERCURRENT2_FAULT R67120R 1 R62 1k2R 2 10nF R61 120R 2 1 OVERCURRENT3_FAULT PB7/PCINT7/OC.0A/OC.1CPB6/PCINT6/OC.1B 3 D41 SDA PD6_LCD_RW C13 k2R R81 120R 2 1 SCL VCC GND 2 Teensy2++ 1 4 B18 1 VSS VDD V0 RS R/W EN DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 LCD1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1k2R 2 k2R Microcontroller Modules 5 Teensy2++ 42 k2R 5.2 6 C4 k2R 29 RELEASED: <Released By> DATED: <QC Date> <Code> A1<Drawing Number> <Revision> DATED: <Release Date>SCALE: <Scale> SHEET: 1OF 1 30 Optocoupler Isolation +5V_ISOLATED +5V +5V SCL 7 SCL SCL + P82B96 7 VO1 + 5 1 2 1 1 - 6 VO2 TEMP_OS J2-10 B16 VCC U4-A 2 8 J2-9 VF1 J2-8 2 2 OC 1 U4-B 3 VF2 4 R27 HCPL2630 GND SCL_ISOLAT TEMP_OS_ISOLAT 5 GND RXD,SCL 6 J2-7 1k 1 4 SDA_ISOLAT 390 VF1 2 2 TXD,SCL 5 SDA_ISOLATED SCL_ISOLATED 2 SDA 3 6 VO2 1 J2-6 RXD,SDA 2 - 7 VO1 390 SCL 2 2 8 VCC + VF2 J2-5 1 TXD,SDA 3 1 SDA SDA B11 2 8 2 2 TEMP_OS J2-4 VCC 1k R1 B15 J2-3 R34 390R R28 1 1 390R R25 1 R24 390 R26 1 ¨1k5 1k5 R23 J2-2 R22 1 J2-1 7417 4 4 + GND HCPL2630 OC 3 TEMP_OS_ISOLATED 7417 Figure 27: Optocoupler module schematic COMPANY: 5.3 In figure 27 the optocoupler module can be seen. <Drawn It uses the<Drawn P82B96 IC (inteBy> Date> grated circuit) and two fast optocouplers to galvanically isolate the high voltage <Checked By> <Checked Date> side from the low voltage side of the I2C bus. This is to protect the low voltage <QC Date> <Code> 4 3 <QC By> side from a5failure on the high voltage side and to prevent high voltage 2transients <Released By> <Release Date> <Scale> coupled into the bus lines. DRAWN: DATED: CHECKED: DATED: QUALITY CONTROL: DATED: RELEASED: DATED: CODE: SCALE: D <Co TITLE: 5.4 LTR SIZE: B <D 1 REVISION RECOR ECO NO: CAN Bus Module T1 10nH CAN Bus R1 60R 1 1 2 B1 2 B31 2 C1 330nF 6 Optocoupler Module CANH +5V B30 SPI_MOSI_TEENSY SPI_CLK_TEENSY SPI_CS_TEENSY 8 RS 7 CANH 6 CANL 5 VREF 60R 1 R41 2 CANL MCP2551 C31 100nF C16 C15 330nF C17 330nF 330nF C18 330nF 1 2 A LED D16 2 Y2 560R R66 560R R65 2 A K D15 1 TXD 2 VSS 3 VDD 4 RXD MCP2515 1 SPI_INT_TEENSY 1 2 3 4 5 6 7 8 9 LED C 1 B34 VDD TXCAN RESET RXCAN CS CLKOUT/SOF SO TX0RTS SI TX1RTS SCK TX2RTS INT OSC2 RX0BF OSC1 RX1BF VSS D10 SPI_MISO_TEENSY 18 17 16 15 14 13 12 11 10 1 1 22pF K 2 10k R62 20MHz C32 C33 22pF GND B Figure 28: CAN bus module schematic J1-1 J1-2 SPI_CS_TEENSY J1-3 SPI_MISO_TEENSY J2-1 J2-2 CANL In figure 28 the CAN bus module can be seen. It uses the MCP2515 as the SPI <Company Name> Can interface and the MCP2551 bus driver. A common mode choke is considered in case of interference that leads to a bad bus. The choke is not placed on the <Title> J1-4 SPI_MOSI_TEENSY J1-5 SPI_CLK_TEENSY J1-6 SPI_INT_TEENSY COMPANY: J2-3 J2-4 TITLE: J2-5 J2-6 J1-7 A J2-7 DRAWN: CANH DATED: <Drawn By> <Drawn Date> J1-8 J2-8 J1-9 CHECKED: DATED: <Checked By> <Checked Date> CODE: SIZE: DRAWING NO: J2-9 J1-10 QUALITY CONTROL: <QC By> J2-10 RELEASED: <Released By> DATED: <QC Date> <Code> B <Drawing Num DATED: <Release Date>SCALE: <Scale> SHEET: 2 7417 1 D J1-8 CURRENT_SENS2_OUT J1-9 CURRENT_SENS1_OUT J1-12 EPWM1B J1-13 EPWM2A J1-14 EPWM2B J1-15 4 + 5 GND R31 PC0_TEENSY PC1_TEENSY PC2_TEENSY PC3_TEENSY PC4_TEENSY PC5_TEENSY PC6_TEENSY PC7_TEENSY 11 10 9 8 7 6 5 4 PE0_TEENSY PE1_TEENSY 12 13 B0 B1 B2 B3 B4 B5 B6 B7 VDD 3S2 10 3R 9 3Q SN54LS279AN HCPL2630 31 U5-A 1 OC 2 OVERCURRENT1_FAULT 14 U5-B 74ALS05A 3 RFB I_OUT1 I_OUT2 OC 4 16 board yet. If the CAN bus works without the choke it is better to avoid using it because it creates high voltage transients at the driver’s bus input. 74ALS05A 1 2 OVERCURRENT_VOLTAGE_REF CS WR 3 GND EPWM3A J1-16 6 VO2 U8 EPWM1A J1-11 2 1 U4-A EPWM3B J1-10 2 OC OVER_CURRENT_FAULT_RESET 2S 7 2Q 8 GND VO1 - 3 390R 2 R26 V - J1-7 VF2 2 OVERCURRENT_VOLTAGE_REF J1-6 VREF AD7524N 15 100µF C15 J1-17 J1-18 5.5 J1-19 Inverter Module J1-20 Temperature Sensor Current Measurement B8 1 1 10k R24 EPWM1A 2 2 CURRENT_SENS1_OUT 2P-2.54 5 6 7 SE95 8 2 C 3 4 1 1 8 VCC 7 A0 6 A1 5 A2 JUMPER4 10k B12 1 SDA 2 SCL 3 OS 4 GND SDA_ISOLATED SCL_ISOLATED TEMP_OS_ISOLATED 2 + C2 R33 J2-2 2 C1 100nF R22 9 1 4M7 F1 10 VDD1 IIN VDD2 IIN R1 IIN R2 IIN GND2 IIN GND3 IOUT OUT IOUT NC IOUT TRST IOUT GND1 IOUT 20 19 SDA_ISOLATED SCL_ISOLATED CURRENT_SENS1 TEMP_OS_ISOLATED 18 17 16 15 14 13 J4-1 12 11 SI8503-C-IS +12V_ISOLATED D1 B2 1 EPWM2A 1 2 + 1k 4 10 B3 1 R50 1 4R7 J2-1 Figure 29: Mosfet inverter module schematic J3-1 J6-2 J6-3 J6-4 J6-5 J6-6 J6-7 In figure 29 the schematic of the inverter module can be seen. It includes the ADC for measuring the battery’s voltage, the isolated bootstrap driver circuit, the temperature sensor for the pair of mosfets, the current measurement and the two mosfet switches. J3-2 J3-3 J3-4 TEMP_OS_ISOLATED SCL_ISOLATED SDA_ISOLATED OVER_CURRENT_FAULT_RESET J6-10 PE1_TEENSY J6-12 J6-13 J6-14 J6-15 J6-16 J6-17 J6-18 J6-19 J6-20 J3-7 J3-9 J6-9 J6-11 J3-6 J3-8 J6-8 A J3-5 5.6 Resolver to Digital Converter Module PE0_TEENSY PC0_TEENSY PC1_TEENSY J3-10 J3-11 J3-12 J3-13 J3-14 In figure 30 the schematic for the resolver to digital converter module can be seen. The motor’s resolver is connected at the terminals S1-S4 and R1-R2. R1 and R2 supply the excitation voltage. S1-S4 receive the angle information of the PC2_TEENSY PC3_TEENSY PC4_TEENSY PC5_TEENSY PC6_TEENSY PC7_TEENSY J3-15 J3-16 J3-17 J3-18 J3-19 J3-20 7417 R14 7417 2 HCPL2630 R7 OC C4 U1-E + 2 1 2 3 390R 1 11 74LS08 6 D2 U9-B B J6-1 OC 8 R13 10k 5 390R 1 FAN7382 2 GND CURRENT_SENS1 8 VB 7 HO 6 VS 5 LO U1-D U2 1 VCC 2 HIN 3 LIN 4 COM C3 150nF D6 3 1 R1 6 VO2 5 + 9 1 R2 2 4 7 VO1 2 - 3 U9-A 74LS08 EPWM2B +C11 2 2 OVERCURRENT1_FAULT C12 7417 OC U1-C 5 SDA_ISOLATED R3 VCC + 1 8 VF2 4 6 1 VF1 1 1k 3 OC U1-B 7417 B10 1 R30 46k9 390R EPWM1B SCL_ISOLATED 2 2 2 2 3 MCP3021A5T AIN SDA VSS 390R 1 R4 4 5 SCL ADC1 VDD 1 HV Measuring 1 2 10k +5V_ISOLATED EPWM1A R8 4R7 5R Isolation 2 R49 + R9 R29 C9 2 + OVERCURRENT1_FAULT 996k5 1 Bootstrap Driver C10 2 4 C29 J3-9 J3-8 J3-7 J3-6 J3-5 J3-4 120pF +12V R42 S3 R47 2 1 1 15.4k S1 S2 S4 2 2.2k C Q1 2 B R45 2 R64 2 1 R1 2 4R7 2 1 R48 3R3 1 E 1 R2D_SAMPLE Q2 B R2D_WR/FSYNC C R2D_RESET R49 2 R2D_RESET 1 2.2k R2D_LOT R2D_A1 120pF R2D_A0 +12V AD2S1210 13 14 15 16 17 18 19 20 21 22 23 24 2 R52 2 1 15.4k R57 1 2.2k C Q3 2 B C2 4.7µF 2 + R60 C27 10nF E 4R7 SPI_CLK_C2000 R56 SPI_MOSI_C2000 SPI_MISO_C2000 R44 2 10k R2D_A1 3R3 1 C26 22pF 1 1 Y1 R2D_SAMPLE R43 22k 36 35 34 33 32 31 30 29 28 27 26 25 C30 R2D_WR/FSYNC 2 A1 DOS LOT RESET DIR NM B A DB0 DB1 DB2 DB3 R2D_LOT 48 47 46 45 44 43 42 41 40 39 38 37 REFOUT REFBYP COS COSLO AVDD SINLO SIN AGND EXC EXC A0 RES0 4.7µF + RES1 CS RD WR/FSYNC DGND DVDD CLKIN XTALOUT SOE SAMPLE DB15/SDO DB14/SDI DB13/SCLK DB12 DB11 DB10 DB9 VDRIVE DGND DB8 DB7 DB6 DB5 DB4 1 B36 1 C1 B33-A TS992 B32 R51 2 +IN1 R2D_A0 1 2 3 4 5 6 7 8 9 10 11 12 D12 1 10k 2 10k R63 1 B37 C19 2 C20 10µF +5V SPI_MOSI_C2000 -IN1 OUT1 10nF 2 22pF 8.192MHz C25 2 1 10k 3 C24 10nF +5V 1 C21 10nF R50 1 + D11 2 C22 4.7µF +5V SPI_MISO_C2000 4R7 +12V E R46 3R3 +5V C3 680nF SPI_CLK_C2000 6 1 D13 1 R55 2 -IN2 10k R2 B33-B 2 1 10k 2 1 1 22k R58 2 4R7 TS992 R54 3R3 2 R53 R61 +IN2 +5V 7 D14 OUT2 5 E 1 J3-3 J3-2 32 Q4 B C 2 R59 1 2.2k Figure 30: Resolver to digital converter module schematic COMPANY: rotor. The output voltages of the resolver that are interpreted by the converter are expressed as sine and cosine functions of the rotor angle θr : <Drawn By> <Drawn Date> DRAWN: DATED: CHECKED: DATED: <Checked By> Vd = V0 sin θr sin ωrs t QUALITY CONTROL: <QC By> RELEASED: Vq = V0 cos θr sin ωrs t < TITLE: <Released By> <Checked Date> DATED: <QC Date> CODE: SIZ <Code> A DATED: <Release Date>SCALE: <Scale> 33 6 Inverter Parts Power Supply Module Teensy2++ In figure 31 the assembled mosfet inverter can be seen. It is separated into 8 modules with the purpose to make failure search easier. Being a prototype if something goes bad only the damaged module has to be replaced or redesigned. LCD CAN Bus Module C2000 Launchpad Optocoupler Module Inverter Module Mosfet Resolver to Digital Converter Module Figure 31: Modules of the mosfet inverter 6.1 Switching Devices The choice of the right switch depends on the voltage of the intermediate circuit, the maximum current, the switching frequency and the ambient temperature. Lower switching frequencies are generally better because the on an off-state is longer compared to the switching time in which Rdson creates heat. What switching frequencies are permissible for the switches and what frequencies are suitable for the motor to be controlled has to be tested. For now a maximum switching frequency of 4kHz is assumed. 34 6.1.1 MOSFET Driver In order to design a good driver we have to look at some requirements: To achieve a good efficiency with the inverter it is important to keep the switching losses as small as possible. Most of the losses are created during the on and off switching of the device. During the transition of these two states the switch provides a greater resistance and more power is turned into heat. This is due to the fact that during a transition the mosfet is not ideally driven in saturation. The n-doped layer is not fully enhanced. A quick transition means less losses. This quick transition can be achieved by reducing the time it takes to charge and discharge the gate capacitances of the switch. The charging and discharging time can be reduced by providing a high enough current. The mosfets are switching a high voltage power source. The hard switching leads to electromagnetic interference that can be coupled back into the system and effect the electronics. Thus it is necessary to galvanically isolate the switches from the low voltage electronics. Because each mosfet pair is connected in series a driver has to be implemented which can drive each mosfet separately without the risk of accidentally switching on the upper switch. This could be caused by the flyback voltage generated by the connected motor’s inductance. The flyback voltage can create a negative potential which can lead the mosfet to switch on again. A bootstrap driver was chosen because of its simplicity and small cost. It has the disadvantage that the on-time duty cycle is limited by the requirement to refresh the charge in the bootstrap capacitor. 6.1.1.1 Bootstrap Driver Calculation In figure 32 you can see the schematic of the driver circuit. The driver ic used is FAN7382. The choice for this driver is based on recommendations according to the application note AN-6076 from Fairchild Semiconductor. The mosfet to be driven is IXFH-FK170N10P. SE95 8 2 R22 9 1 4M7 F1 10 NC IOUT TRST IOUT GND1 IOUT 13 J4-1 12 35 11 SI8503-C-IS +12V_ISOLATED ATED _CURRENT_FAULT_RESET TEENSY TEENSY TEENSY TEENSY TEENSY TEENSY TEENSY TEENSY TEENSY TEENSY D1 EPWM2A 1 10k Ilkgs Ilkcap Iqbs Ilkdiode Ilk ton 7417 9 1 R50 EPWM2B Value 12V 0.7V 10V 198nC 3nC Description Supply voltage of gate driver Bootstrap diode forward voltage drop minimum gate-source saturation voltage Total gate charge Charge required by the internal level shifter, which J3-1 is set to 3 nC for all HV gate drivers J3-2 100nA Switch gate-source leakage current J3-3 0nA Bootstrap capacitor leakage current J3-4 120µA Bootstrap circuit quiescent current J3-5 10nA Bootstrap diode leakage current J3-6 50µA Bootstrap circuit leakage current J3-7 J3-8 25µs High-side switch on time Table 4: Bootstrap driver parameters J3-9 J3-10 J3-11 J3-12 The total charge that needs to be supplied by the bootstrapJ3-13 capacitor is calculated by the following equation. J3-14 J3-15 J3-16 J3-17 Qtotal = Qg + (Ilkcap + Ilkgs + Iqbs + Ilk + Ilkdiode ) · ton + QJ3-18 ls = 205.3nC J3-19 J3-20 The voltage over the capacitor is determined by the supplied driver voltage, the voltage drop over the diode and the minimum voltage to drive the switch into R14 7417 B3 1 The parameters involved in the calculations are: Parameter name Vdd Vf Vgsmin Qg Qls OC 8 R7 4R7 OC 2 10 1 C4 U1-E 74LS08 390R + 11 U9-B HCPL2630 + U1-D D6 C3 150nF R13 FAN7382 D2 5 390R 1 6 10k R1 1k 4 CURRENT_SENS1 8 VB 7 HO 6 VS 5 LO 2 7417 OC U1-C GND 5 TED U2 1 VCC 2 HIN 3 LIN 4 COM Figure 32: Mosfet driver schematic J2-1 SDA_ISOLATED ISOLATED +C11 7 VO1 6 VO2 EPWM1B C12 3 74LS08 5 + 1k 1 4 U9-A 1 - 3 2 8 VCC + 1 OVERCURRENT1_FAULT 6 R3 2 VF1 1 R30 46k9 390R 1 2 AIN SDA 1 2 4 MCP3021A5T R4 B10 2 2 VF2 3 1 2 R2 7417 3 U1-B OC 390R 4 Measuring 1 2 EPWM1A B2 1 2 +5V_ISOLATED R8 4R7 5R Isolation 2 R49 + R9 R29 C9 2 + OVERCURRENT1_FAULT 996k5 1 Bootstrap Driver C10 36 saturation. The voltage drop over the resistor is not relevant because it only limits the time in which the capacitor can be charged. ∆Vboot = Vdd − Vf − Vgsmin = 1.3V The value of the bootstrap capacitor then is: Cboot = Qtotal = 157.9nF. ∆Vboot As the bootstrap resistor value 8Ω is chosen. The resistor limits the charging current of the capacitor to protect it. The RC constant for charging the capacitor is: τ = 8Ω · 157.9nF = 1.26µs This is the minimal time that has to be ensured to exist between the PWM pulses to allow the capacitor to charge up. With a maximum frequency of 4000Hz even with a duty cycle of 99% there would be enough time to charge the capacitor. 1 1 · (1 − D) = · (1 − 0.99) = 2.5µs f 4kHz 6.1.2 IGBT Driver The igbt module to be driven is 6MBI 100S-120. It combines a full 3 phase bridge in one package. The igbt gate charges are nearly equal to that of the mosfet driver. Here another approach is taken from the application note AN-7004. The following parameters are considered: • Qg = 600nC - The dynamic gate charge of the igbt. • Vgon = 12V - The gate voltage to drive the igbt in saturation. • Vgof f = 0V - The minimum voltage at which the igbt is shut off. • Rg = 12Ω - The gate resistance. • fs = 4kHz - The switching frequency. • VCE = 400V - The collector-emitter voltage. • Pdriver - Gate driver output power. • Igpeak - Gate driver peak current. The dynamic gate charge can be read from the igbt datasheet seen in figure 33 (a). At VCE = 400V we can read around 200nC. To be on the safe side we can go a bit higher on the curve. 600nC is chosen. In figure 33 (b) at Vgon = 12V we can see that the igbt is in saturation. 37 (a) (b) Figure 33: (a)Igbt dynamic gate charge, (b VGE vs. current) The energy needed to be transferred to the gate is: E = Qg · (Vgon − Vgof f ) = 2nW h. The driver output power needs to be: Pdriver = E · fs = 0.029W. The average gate current is: Ig = Qg · fs = 2.4mA. The peak gate current is: Igpeak = Vgon − Vgof f Rg As an integrated solution the driver module SKYPER 32 R from Semikron could be used to drive a pair of igbts. 38 6.2 Protection The inverter has to be protected to ensure the safety of the people working with it and to protect the device and the motor attached to it. In any case, situations for which the inverter and the motor are not designed have to be avoided. Variables that need to be monitored are: • DC battery voltage. If the DC voltage is to high it can cause the isolation of the switching devices to break down and destroy them. • Switch and motor temperature. If the switches experience high temperatures due to inappropriate switching or too high ambient temperature they could get damaged. • Current. A short circuit can cause the temperature in the switches and the motor to rise rapidly, to fast for the temperature control to respond. • Motor speed. High motor speed above the maximum rating or for longer periods can heat the motor and can also present a mechanical risk to people. The battery voltage is measured with a 10 bit ADC (Analogue to digital inverter). The ADC is connected to the isolated I2C bus (Inter-integrated circuit). Overvoltage protection exists in the form of a RDC snubber (directional snubber) The temperature of the switches is measured by placing the heatsink of a pair of mosfets on a SOIC (small-outline integrated circuit) 13 bit temperature sensor. The motor temperature is measured with 3 analogue sensors which are measured by the C2000 launchpad’s ADCs. A fuse is placed at the positive battery terminal. 6.2.1 Short Circuit Protection The current is measured with 3 AC sensors with an analog 5V output. Short circuit protection is implemented with logic gates. In the case of a short circuit the logic will latch and will not return into operational mode without a manual failure reset. The logic circuit is shown in figure 34. The comparator to the left switches it output to a logic one if the current voltage signals rises higher than the reference voltage at the negative input. This sets the latch (flip-flop) to a logic one. The signal is then inverted and fed to an AND gate. Thus blocking any input from the PWM input to the AND gate and preventing the mosfet to be switched. Figure 34: Short circuit protection logic circuit B1 39 B11 2P-2.54 5 6 1 RCD Snubber CURRENT_SENS2_OUT SE95 7 8 R23 2 9 1 4M7 10 R1 IIN R2 IIN GND2 IIN GND3 IOUT OUT IOUT NC IOUT TRST IOUT GND1 IOUT 20 1 1 19 18 C16 100nF CURRENT_SENS2 C17 2 + 47k IIN R41 VDD2 EPWM3A 3 4.7µF 17 4 2 2 2 2 4 JUMPER3 1 6.2.2 SE95 R39 10k 8 VCC 7 A0 6 A1 5 A2 3 IIN 16 15 14 CURRENT_SENS3_OUT 13 5 2P-2.54 EPWM2A VDD1 JUMPER2 47k R25 + 1 10k R36 1 SDA 2 SCL 3 OS 4 GND SDA_ISOLATED SCL_ISOLATED TEMP_OS_ISOLATED 1 8 VCC 7 A0 6 A1 5 A2 R40 10k 2 B25 B21 1 SDA 2 SCL 3 OS 4 GND C14 2 2 C13 100nF 2 6 1 1 1 7 J4-2 8 12 2 11 R34 9 1 In figure 35 the RCD snubber circuit can be seen. To design it the following parameters are considered: 4M7 10 VDD1 IIN VDD2 IIN R1 IIN R2 IIN GND2 IIN GND3 IOUT OUT IOUT NC IOUT TRST IOUT GND1 IOUT 20 19 18 CURRENT_SENS3 17 16 15 14 13 J4-3 12 11 J8-1 J7-2 J8-2 J7-3 J8-3 J7-4 J8-4 J7-5 J8-5 J7-6 J8-6 J7-7 J8-7 EPWM1A J7-8 J8-8 EPWM2A J7-9 J8-9 J7-10 J8-10 J7-11 J8-11 2 50R R46 D3 B13 1 C18 15nF 4R7 2 R52 1 OVERCURRENT3_FAULT 1 R15 C19 15nF B JUMPER1 1 2 2P-5.08 Figure 35: RCD snubber circuit Cs = 2 · 2 · (Coss + Cmount ) = 11.36nF J7-1 10k 1 74LS08 2 EPWM3B R51 2 CURRENT_SENS3 FAN7382 C8 D8 U10-B + D7 1 2 D10 1k 5 6 8 VB 7 HO 6 VS 5 LO 10k GND 1 10k U7 1 VCC 2 HIN 3 LIN 4 COM HCPL2630 2 R48 4 5 + 2 U1-A 2 4 7 VO1 6 VO2 R20 7417 B5 1 OC R5 4R7 OVERCURRENT2_FAULT - VF2 390R 2 VCC + B7 1 4R7 1 1 2 3 1 74LS08 HCPL2630 1k R19 R21 FAN7382 C6 3 U10-A 74LS08 R18 2 1 8 2 1 VF1 12 390R 1 B14 1 2 2 7417 OC D9 U1-F CURRENT_SENS2 8 VB 7 HO 6 VS 5 LO R16 R17 10k R47 2 13 U10-D + 2 5R 1 2 11 C5 150nF U3 1 VCC 2 HIN 3 LIN 4 COM 1k 12 5 EPWM3A D5 GND R10 5R 1 1k R12 2 VF2 6 VO2 13 + U10-C 10 8 1 - 7 VO1 +5V_ISOLATED C +12V_ISOLATED • Vpeak = 100V - The estimated flyback voltage is around 2 times the battery’s voltage. • Ipeak = 20A - maximum estimated bleeding resistor current • Coss = 2340pF - IXFH-FK170N10P • Cmount = 500pF - IXFH-FK170N10P • fs = 4kHz - maximum switching frequency A safe value for the snubber capacitance is 2 times the total gate capacitance. Because there are 2 active switching paths at all times this value can be doubled. 9 74LS08 R11 VCC + B4 1 4R7 8 2 VF1 B6 R6 SI8503-C-IS C7 150nF 2 D4 +12V_ISOLATED 1 +5V_ISOLATED OVERCURRENT3_FAULT OVERCURRENT2_FAULT SI8503-C-IS J5-1 CURRENT_SENS1_OUT A standard value for Cs of 15nF is used. Energy to be dissipated in the capacitor is: J5-2 J5-3 J5-4 J5-5 CURRENT_SENS3_OUT ERs TEMP_OS_ISOLATED J8-12 J7-13 J8-13 2 Cs · Vpeak = 15.78nW h. = 2 J5-7 EPWM3A J7-12 J5-6 J5-8 J5-9 J5-10 SCL_ISOLATED J5-11 SDA_ISOLATED J5-12 A The average power dissipation in Rso at given frequency is: <Company Name> J5-13 J7-14 J8-14 J7-15 J8-15 J7-16 J8-16 J7-17 J8-17 J7-18 J8-18 COMPANY: J5-14 J5-15 J5-16 PRs = Cs · J5-17 J5-18 J7-19 J8-19 J7-20 J8-20 TITLE: 2 Vpeak fs <Drawn· By> DRAWN: CHECKED: The value for Rs is: J5-20 QUALITY CONTROL: <QC By> RELEASED: <Released By> Rs = <Drawn Date> DATED: <Checked By> J5-19 <Title> = 0.454W. DATED: <Checked Date> DATED: <QC Date> CODE: SIZE: DRAWING NO: REV: <Code> A1<Drawing Number> <Revision> DATED: <Release Date>SCALE: <Scale> Vpeak = 5Ω. Ipeak SHEET: 1OF 1 40 6.3 Microcontroller As the motorcontroller the C2000 Launchpad from Texas Instruments is used. The microcontroller itself on the board is Piccolo TMS320F28027. It was chosen because of its capability to run complex control algorithms like field oriented control at a low cost. The board costs around 14 e(May 2013). Ready made libraries are available that provide basic tools for motor control. This makes the software development comparatively easy and saves time. 6.4 6.4.1 Figure 36: C2000 Launchpad Sensors Temperature Sensors As a temperature sensor SE95DP from NXP is used. It communicates via I2C and has a temperature accu- Figure 37: Temperature racy of ±1°C at 13-bit resolution. 6 of these sensors Sensor SE95DP from NXP are placed beneath the IGBT module. 3 of these sensors are used to sense the temperature of the mosfet modules, one sensor for each pair. 6.4.2 Current Sensors For the low power version, which uses MOSFET switches, a shunt resistor will be used to measure the current to keep the price low. For the high power version, which uses IGBT switches, closed loop Hall effect sensor will be used to measure the current with a good linearity over a wide range. One sensor measures the DC input current from the battery. Two other sensors measure the AC phase currents ia and ib . ic can be calculated from those two phase currents. To avoid long measuring wires the sensors are placed directly at the Figure 38: Current Sensor HAIS-50-P and HAIS-100-P from LEM used for current measurement. housing, where the wire 41 is being fed through the cable gland. There the measurement contacts are connected closely to the measuring microcontroller. The DC leading cable coming from the battery pack has a wire size of 16mm2 and a diameter of 10.2mm. The wire size has to be considered to fit through the sensing hole. A too tight fit might damage the sensor. 6.4.3 Voltage Sensor The DC battery voltage is measured using a 10 bit ADC inverter which is connected to the I2C bus. A voltage divider is used to reduce the measured voltage to 5V maximum. 42 7 7.1 Measurements Voltage Divider Resistance Figure 39: Measurement setup In figure 39 the measurement setup for measuring the true resistor values for the voltage divider can be seen. This voltage divider is used to measure the DC voltage of the battery. When the dc voltage is applied current will heat up the resistors and change their value. To get good measurements the voltage drop and current are separately measured over a range of voltages. A couple of minutes were waited to allow to values to settle. In figure 40 and table 5 the results can be seen. A linear regression gives the values for the resistors. 43 Figure 40: Linear regression of resistance value V [V ] V 1[V ](calc.) V 2[V ] I[µA] 97.60 93.23 4.37 103.50 89.80 85.78 4.02 95.25 80.00 76.42 3.58 84.90 70.00 66.87 3.13 74.20 59.90 57.21 2.688 63.60 50.00 47.76 2.241 53.00 40.00 38.21 1.793 42.40 30.10 28.75 1.350 31.90 19.98 19.08 0.895 21.10 10.00 9.55 0.448 10.60 5.00 4.78 0.224 5.30 R1 lin.reg.[kΩ] R2 lin.reg.[kΩ] 900.500 4.22 Table 5: Resistance measurement results 44 7.2 Inverter The generated PWM is filtered using a RC low pass filter with R = 50kΩ and C = 8nF . Figure 41: PWM at 4000 Hz In figure 41 the generated sinusoidal PWM by the microcontroller can be seen. A lookup table with 12 lookup points is used resulting in the waveform in figure 42. Figure 42: Sine wave 166 Hz with 12 lookup points 45 Figure 43: PWM at 25000 Hz In figure 43 the generated sinusoidal PWM by the microcontroller can be seen. A lookup table with 42 lookup points is used resulting in the waveform in figure 44. Figure 44: Sine wave 285 Hz with 42 lookup points 46 8 Program Can Bus Controller SPI Bus Battery Teensy (I2C Master) TI C2000 Launchpad Galvanic Isolation Mosfet Driver with Overcurrent Protection Mosfet Switches ADC Input DC Voltage Sensor x1 Temperature Sensor x3 us IB SP I2C Communication Bus Galvanic isolation AC Current Sensor x3 Resolver Signal AC Motor Figure 45: System communication overview In figure 45 you can see a system overview of the inverter. The systems in blue are the parts that need to be programmed. Until now the CAN bus communication using SPI has been programmed. The I2C communication with the temperature sensors has been programmed but not successfully tested. Using the C2000 launchpad the sinusoidal PWM has been programmed to work in a stationary state. The control loop has still to be implemented. The resolver information via SPI has to be programmed. The I2C routine to read the DC voltage has to be programmed. 47 9 Summary and Conclusion In this thesis the theory of controlling a permanent magnet synchronous motors has been introduced. The control loop of the inverter was shown and direct torque control and field oriented control were discussed. A low voltage mosfet inverter was built. The sinusoidal pulse width modulation was programmed and tested. Most of the parts of a inverter were discussed. Ways to design and calculate a driver for a mosfet or igbt were shown. The components used in the project were mostly taken from the inventory of the university’s laboratory. Thus the cost was kept lower than 150 e. As an outline into the future of this project the following points are considered. The control equations to design a PI controller have to be discussed. The low voltage mosfet inverter has to be further tested and programmed. A field oriented control can then be implemented and tested on a low voltage inverter. The low voltage mosfet inverter was mostly built with through hole components. To keep parasitic capacitances and inductances as low as possible the final inverter should be designed using small outline components. 48 List of Figures 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Formula Student logos . . . . . . . . . . . . . . . . . . . . . . . . . Metropolia Motorsport logo . . . . . . . . . . . . . . . . . . . . . . System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . Taxonomy of AC motors . . . . . . . . . . . . . . . . . . . . . . . . (a) Continuous Counter EMF of a PMSM, (b) Trapezoidal Counter EMF of a BLDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Typical PMSM structures: (a) surface magnet, (b) inset magnet, (c) pole shoe rotor, (d) tangentially embedded magnets, (e) radially embedded magnets (flux-concentration), (f) two magnets per pole in the V position, (g) a synchronous reluctance motor equipped with permanent magnets.[8, p. 397] . . . . . . . . . . . . . . . . . Structure of the Metropolia Motorsport’s motor: interior magnet . . Simplified equivalent circuit of a 3 Phase AC motor. . . . . . . . . . Stationary equivalent circuit of a PMSM (one phase) . . . . . . . . Square wave conversion . . . . . . . . . . . . . . . . . . . . . . . . Square wave amplitude spectrum . . . . . . . . . . . . . . . . . . . Modified sine wave conversion . . . . . . . . . . . . . . . . . . . . Modified sine wave amplitude spectrum . . . . . . . . . . . . . . . Simulated PWM signal for a pure sine wave . . . . . . . . . . . . . Simulated PWM signal for a pure sine wave amplitude spectrum . Stationary frame of the three phases abc with overlayed stationary α,β frame (a), Space dector diagram (b) . . . . . . . . . . . . . . . Space vector synthesizing . . . . . . . . . . . . . . . . . . . . . . . Control loop overview . . . . . . . . . . . . . . . . . . . . . . . . . Clarke and Park transformation [7, p. 9] . . . . . . . . . . . . . . . (a) Equivalent MOSFET representation including junction capacitances; and (b) representation of this physical location.[9, p. 83] . . The IGBT (a) half-cell vertical cross section and equivalent circuit model[9, p. 102], (b) IGBT capacitances . . . . . . . . . . . . . . . (a) Simplified gate charge waveforms, (b) Gate charge characteristic [5, p. 2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Matlab simulation of space vector pwm . . . . . . . . . . . . . . . . Power supply schematic . . . . . . . . . . . . . . . . . . . . . . . . Teensy2++ schematic . . . . . . . . . . . . . . . . . . . . . . . . . C2000 launchpad schematic . . . . . . . . . . . . . . . . . . . . . Optocoupler module schematic . . . . . . . . . . . . . . . . . . . . CAN bus module schematic . . . . . . . . . . . . . . . . . . . . . . 3 3 4 6 7 8 9 11 12 15 16 16 17 17 18 19 19 21 23 24 25 26 27 28 29 29 30 30 49 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 Mosfet inverter module schematic . . . . . . . . . Resolver to digital converter module schematic . . Modules of the mosfet inverter . . . . . . . . . . . Mosfet driver schematic . . . . . . . . . . . . . . . (a)Igbt dynamic gate charge, (b VGE vs. current) . Short circuit protection logic circuit . . . . . . . . . RCD snubber circuit . . . . . . . . . . . . . . . . . C2000 Launchpad . . . . . . . . . . . . . . . . . . Temperature Sensor SE95DP from NXP . . . . . . Current Sensor HAIS-50-P and HAIS-100-P from current measurement. . . . . . . . . . . . . . . . . Measurement setup . . . . . . . . . . . . . . . . . Linear regression of resistance value . . . . . . . . PWM at 4000 Hz . . . . . . . . . . . . . . . . . . . Sine wave 166 Hz with 12 lookup points . . . . . . PWM at 25000 Hz . . . . . . . . . . . . . . . . . . Sine wave 285 Hz with 42 lookup points . . . . . . System communication overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEM used for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 32 33 35 37 38 39 40 40 40 42 43 44 44 45 45 46 50 List of Tables 1 2 3 4 5 PMSM parameter overview . . . . . PMSM dynamic equations[4, p. 154] Comparison between DTC and FOC Bootstrap driver parameters . . . . . Resistance measurement results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 13 22 35 43 51 References [1] Metropolia Motorsport Team History, 2013. http:// metropolia-motorsport.fi/team/team-history/; accessed 20.05.2013. [2] Zsolt Borkai. About FSHungary, 2012. about-fshungary; accessed 20.05.2013. http://fshungary.hu/ [3] Rolf Fischer. Elektrische Maschinen 15. edition. HANSER, München, 2011. [4] Kwang Hee Nam. AC Motor Control and Electric Vehivle Applications. CRC Press, New York, 2010. [5] Markus Hermwille. Igbt driver calculation. Technical report, Semicron, 2007. http://www.semikron.com/skcompub/en/AN-7004_IGBT_Driver_ Calculation_rev00.pdf. [6] SAE International. 2013 Formula SAE Rules, 2012. http://students.sae. org/competitions/formulaseries/rules/2013fsaerules.pdf. [7] Microsemi. Field oriented control of permanent magnet synchronous motors. Technical report, Microsemi Cooperation, 2012. http://www.actel.com/ documents/SF_FOC_PMSM_HALL_UG.pdf. [8] J. Pyrhönen, T. Jokinen, and V. Hrabovcová. Design of Rotating Electrical Maschines. Wiley, Chichester, UK, 2008. [9] Muhammad H. Rashid. Power Electronics Handbook. Academic Press, 2001. [10] Wikipedia. Direct torque control, June 2013. http://en.wikipedia.org/ wiki/Direct_torque_control. 52 A A.1 Matlab Code Matlab code for square wave generation freq = 1; % Base Frequency fs=freq*1000; % Sampling frequency A = 1; % Amplitude t = 0:1/fs:32/freq; y = A* square(2*pi*freq*t); figure(1); clf(1,'reset'); plot(t,y); axis([0 2/freq −1.2*A 1.5*A]); xlabel('Time [s]'); ylabel('Voltage[V]'); title('SquareWave'); set(gcf,'color','w'); %set background to white %set(gca,'XTick',0:pi/4:2*pi) %set(gca,'XTickLabel',{'0','pi/4','pi/2','3/4pi','pi','5/4pi','6/4pi... ','7/4pi','2pi'}) % Fast Fourier Transform of Square Wave L = length(y); %Length of Signal NFFT = 2ˆnextpow2(L); % Next power of 2 from length of signal => FFT... length FFT = fft(y,NFFT)/L; %FFT is symmetric => through away second half FFT=FFT(1:NFFT/2+1); %+1 ? %Take the magnitude of FFT mFFT=2*abs(FFT); %create frequence vector f = fs/2*linspace(0,1,NFFT/2+1);%(0:NFFT/2−1)*fs/NFFT; % Plot single−sided amplitude spectrum. figure(2); clf(2,'reset'); plot(f,mFFT); title('Amplitude Spectrum of SquareWave'); xlabel('Frequency [Hz]'); ylabel(' | Voltage[V ] | '); set(gcf,'color','w');%set background to white axis([0 10*freq 0 1.2*A]); 53 A.2 Matlab code for modified sine wave generation clf(1,'reset'); clf(2,'reset'); freq = 1; % Base Frequency fs=freq*10000; % Sampling frequency A = 1; % Amplitude n= 20; %n Periods %D = [2.5 10 17.5 20]' * 1/freq; % pulse delay times D= 0.25*1/freq:1/freq:n/freq; D2=0.75*1/freq:1/freq:n/freq; t = 0 : 1/fs : n/freq; % signal evaluation time w = 0.25*1/freq; % width of each pulse y = A*(pulstran(t,D,'rectpuls',w)−pulstran(t,D2,'rectpuls',w)); figure(1); plot(t,y); axis([0 2/freq −1.2*A 1.2*A]); xlabel('Time [s]'); ylabel('Voltage[V]'); title('Modified Sinus Wave'); set(gcf,'color','w'); %set background to white % Fast Fourier Transform of Square Wave L = length(y); %Length of Signal NFFT = 2ˆnextpow2(L); % Next power of 2 from length of signal => FFT... length FFT = fft(y,NFFT)/L; %FFT is symmetric => through away second half FFT=FFT(1:NFFT/2+1); %+1 ? %Take the magnitude of FFT mFFT=2*abs(FFT); %create frequence vector f = fs/2*linspace(0,1,NFFT/2+1);%(0:NFFT/2−1)*fs/NFFT; % Plot single−sided amplitude spectrum. figure(2); plot(f,mFFT); title('Amplitude Spectrum of Modified Sine Wave'); xlabel('Frequency [Hz]'); ylabel(' | Voltage[V ] | '); set(gcf,'color','w');%set background to white axis([0 10*freq 0 A]); 54 A.3 Matlab code for pure sine wave generation sinfreq = 1;% Base Frequency fs = sinfreq*10000; %sampling frequency fc = 20; %carrying frequency A=1; %Amplitude t = 0:1/fs:32/sinfreq; desired pos signal = A*sin(2*pi*sinfreq*t); carrying signal = A*sawtooth(2*pi*fc*t,0.5); desired vel signal = zeros(size(desired pos signal)); desired vel signal = sign(diff(desired pos signal)); PWM = zeros(size(desired pos signal)); %fill PWM with zeros figure(1) clf(1,'reset'); plot(t,carrying signal,'g'); hold on for k= 1:length(desired pos signal) if carrying signal(k) > desired pos signal(k) PWM(k)=−1; elseif carrying signal(k) < desired pos signal(k) PWM(k)=1; end end plot(t,desired pos signal) hold on plot(t,PWM,'r') title('Pure Sine Wave PWM switching'); xlabel('Time [s]'); ylabel(' | Voltage[V ] | '); axis([0 1 −1.2 1.2]); set(gcf,'color','w'); %set background to white annotation('textbox',... [0.001 0.817 0.095 0.072],... 'String',{'Vdc'},... 'LineStyle','none'); annotation('textbox',... [0.001 0.49 0.095 0.072],... 'String',{'Vdc/2'},... 'LineStyle','none'); y = PWM; % Fast Fourier Transform 55 L = length(y); %Length of Signal NFFT = 2ˆnextpow2(L); % Next power of 2 from length of signal => FFT... length FFT = fft(y,NFFT)/L; %FFT is symmetric => through away second half FFT=FFT(1:NFFT/2+1); %+1 ? %Take the magnitude of FFT mFFT=2*abs(FFT); %create frequence vector f = fs/2*linspace(0,1,NFFT/2+1);%(0:NFFT/2−1)*fs/NFFT; % Plot single−sided amplitude spectrum. figure(2); clf(2,'reset'); plot(f,mFFT); title('Amplitude Spectrum of sine wave'); xlabel('Frequency [Hz]'); ylabel(' | Voltage[V ] | '); set(gcf,'color','w');%set background to white axis([0 100*sinfreq 0 A]); 56 A.4 Matlab code for space vector PWM function [S1,S2,S3,S4,S5,S6,sector,t1]=fcn(vd e,vq e,ramptime,... theta e,Ts,Vdc) S1=3;S2=3;S3=3;S4=3;S5=3;S6=3; %switching fault state values %transform from synchronous into stationary frame vd s=cos(theta e)* vd e−sin(theta e)* vd e; vq s=sin(theta e)* vq e+cos(theta e)* vq e; %find sector number in hexagon if(vq s > 0) if(abs(vq s) > (sqrt(3)*abs(vd s)) ) sector=2; elseif(vd s > 0) sector=1; else sector=3; end; elseif(abs(vq s) > (sqrt(3)*abs(vd s))) sector=5; elseif(vd s > 0) sector=6; else sector=4; end; %calculate T1,T2 duties for each sector to generate relation between... d,q T1=sqrt(3)*Ts/(Vdc)*(sin(pi/3*sector)* vd s−cos(pi/3*sector)* vq s); T2=sqrt(3)*Ts/(Vdc)*(−sin(pi/3*(sector−1))* vd s+cos(pi/3*(sector−1)... )* vq s); T0 =Ts−(T1+T2); t1=[T0/4 T1 T2 T0/4 T0/4 T2 T1 T0/4];t1=cumsum(t1); %sector I if(sector==1) pwmS1=[0 1 1 1 1 1 1 0];pwmS3=[0 0 1 1 1 1 0 0];pwmS5=[0 0 0 1 1... 0 0 0]; pwmS4=[1 0 0 0 0 0 0 1];pwmS6=[1 1 0 0 0 0 1 1];pwmS2=[1 1 1 0 0... 1 1 1]; for j=1:8 if(ramptime<t1(j)) 57 break; end; end; S1=pwmS1(j);S3=pwmS3(j);S5=pwmS5(j); S4=pwmS4(j);S6=pwmS6(j);S2=pwmS2(j); end; % sector II if(sector==2) pwmS1=[0 0 1 1 1 1 0 0];pwmS3=[0 1 1 1 1 1 1 0];pwmS5=[0 0 0 1 1... 0 0 0]; pwmS4=[1 1 0 0 0 0 1 1];pwmS6=[1 0 0 0 0 0 0 1];pwmS2=[1 1 1 0 0... 1 1 1]; for j=1:8 if(ramptime<t1(j)) break; end; end; S1=pwmS1(j);S3=pwmS3(j);S5=pwmS5(j); S4=pwmS4(j);S6=pwmS6(j);S2=pwmS2(j); end; %sector III if(sector==3) pwmS1=[0 0 0 1 1 0 0 0];pwmS3=[0 1 1 1 1 1 1 0];pwmS5=[0 0 1 1 1... 1 0 0]; pwmS4=[1 1 1 0 0 1 1 1];pwmS6=[1 0 0 0 0 0 0 1];pwmS2=[1 1 0 0 0... 0 1 1]; for j=1:8 if(ramptime<t1(j)) break; end; end; S1=pwmS1(j);S3=pwmS3(j);S5=pwmS5(j); S4=pwmS4(j);S6=pwmS6(j);S2=pwmS2(j); end; %sector IV if(sector==4) pwmS1=[0 0 0 1 1 0 0 0];pwmS3=[0 0 1 1 1 1 0 0];pwmS5=[0 1 1 1 1... 1 1 0]; pwmS4=[1 1 1 0 0 1 1 1];pwmS6=[1 1 0 0 0 0 1 1];pwmS2=[1 0 0 0 0... 0 0 1]; 58 for j=1:8 if(ramptime<t1(j)) break; end; end; S1=pwmS1(j);S3=pwmS3(j);S5=pwmS5(j); S4=pwmS4(j);S6=pwmS6(j);S2=pwmS2(j); end; % sector V if(sector==5) pwmS1=[0 0 1 1 1 1 0 0];pwmS3=[0 0 0 1 1 0 0 0];pwmS5=[0 1 1 1 1... 1 1 0]; pwmS4=[1 1 0 0 0 0 1 1];pwmS6=[1 1 1 0 0 1 1 1];pwmS2=[1 0 0 0 0... 0 0 1]; for j=1:8 if(ramptime<t1(j)) break; end; end; S1=pwmS1(j);S3=pwmS3(j);S5=pwmS5(j); S4=pwmS4(j);S6=pwmS6(j);S2=pwmS2(j); end; %Sector VI if(sector==6) pwmS1=[0 1 1 1 1 1 1 0];pwmS3=[0 0 0 1 1 0 0 0];pwmS5=[0 0 1 1 1... 1 0 0]; pwmS4=[1 0 0 0 0 0 0 1];pwmS6=[1 1 1 0 0 1 1 1];pwmS2=[1 1 0 0 0... 0 1 1]; for j=1:8 if(ramptime<t1(j)) break; end; end; S1=pwmS1(j);S3=pwmS3(j);S5=pwmS5(j); S4=pwmS4(j);S6=pwmS6(j);S2=pwmS2(j); end;