1. Trang chủ
  2. » Giáo Dục - Đào Tạo

controlling and enhancing performance of permanent magnet synchronous motor

97 0 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Controlling and Enhancing Performance of Permanent Magnet Synchronous Motor
Tác giả Lê Vũ Thanh
Người hướng dẫn Lê Thanh Phúc, Ph.D.
Trường học Ho Chi Minh City University of Technology and Education
Chuyên ngành Automotive Engineering Technology
Thể loại Graduation Project
Năm xuất bản 2024
Thành phố Ho Chi Minh City
Định dạng
Số trang 97
Dung lượng 7,96 MB

Cấu trúc

  • Chapter 1: INTRODUCTION (0)
    • 1.1. Background (19)
      • 1.1.1. Overview (19)
      • 1.1.2. Research progress in domestic (19)
      • 1.1.3. Research progress in international (21)
    • 1.2. Research objectives (23)
    • 1.3. Research subjects (23)
    • 1.4. Research limitation (23)
    • 1.5. Research methods (23)
    • 1.6. Research contents (24)
    • 1.7. Research layout (24)
  • Chapter 2: LITERATURE REVIEW (0)
    • 2.1. Permanent Magnet Synchronous Motor (25)
      • 2.1.1. An introduction (25)
      • 2.1.2. Structure and arrangement (26)
      • 2.1.3. Control techniques (28)
      • 2.1.4. Operation principle (29)
      • 2.1.5. Comparing to other electric motors (31)
    • 2.2. Resolver (31)
      • 2.2.1. Function and features (31)
      • 2.2.2. Resolver to digital (33)
    • 2.3. Passive circuit elements (34)
      • 2.3.1. Resistor (34)
      • 2.3.2. Capacitor (36)
      • 2.3.3. Diode (38)
    • 2.4. Active circuit elements (41)
      • 2.4.1. Microcontroller STM32F103C8T6 (41)
      • 2.4.2. Voltage regulator LM7805 (44)
      • 2.4.3. Operational amplifier LM358P (45)
      • 2.4.4. Optocoupler HCPL2631 (47)
      • 2.4.5. Driver IR2103 (48)
      • 2.4.6. Transistor C1815 (50)
      • 2.4.7. MOSFET 20N60 (51)
      • 2.4.8. IGBT H20R1203 (52)
    • 2.5. STM32CubeMX (54)
      • 2.5.1. Introduction to the basics (54)
      • 2.5.2. Interrupts (57)
      • 2.5.3. ADC conversion (58)
      • 2.5.4. Timer (58)
      • 2.5.5. Keil C (59)
    • 2.6. Sine PWM (60)
  • Chapter 3: PMSM CONTROL SYSTEM (0)
    • 3.1. Six – step commutation (63)
    • 3.2. Control system description (64)
      • 3.2.1. System block diagram (64)
      • 3.2.2. Control algorithm flowchart (65)
      • 3.2.3. STM32CubeMX configuration (66)
    • 3.3. Resolver to digital circuits (68)
      • 3.3.1. Amplifier circuit (68)
      • 3.3.2. Half – wave rectifier circuit (70)
    • 3.4. PMSM controlling circuits (71)
      • 3.4.1. Controller circuit (71)
      • 3.4.2. Driver circuit (72)
      • 3.4.3. Power circuit (74)
  • Chapter 4: IMPROVING THE PMSM PERFORMANCE (0)
    • 4.1. PMSM control algorithm (75)
      • 4.1.1. Examining the outputs from the resolver (75)
      • 4.1.2. Plotting the tangent value of theta (76)
    • 4.2. H – bridge circuit (78)
      • 4.2.1. Sine PWM application (79)
      • 4.2.2. Circuit configuration and working principle (80)
  • Chapter 5: EXPERIMENT RESULTS (0)
    • 5.1. Hardware products (83)
      • 5.1.1. Designing PCB (83)
      • 5.1.2. Assembling the circuits (86)
    • 5.2. Control results (88)
      • 5.2.1. Amplifying and interrupt results (88)
      • 5.2.2. Six – step commutation results (91)
  • Chapter 6: CONCLUSION AND RECOMMENDATIONS (0)
    • 6.1. General evaluation (93)
    • 6.2. Improving possibilities (93)

Nội dung

Abbreviations AC Alternating Current MOSFET Metal – Oxide – Semiconductor Field – Effect Transistor ADC Analog to Digital Converter PCB Printed Circuit Board APB Advanced Perip

INTRODUCTION

Background

The automotive industry is currently experiencing a profound transformation characterized by a widespread shift towards electric propulsion systems This transformation is fundamentally reshaping the traditional landscape of vehicles, as electric cars become increasingly common With this surge in electric vehicle adoption, there is a demanding need for more efficient electric engine technologies to Induction motors have emerged as a popular choice in the electric vehicle market due to their simplicity, durability, and ability to generate significant torque at low speeds This torque characteristic is crucial for ensuring smooth acceleration, a key factor in the overall driving experience However, Permanent Magnet Synchronous Motors (PMSM) are also gaining ground in the industry due to their distinct advantages PMSMs offer higher efficiency, compact size, precise control, and reduced energy losses compared to induction motors These qualities make PMSMs particularly attractive for electric vehicle applications However, effectively controlling PMSMs presents its own set of challenges, particularly in terms of accurately sensing rotor position

This thesis endeavors to propose a control technique called six – step commutation which is used to control PMSMs and investigating some adjustments, tuning aimed at optimizing PMSM performance in electric vehicles

In Vietnam, PMSM control has attracted a wide range of researchers from many universities Overall, these studies proposed some of the PMSM control techniques and simulated in Matlab/Simulink, as shown in the following [Tab 1.1] is a few of the studies that has been posted in domestic science magazines

Table 1.1 A few related domestic studies

– based speed control of permanent

The closed – loop speed responses in the presence of load variation are improved by the specified control TI

The controller integrates the benefits of the disturbance observer and the backstepping controller The PIL approach

2 magnet motors with high-gain disturbance observer” [1]

C2000 F28377S and Matlab Simulink are used to validate the system through processor in the loop simulation results show that even in the presence of disturbances, the developed controller achieves little steady – state error and fast speed response

“Sliding mode controller based on fuzzy logic for

PMSM servo system with uncertain disturbance”

The PMSM motor system is modeled using unidentified noise components Follo wing that, a sliding controller with limitations based on fuzzy rules is used, which helps the system move quickly into the sliding domain and reduces chattering Lyapunov criteria are used to establish the controller’s stability

The study summarized the findings of a sliding controller that used fuzzy rule – derived constraints The collected outcomes suggest the PMSM system operates better with the proposed controller, notably lowering noise and chattering issues

“Synthesizing the speed controller of permanent magnet synchronous electrical motor with the blower load using adaptive sliding control” [3]

The goal of this research is to strengthen the speed controller’s robustness against variations in noise and parameters Specifically, the speed controller of a permanent magnet synchronous electrical motor (PMSM) was synthesized using the adaptive sliding control approach with a blower load The speed control system is simulated using Matlab - Simulink and is based on a synthesized controller

The acquired conclusions show that the synthesized controller functions effectively in terms of stability when load, motor dynamic parameter, and model parameter variations occur

Moving to other parts of the world, PMSM control methods have been developed for a while and has achieved quite a diversity of control techniques Following up in [Tab 1.2] are some of those studies represent a few more solutions for controlling PMSM engine

Table 1.2 Some related research in international

This study integrates concepts from several vector control and speed control methodologies to create a thorough classification of vector control strategies

These basic qualitative characteristics set apart the approaches described in the classification A comparative examination of various methods is provided, along with useful application recommendations

All DTC approaches are clearly applicable for use in traction and transport drive systems, as demonstrated by the analysis done When precise positioning precision is not a key concern, VVC and PBC approaches can also be applied in industrial and technical systems, such as traction drives

For applications requiring high – precision tracking, aiming, and drive coordination, direct FOC in conjunction with non – classical speed controllers is especially optimal

The author introduces the vector control of a Permanent Magnet Synchronous Motor (PMSM) using a Proportional – Integral (PI) regulator, which exhibits satisfactory tracking performance in terms of speed, stability, and precision Subsequently, they

This control technique is highly sensitive to variations in machine settings The robustness of the PI regulator is not flawless during the inversion of rotation speed

4 analyze the simulation results and compile a list of disadvantages associated with

This work presents a sigmoid function – based sliding mode observer position estimation technique Additionally, by using Lyapunov stabilization analysis, it provides a sufficient condition for directing the SMO into a sliding surface The study’s findings show that under various velocity and load situations, the SMO, which uses the sigmoid function for sensor – less control of Permanent Magnet PMSM

As evidenced by the experimental results, the sigmoid function – based SMO has substantially higher accuracy and efficiently suppresses and eliminates the buffeting phenomenon

Nonetheless, additional examination is necessary to tackle the disparity between the projected position, which predicts the true position during stress scenarios, in order to minimize or eradicate it

A generalized proportional integral observer (GPIO) for lumped disturbance estimation is presented in this study

Next, the feedforward compensation given by the GPIO is paired with an STSM (super – twisting sliding mode) controller It can achieve better tracking precision while using a smaller switching gain

The Lumped disturbance is estimated in real time using a GPIO Furthermore, a composite controller is built by the integration of the STSM controller and feedforward compensation from the GPIO The excessive switching gain values that cause unacceptable dynamical performance are lessened with the aid of this composite controller

Research objectives

̶ Learn how a PMSM engine works ̶ Collect and handle the outputs from the resolver ̶ Design and assemble the control circuits ̶ Control the motor using STM32 board ̶ Improve the and engine’s performance

Research subjects

Hardware: ̶ PMSM engine ̶ Microcontroller STM32F103C8T6 ̶ Driver IR2103 ̶ Other components (Op – amp LM358P, MOSFETs, IGBTs…)

Software: ̶ STM32CubeMX ̶ Keil uVision5 ̶ Matlab ̶ Proteus

Research limitation

This thesis is limited in control and improve the control efficiency of the PMSM engine, specifically Toyota’s Prius MG1 Six step – commutation will be used as the control technique for this rotating electric engine This revolves collecting and handling resolver’s outputs, then applying STM32’s ADC reading, interrupt function in order to drive the current for PMSM’s control For the improving section, a H bridge circuit based on sine PWM generation is used to push out the frequency the excitation coil of the resolver further, enhancing the speed of the engine.

Research methods

Alongside the materials offered by the instructor, this thesis also acquired the references from forums, science journals, magazines and books, which are concluded in the reference section The experiment results are also based on designing, calculating, and data collecting during the research period to approach the solutions

Research contents

̶ Amplify the signals received from the resolver to calculate tangent value for PMSM controlling ̶ Design and build circuits to feed signals for controlling ̶ Apply six step – commutation to control the engine ̶ Stabilize the rotation of the engine by examine and plot out the optimized tangent value ̶ Minimize the control circuits ̶ Improve the speed of PMSM by apply the H bridge circuit for enhance the excitation coil’s frequency.

Research layout

These are the overall chapters of the thesis:

Chapter 4: Improving the PMSM performance

LITERATURE REVIEW

Permanent Magnet Synchronous Motor

Permanent Magnet Synchronous Motor, or PMSM is a type of AC electric motor which comes from the synchronous motor family [Tab 2.1] As the name suggest, the rotation relies on the interaction between the permanent magnets in its rotor and the rotating three phase magnetic field created by the armature of the stator This interaction creates smooth and efficient rotation, making PMSMs popular in various applications such as electric vehicles, industrial machinery, and renewable energy systems The use of permanent magnets in the rotor enhances the motor’s performance by providing strong magnetic flux density and reducing energy losses

Table 2.1 Rotating electric engine classification [8]

Electrically excited DC motor ̶ Separately excited ̶ Series ̶ Shunt ̶ Compound

Single phase ̶ with auxiliary winding ̶ with shaded – pole ̶ with asymmetrical stator Two phases

PMSM ̶ IPMSM ̶ SPMSM ̶ Hybrid WRSM SyRM Hysteresis Hybrid SyRM – PM Hysteresis – reluctance Stepper

In this thesis, Toyota 2004 Prius’ IPMSM MG1 has been used for testing (from now on, the content of the thesis will relate to this engine)

Similar to most of the rotating electric motors, PMSMs contain two main parts called rotor and stator [Fig 2.1], the first part does the rotation while the later stand

Figure 2.1 The arrangement of a PMSM engine [8]

9 still The rotor has 8 poles of magnets with high coercive force (Neodymium Iron Boron – NdFeB) inside with a “V” orientation, forming a fixed magnetic field that rotate with the rotor [Fig 2.2]

This setup helps to make the motor stronger and more efficient By arranging the magnets in a V – shape, it could help concentrating the magnetic power where it is needed most, cutting out the loss and helping the PMSM to produce more power

It also reduces any jerky movements when the motor starts, making it run smoother

The rotor contains only permanent magnets that does not require externally power source The lacking of brushes and slip rings can also contribute prolonging the lifetime of the engine and make it harder to encounter issues

Figure 2.2 Rotor assembled and partially disassembled [9]

Figure 2.3 The Prius’ PMSM stator [9]

For the stator, it consists of an outer frame and a core with an armature set of three – phase windings are used The stator windings are composed of 13 strands of copper wire, configured in parallel and series arrangements, with 9 turns per pole for each configuration [Fig 2.3]

Inside the stator cores, many of steel laminations are stacked in length and holding the coils in place These laminations are used to concentrate the magnetic field and cut out the power loss The coils lead the current in three different phases, forming an alternating magnetic field that attracts and reacts with the fixed one of rotor From this, the synchronous rotation of two magnetic fields makes the rotor to turn

Controlling a PMSM varies with the specific requirements of the task, and there are many ways to do this The [Tab 2.2] shows some of the techniques that can be used for PMSM control

Simple to control Control is not ideal

Vector Field oriented control With position sensor Efficient and accurate adjustment of the rotor’s position and motor speed

A rotor position sensor and a robust microcontroller within the control system are necessary components

No sensor required Exclusively for

PMSMs equipped with a salient pole rotor, necessitating a robust control system

In the range of this thesis, the PMSM will be controlled by six step – commutation, a trapezoidal closed loop with resolver method (from now on, the content of this thesis will relate to this control technique) This control method relies on knowing the exact position of the rotor to energize the semiconductor switches in the right order Each half of one rotation is divided by six steps, each symbolizes different rotating magnetic field’s part The other half of rotation repeats the same

The principle behind PMSM motor operation involves the interplay of the stator’s rotating magnetic field and the rotor’s permanent magnet field This interaction produces torque, which drives the rotor’s rotation When the motor operates at synchronous speed, the rotor’s rotation matches the speed of the stator’s magnetic field rotation, effectively synchronizing the rotor with the stator

The current passing through a conductor generates a magnetic field surrounding it, according to Ampere’s law If three wires are aligned at 120 degrees and each have current induced, they will form a net magnetic field The [Fig 2.4] below displays

A wide control range without the need for a rotor position sensor

High torque and current ripple

Simple to control Control is not ideal

Closed loop With position sensor (Resolver)

Average control difficult Position sensor required

More powerful control system required

Not suitable for low speed operation

12 the rotating magnetic field produced by a three – phase alternating current in three different time

Figure 2.4 Three – phase currents produce a rotating magnetic field with time [8]

As time passes, the components of the alternating current will fluctuate, leading to alterations in the magnetic field they produce Consequently, the resultant magnetic field of the three – phase winding will undergo a shift in orientation while preserving its amplitude The alternating magnetic field from the stator react with the fixed magnetic field of the rotor, push and pull again each other due to the poles and create a torque which makes the rotor to turn

After receiving the control signal from the pedal, by investigating the current position of the rotor with the help of the resolver, the controller will decide which coil to energize and a suitable three – phase current will be sent to the armature, following the specific supply order to that angle This process repeats itself and the rotor will keep rotating The resolver helps the controller decide order of energizing, prevent short circuit between phases Some semiconductor switches will be used to lead the current to the coils, forming a closed – loop control [Fig 2.5]

Figure 2.5 PMSM six step – commutation control process

2.1.5 Comparing to other electric motors

Depending on the requirements of each specific application, different types of electric motors may be chosen to optimize performance and efficiency PMSMs offer several advantages over traditional DC motors and induction motors With permanent magnets embedded within the rotor, PMSMs eliminate the need for brushes commonly found in DC motors, thereby reducing maintenance and wear Additionally, the synchronization between the rotating magnetic field and the rotor in PMSMs solves the issue of “slip”, which often encountered in induction motors, making them highly efficient even at low speeds This characteristic is particularly beneficial in automotive applications where a wide speed range is required

However, despite these advantages, PMSMs do have their drawbacks when comes to limited control techniques One such drawback is the requirement for a position sensor, such as a resolver, to accurately determine the rotor’s position This additional component increases the complexity and cost of PMSM systems compared to induction motors Moreover, the precise control of PMSMs necessitated by the need to know the exact position of the rotor further adds to their complexity, making them more challenging to control than conventional induction motors.

Resolver

In six step – commutation, the resolver takes a crucial part in the control scheme For providing the exact position of the rotor, the controller can decide the energized order for the phase coils which force the engine rotates In another words, the resolver acts as the last piece in the system, making it to becomes a close – loop feedback

The resolver is basically based on the theory of transformers Using the phenomena of induction between the three coils (excitation, sine, cosine) and a genius arrangement, a coil will be supplied with an excitation current, creating a sine and a cosine induced voltages in two other, perpendicular coils Due to the special – shaped plates attached on the engine’s rotor [Fig 2.7], when the output coils meet the space gaps on the plates, where there is the least material area and weakest magnetic field, the induced voltage will mostly approach zero In contrast, the maximum value of induced voltage can be collected when the coils are nearest to the position where the radius of the plates is largest This explains the ovals – waveform of the detection coils [Fig 2.6]

The output voltages coming from the sine and cosine coils will be out of phase

90 degrees because of the perpendicular arrangement of those coils Thanks to the feedbacks from the resolver, the controller can know exactly the position of the rotor and speed of the engine at specific interval

Figure 2.6 Arrangement of resolver’s coils and their waveforms [10]

Acting as the same function with the encoder, resolver’s choice on PMSMs has some certain benefits It does not contain any of electronic parts, and those components can easily malfunction because of high temperature from the harsh working condition Moreover, a resolver’s structure has only three stationary coils, which makes a resolver hardly to encounter an issue [Fig 2.7] However, the outputs of the resolver are just pure sinusoidal waveforms, making it more complex to read than a conventional encoder A resolver on the market is also more expensive than a small and compact encoder which does the same task

Figure 2.7 The metal plates on BLDC’s motor (left); Actual resolver on Prius’ PMSM

The main idea to make a resolver does its job is to supply an alternating current into the excitation coil, as the rotor rotates, the outputs will have the waveforms as in [Fig 6] However, these are only sinusoidal signals and the process handling these for the controller to understand is called Resolver to Digital (RTD)

In the range of this thesis, RTD can be divided into three main steps: signal amplifying, interrupt and ADC reading, and theta calculating

The return signals from the resolver are too low for the controller to read (about 100mV), so they need to be amplified in the range that board STM32F1 can record (from around 0 to 3.3V) To do so, a voltage divider is also needed to offset to the required range The amplifying circuit will be further presented in the later chapter

Even the signals are amplified, they only become larger in amplitude The most useful and easiest value to utilize is the peak values of the returned waves To read those, a half – rectifier circuit (presented in next chapter) will be used to produce a square wave that has the same frequency of the detection signals The interrupt function of the microcontroller will investigate the peak value of the resolver’s outputs whenever the square wave has a change (in this thesis, the falling edge interrupt will be used) At that specific time of interrupt, the microcontroller will read the ADC value at two sine and cosine coils and do further calculating for getting the angle of the rotor

The value of the excitation coil can be varied with many applications, in this thesis, 50Hz and 100Hz excitation frequency were tested to run the PMSM The instantaneous excitation voltage can be calculated using the formula [11]:

A: the amplitude of the excitation coil (V) ω: the resolver driving frequency (rad/s) t: the moment of time used for calculating 𝑉 𝑒𝑥𝑐𝑖𝑡𝑎𝑡𝑖𝑜𝑛 (s)

From the (2.1), formula, we can achieve the instantaneous voltages of the output signals as well [11]:

𝑉𝑐𝑜𝑠𝑖𝑛𝑒 𝑐𝑜𝑖𝑙 = 𝑉 𝑒𝑥𝑐𝑖𝑡𝑎𝑡𝑖𝑜𝑛 ∗ 𝑐𝑜𝑠𝜃 (2.2, 2.3) Finally, if minimal errors are ignored, we have the theta (θ) value (degrees) at the specific time using the formula:

Tan theta values could help the system identifies if the rotor is in what specific position to decide the next steps for controlling.

Passive circuit elements

Passive elements within an electric circuit lack independent energy; instead, they derive energy from external sources These passive elements could be resistance, inductance, or capacitance Upon receiving electrical energy, a passive circuit element reacts in various manners A resistor consumes energy, an inductor stores energy within a magnetic field, while a capacitor stores it within an electric field

When added to an electrical circuit, resistors are made expressly to add a certain degree of resistance Usually made of carbon or metal wire, they are designed to maintain a constant resistance value under a range of environmental circumstances Resistors produce heat instead of light when electrical power is lost in the circuit in which they are used, in contrast to lamps Yet the main purpose of a resistor is to provide a specific amount of electrical resistance, not to produce heat that can be used

Figure 2.8 Schematic of resistors (left); Resistors with variable values (right) [12]

The unit of resistance is known as the Ohm, symbolized by the Greek letter

Omega (Ω) Resistor values are often expressed in Ohms (Ω), or kilohms (KΩ) Resistors are expressed as a zig – zag line or a rectangular box in circuits [Fig 2.8]

The resistors that could vary their resistance manually or through specific circumstances are called potentiometers, or variable resistors [Fig 2.8] Furthermore, special resistor as photoresistors can change their resistance using light, thermistors using heat, or varistors using applied voltage

Fixed resistors’ value could be indentified by looking at their color bands, this order of color can tell a lot about their resistance, which is described in the [Tab 2.3]

For example, a 4 – band code as in [Fig 2.9] is Blue – Brown – Green – Silver

– Blue is 6.15 Ω with a tolerance of +/- 0.25% [12] Resistors have a huge range of

18 applications, they could be used for voltage divider, current limiting, or biasing

Capacitors store electric energy using two conductive plates separated by an insulator They come in various designs to meet specific needs, with smaller ones using circular plates and larger ones employing metal foil strips in a flexible insulator Both having an insulator sandwiched between the plates High capacitance capacitors use ultra – thin insulating oxide layers between conductive surfaces

In schematics, they’re represented by two parallel lines with wires connecting to the plates An older symbol depicted interleaved plates, reflecting the internal structure of most capacitors [Fig 2.10] The quantity represents how much charges a capacitor can hold is called capacitance, and computed with the unit of Faraday (F)

We can use an analogy for a water – balloons for capacitors At first, the balloon is empty, water can easily flow into and fill it up As the balloon reaches its limit, it is harder to push more water in If the water pressure at the input of the balloon is higher than elsewhere the water can go (other pipes), the flow will stop filling the balloon and prefer to that direction Need to add, if there are no other pipes and we keep filling the balloon, it may explode at certain point depending on size of the balloon and the rubber that it is made of Moreover, if we stop supply the water to the already filling balloon, due to elasticity, the balloon will start releasing the water to other pipes until all the pressure in the pipes are balanced

Same for a capacitor, a concentrated field flux generates between a capacitor’s two plates whenever a voltage is placed across them [Fig 2.11], which enables a significant variation in free electron concentration or a charge to form between the two plates, forming an invisible pressure that can be release if the voltage goes down

Figure 2.9 An example resistor’s band color code [12]

Certain capacitors are designed to withstand voltage applied in only one polarity but not the other This characteristic arises from their construction: a microscopically thin layer of insulation, known as the dielectric, is deposited on one of the plates by a DC voltage during manufacturing These capacitors, termed electrolytic capacitors, are clearly marked with their polarity [Fig 2.10], [12]

Given that capacitors consist solely of two conductors separated by an insulator (the dielectric), it’s crucial to consider the maximum voltage permitted across them Exceeding this threshold could surpass the “breakdown” rating of the dielectric material, potentially leading to internal short – circuiting of the capacitor [12]

Capacitors can be varied with shapes and sizes, different configurations, such as: ceramic capacitors, plastic film capacitors, electrolytic capacitors, tantalum capacitors, but mostly, their function in circuits remaining the same They can be used for timing, filtering and decoupling, energy storage or tuning signals

Although being a semiconductor component, diodes are still passive circuit element because they could operate without an external power source The main job of a diode inside the circuit is to allow or block current flow in one direction We can use the hydraulic check valve as an analogy for the diode in term of working principle Due to the arrangement, the hydraulic check valve will only allow the fluid to flow in one side and block the flow on the other side [Fig 2.13]

Figure 2.13 Hydraulic check valve’s working principle [12]

As a semiconductor element, diodes possess the ability to act as both conductor and insulators under different circumstances Most of diodes are made of silicon, a substance that has 4 electrons at their valence shell, making them harder to conduct The process to make silicon can lead current called doping – adding impurities such as boron or phosphorus

Diodes are made from two pieces of doping silicon merging with each other The piece with boron – doping is called P junction, making it have extra holes, or spots for the electrons to settle, since boron has only 3 outer electrons In contrast, the other piece of diodes is called N junction and doped with phosphorus, which has

5 electrons at their valence shell, turning the piece to have extra free electrons [Fig 2.14] If no voltage is applied to the diode, a thin depletion region blocking current is from between the P – N junction due to the jump of the electrons to fill up the holes

The diagram above [Fig 2.14] illustrates the schematic symbol of the diode, where the anode (pointing end) aligns with the P – type semiconductor Conversely, the cathode bar, the non – pointing end corresponds to the N – type material It’s important to observe that the cathode stripe on the physical component corresponds

21 to the cathode on the symbol

Figure 2.14 Diodes’ structure and schematic [12]

Active circuit elements

Active elements within an electric circuit possess independent energy sources, distinguishing them from passive elements Unlike passive elements, which rely on external sources for energy, active elements generate or control energy internally Common examples of active elements include transistors, operational amplifiers, and integrated circuits When added into a circuit, active elements actively manipulate signals, amplifying, switching, or modifying them to achieve desired functions These components play a pivotal role in signal processing, amplification, and control within electronic systems, significantly influencing their performance and functionality

Designed to provide a broad range of processing power and peripheral integration for various embedded applications, STMicroelectronics developed the STM32 series of microcontrollers The ARM Cortex – M cores upon which these microcontrollers are built enable effective 32 – bit processing Widely used in several product lines with diverse specifications for power, performance, and features, the STM32 family is renowned for its adaptability [Fig 2.18] Applications for them are numerous and include consumer electronics, automotive systems, IoT devices, industrial automation, and more The STM32 microcontrollers give developers a versatile platform to implement their ideas effectively and dependably, together with a enormous of development tools and assistance

Figure 2.18 Board STM32F103C8T6 on circuit

Operating within a voltage range of 2.0 to 3.6 V, they are available in both standard and extended temperature ranges (-40 to +85°C and -40 to +105°C, respectively), and offer comprehensive power – saving modes for low – power applications The STM32F103xx series includes devices in six package types ranging from 36 pins to 100 pins, each offering different sets of peripherals tailored to specific requirements, [Fig 2.19] for example

Figure 2.19 STM32F103xx performance line LQF48 pinout [13]

The feature of the board STM32F103C8T6 used in this thesis can be referenced in the [Tab 2.4]

Timers 3 general – purpose 16 – bit timers, 1 PWM timer

HAL Library Support Support for STM32Cube Hardware Abstraction

CRC Calculation Unit Integrated CRC calculation unit for data integrity verification

Clock Management Flexible clock management system with multiple clock sources and PLL [Fig 22]

DMA Controller Direct Memory Access controller for efficient data transfer

Watchdog Timer Built – in watchdog timer for system monitoring and safety

Low – Power Modes Enhanced low – power modes for energy – efficient operation

Development Tools STM32CubeMX for graphical configuration and code generation, STM32CubeIDE for integrated development IDE

Ecosystem Support Rich ecosystem of third – party development boards, libraries, and community support

The clock tree of the STM32F103C8T6 is a vital aspect of its functionality [Fig 2.20], orchestrating the timing and synchronization of its components It offers flexibility in clock sources, including external oscillators and internal oscillators, with the option of employing a PLL for frequency multiplication The resulting system clock (SYSCLK) drives the CPU and core components, while the Advanced High – performance Bus (AHB) and Advanced Peripheral Buses (APB1 and APB2) facilitate communication between various peripherals and memory Each peripheral operates at its own clock frequency, derived from the APB clocks By configuring the clock tree, developers can optimize performance, power consumption, and timing accuracy to suit the specific requirements of their embedded applications

Figure 2.20 Clock tree of the STM32F103C8T6 [13]

The LM7805 is a common voltage regulator manufactured by various semiconductor companies It belongs to the 78xx series of fixed linear voltage regulators and is widely used in electronic circuits to provide a stable and regulated output voltage The “78” in its name indicates that it is a positive voltage regulator, while “05” signifies that it provides an output voltage of 5 volts The unused energy will be dissipated to environment as the form of heat If a suitable heat sink is attached, it can provide over 1A output current [14]

From the front view [Fig 2.21], the outer left pin will be marked as pin 1, or voltage input, ranging up to 35V [14] The middle pin 2 is connected to ground, while the last pin 3 is the output of the IC, delivering a steady voltage of 5V

The LM358P is a compact IC with two high gain op – amps using a single power supply [Fig 2.22] This integrated circuit can use over a wide range of voltage [15]

The pin configuration is presented in [Fig 2.22] With pin 2 and 6 are inverting pins; pin 3 and 5 are non – inverting pins; while the outputs are pin 1 and 7 The IC uses the power supply by positive VCC pin 8 and ground pin 4, respectively

When working with op – amps, there are two main characteristics we need to keep in mind: the op – amps will try their best to make the difference of input voltages stay at 0 (𝑉 + − 𝑉 − = 0); and there is very low input current enter the op – amps due to high impedance between the inputs (𝐼 + = 𝐼 − = 0)

Amplifiers are used to boost the amplitudes of the input signal Different circuit arrangements give out different features we want to achieve Even that, the working principle of them remains the same: the op – amps will compute the difference between their inputs, then multiplying it with the massive gain of theirs (usually 10K) before giving out the output using their power source Therefore, an op – amp can never push out the output higher than the source they are using They will enter a state called “saturation” and can only give out the voltage matching their power supply at maximum Two most used op – amp configurations for amplifying are non – inverting amplifier [Fig 2.23] and inverting amplifier [Fig 2.24]

Figure 2.23 Non – inverting amplifier configuration [16]

The gain of the non – inverting amplifier configuration is:

In contrast to the non – inverting amplifier, other than just multiplying the gain with the difference between the input, the minus sign of the gain in formula 2.7 also shift the phase of the signal, making the output inverting:

Optocouplers, also known as opto – isolators, providing a solution for isolating and transmitting signals between different circuits By utilizing light to transmit signals optically, optocouplers create a barrier that prevents electrical disturbances from affecting sensitive components They offer crucial benefits such as electrical isolation, protection from voltage spikes, signal conditioning, and enhanced noise immunity

Inside the optocouplers contain a LED and a phototransistor [Fig 2.25] The LED emits light when it’s forward biased, and this light is then detected by the phototransistor, which responds to the intensity of the light and generates an output current or voltage proportional to the input signal This configuration allows for the electrical isolation and transmission of signals between the input and output sides of the optocoupler

Basing on the configuration in [Fig 2.25], pin 2 and 3 are connected together and toward GND, while pin 8 and pin 5 are for powering the optocoupler up Hence, the remaining pins are pin 1 and 4 – acting as inputs, and pin 7 and pin 6 are their outputs, respectively Due to the feature of the schematic of elements inside HCPL2631, the outputs will be inversed against the inputs, changing the sign of the signals

The IR2103 is a highly versatile integrated circuit designed to precisely control Insulated Gate Bipolar Transistors (IGBTs) and power MOSFETs in high – power switching applications Serving as a gate driver, it provides the necessary high – voltage, high – speed signals to efficiently switch these power devices on and off Crucially, the IR2103 offers isolation between the control circuitry and the switches, ensuring safety and reliability in high – voltage working conditions Their floating channel could be utilized to drive an N – channel MOSFET or IGBT in the high side configuration that operates up to 600 Volts [18]

Figure 2.26 IR2103’s pins and their connections [18]

[Fig 2.27] describes the working logic I/O of the IC IR2103, while [Fig 2.26] shows the circuitry configuration We can see that when HIN and LIN̅̅̅̅̅ both receive the high logic inputs, HO will have the high logic output The opposite holds true for

LO, which have the high logic output if and only both HIN and LIN̅̅̅̅̅ are at low logic signals

Figure 2.27 Logic inputs and outputs of IR2103 [18]

STM32CubeMX

STMicroelectronics offers STM32CubeMX, a robust graphical software configuration tool that accelerates up development of applications for STM32 microcontrollers It enables quick prototyping and effective use of STM32 hardware features by allowing developers to create initialization code for middleware libraries and STM32 microcontroller peripherals The core feature of STM32CubeMX is its user – friendly interface, which makes configuration easier by showing the microcontroller and its accessories visually Developers can quickly choose and set up peripherals like GPIOs, timers, UARTs, SPI, I2C, DMA channels, and more using this interface, based on the needs of their applications

Figure 2.34 Main screen of STM32CubeMX at start up

As shown in [Fig 2.34] is the initial window of STM32CubeMX software when

37 starting up From here, we can choose to “access to MCU selector” and pick the microcontroller we want to work with.

Figure 2.35 Working space of STM32CubeMx

In [Fig 2.35] is the main working space of the software, which can be divided into 4 main areas At the top is area 1, for keeping track of the writing process and switching between important tabs of modification: pinout & configuration, clock configuration, project manager and tools

Figure 2.36 An example for choosing ADC configuration

Area 2 is for declaration of the functions that will be used The system core toggle is for general steps such as choosing the main clocks in RCC, debugging option in SYS, and declarations of pins in GPIO… Toggle analog offers user with two ADC channels: ADC1 and ADC2 which can be modified for different ADC purposes [Fig 2.36] Timers could be approached using toggle for timers, from here, PWM can be accessed to The job of area 3 is to display the modifications and options for users to utilize

A minimized configuration for resulting the pin configurations could be seen in area 4, helping users to keep track what they have changed and update their statuses

Clock configuration plays a vital role and need to be well modified in each project This could affect the overall working performance of a system we want to control, in [Fig 2.37] is a configuration of using the external crystal for high – speed clock

Figure 2.37 Modifying a clock configuration for a project

When done tuning the project, we can go to project manager tab [Fig 2.38] to name it, choosing toolchain, and make some minor changes before heading for the coding section

Figure 2.38 Project manager tab 2.5.2 Interrupts

Interrupts are signals that cause the processor to temporarily stop its current task and handle a specific event This event could be a hardware input (like a button press or sensor reading) or a software request (like a timer expiration or communication request) Interrupts allow embedded systems to respond quickly to important events without wasting processor time constantly checking for them

Figure 2.39 Workflow of interrupts in STM32 [23]

[Fig 2.39] depicts the workflow of interrupts inside a STM32’s program The

40 main program will stop wherever a change in edge’s voltage happens, alerting an interrupt event The system will then perform some more actions before callback the interrupt function, resolve it and jump back to where the interrupt began, continuing the main function

ADC conversion or ADC reading enables the microcontroller to process analog signals from sensors by converting them into digital data

The ADC converter supports various conversion modes [Fig 2.40] In the single mode, it can convert one channel at a time either in single – shot or continuous operation In the scan mode, the converter processes a complete set of pre – defined input channels either in a single – shot or continuous manner The discontinuous mode allows conversion of only one channel upon each trigger signal from the list of pre – defined programmed input channels

Pulse Width Modulation (PWM) is a commonly used technique for generating analog – like signals digitally in microcontroller applications In STM32CubeMX, timer function revolves generating PWM that involves configuring parameters such as frequency and duty cycle to control the output waveform

The frequency of the PWM signal, denoted as 𝐹 𝑃𝑊𝑀 , is crucial for various applications and is determined using the formula:

F PWM : desired frequency of the PWM signal (Hertz)

F clck : the frequency of the clock signal driving the PWM module (Hertz)

PSC: the pre – scaler, tuner of the input clock frequency before reaching timer’s counter, which effectively slows down the counting process of the timer

ARR: auto – reload register, definer of the period of PWM waveform, when the counter reaches this value, it resets back to zero, restarting PWM cycle

The frequency of PWM signal could be controlled by adjusting the value of PSC and ARR Hence, the duty cycle could be calculated using the formula 2.9, in which CCR is the capture/compare register:

Keil C stands out as a widely – utilized integrated development environment (IDE) crafted specifically for coding embedded systems, especially microcontrollers such as those found in the STM32 series Originating from ARM, Keil C offers a robust array of tools customized for embedded software creation, encompassing a potent C/C++ compiler, assembler, linker, and debugger

Figure 2.41 Working space of Keil C

After setting up in STM32CubeMX, Keil C is used for coding Down in [Fig 2.41] is the main working space of Keil C software

Keil C can be conveniently segmented into four primary sections, each catering to distinct aspects of the embedded software development process The first area contains the main tools essential for building and loading code onto microcontrollers,

In the second area, developers can efficiently manage and organize the files they are working on, ensuring a structured and systematic approach to code management

Meanwhile, area three serves as the workspace for coding, providing an intuitive environment for writing and editing code Finally, in area four, developers can observe the output of their builds, including compilation results and debugging information, allowing for real – time feedback and troubleshooting as needed This structured layout within Keil C enhances productivity and workflow efficiency, empowering developers to streamline their development processes and focus on creating robust embedded applications.

Sine PWM

Figure 2.42 Reference waves for Sine PWM

Sine PWM generation is a sophisticated method used in power electronics and motor control to approximate a sine wave voltage or current waveform using pulse

43 width modulation signals In essence, it involves modulating the width of pulses in the PWM signal to replicate the smooth and continuous nature of a sine wave By adjusting the duty cycle of the PWM pulses according to a predefined mathematical function, typically derived from the shape of a sine wave, it is possible to synthesize an output that closely matches the desired waveform

The common method to create a sine wave from a DC source is using two reference waves – a modulating wave and a carrier wave as shown in [Fig 2.42] The modulating wave is the blue pure sine wave, and the orange triangle wave is the carrier wave

The modulating sine wave has the frequency of 100Hz, and to express its magnitude, normally a definition of RMS (Root Mean Square) is used:

X N are all the discrete values that form the sine wave However, one can never measure all the points from the wave, thus a formula is born to give us the solution nearly approach what we need, with V m is the peak value of the amplitude.:

By comparing the modulating and the carrier waves’ voltage at specific

44 moments, the control output’s duty cycle is varied to the comparison between the reference waves If the modulating wave is greater than the carrier wave, PWM signal will turn to the high level, while the PWM signal achieves low level when the opposite circumstance happens [Fig 2.43]

Normally, a set of semiconductor switches are used for leading DC source to form PWM signal with the set – up we mentioned earlier Even if the output may have the shape of digital signal, the changes in duty cycle of the pulses make it to behave as a sine wave, and need to have more handling for approaching the smooth waveform

In this thesis, sine PWM is used for enhancing the PMSM’s speed – cutting out the need of outlet’s voltage and upgrading the excitation coil’s frequency from 50Hz to 100Hz.

PMSM CONTROL SYSTEM

Six – step commutation

The main control technique was used in this thesis called six – steps commutation It means to distribute currents to PMSM’s three phases in six steps, twice a rotation This could be achieved with the help of six individual IGBTs Each phase of the PMSM is supplied with a high side IGBT (connecting to power line) and a low side IGBT (connecting to GND) [Fig 3.1] The principle is in a moment, only one IGBT of a phase is closed, otherwise short circuit may happen

The particular of the energizing order is depicted in [Tab 3.1] For example, in step 1 phase A need to be supplied with the power line, while phase B and C need to be connected to GND In this circumstance, only Q1, Q5 and Q6 is closed, the flow of current will enter phase A through Q1, to the common node and enter phase B and

C, before return to GND through Q5 and Q6 This results in the forming of the suitable magnetic field that forces the rotor to make a slight turn Further steps require different energizing order before step 1 is repeated over and again

Table 3.1 Energizing order in six steps

Control system description

The first objective of the system was to make the rotation out of the PMSM This revolves the process of handling the RTD for the STM32 to send control signals Initially, a small transformer was used to change the outlet from AC 220V 50Hz to

AC 12V 50Hz [Fig 3.2] Then, the output of the transformer feed the excitation coil of the resolver and the input of half – wave rectifier circuit [Fig 3.3] After the induction of the coils of the resolver, two sinusoidal AC 100mV 50Hz signals came out and were amplified, offset to the reference of 1.6V Based on the falling edge interrupt between the half – wave rectifier output and the amplifier’s outputs, board STM32 read the values of sine and cosine coils Hence, tangent theta value could be calculated, and compared with the control constants to give out the appropriate control logic signals

Figure 3.2 220V AC to 12V AC transformer

The output pins from STM32 sent out the logic voltages to optocouplers, these ICs then flipped the signs of the logic voltages before sending them to the driver circuit Three IR2103, each control both high and low sides of one specific phase, using the signals received from the control circuit to guide the IGBTs from the power circuit, effectively powering the PMSM The rotation of the PMSM created the alternating voltage changes in sine and cosine coils of resolver, completing a closed loop

Figure 3.3 Block diagram of the control process

Enhancing the speed of the PMSM is the second objective of the thesis This was achieved by changing the input frequency of the excitation coil, from AC 50Hz to AC 100Hz By doing so, more interrupts and ADC reading could be made in a rotation, more tangent theta value might be computed, helping the PMSM to rotate twice faster

Control algorithm is based on a while loop Before the loop, there are six predetermined constant representing sine is positive (from A0 to A5), and six more for negative sine (from B0 to B5) [Tab 3.2]

Out of the main function, the interrupt function will be triggered whenever there is a falling edge from the half – wave rectifier circuit The system then read the ADC value of that crucial moment, preparing for the while loop

Figure 3.4 Flowchart of the control system

Within the while loop, the ADC values from interrupt action will be subtracted by 2048 (which equates to 1.6V) to eliminate the offset of the amplifier circuit These adjusted values are then divided to obtain the tangent theta value

Concurrently, the system checks whether the throttle position exceeds 2000 or not to proceed with the next line of codes; otherwise, it terminates the while loop In the event of meeting the first condition and if the returned sine value is greater than

0, positive control constants (A0 to A5) will be applied Conversely, if the sine value is negative, negative control constants (B0 to B5) will be employed Specific rotor positions necessitate particular orders of energizing; hence, a predetermined set of control orders is declared within the respective if functions [Fig 3.4]

Configuration for the I/O pins of the control process could be seen in [Tab 3.3] The system uses high speed clock of 72MHz, with one ADC channel: ADC1 for ADC reading and interrupt

Table 3.3 Pin configuration of STM32

PA0 GPIO_Output PMSM’s coil A control output 1

PA1 GPIO_Output PMSM’s coil B control output 1

PA2 GPIO_Output PMSM’s coil C control output 1

PA3 GPIO_Output PMSM’s coil A control output 2

PA4 GPIO_Analog ADC1_IN4 Throttle signal input

PA5 GPIO_EXTI5 Falling – edge interrupt detector

PA6 GPIO_Output PMSM’s coil B control output 2

PA7 GPIO_Output PMSM’s coil C control output 2

PB0 ADC1_IN8 Sine coil voltage reader

PB1 ADC1_IN9 Cosine coil voltage reader

[Fig 3.5] depicts the mentioned set up inside STM32CubeMX

Figure 3.5 Settings for GPIO pins

Resolver to digital circuits

Basing on the induction of the coils when the rotor rotates, the returned sine and cosine outputs is quite low (their amplitude is around 100mV) and could not be read using STM32 Therefore, an amplifier circuit is needed to boost the induction signals

Figure 3.6 Sine coil amplifier schematic

[Fig 3.6] describes the configuration of the sine coil’s amplifier circuit It utilizes the inverted amplifier to boost and shift the phase of the coil’s output using the gain from the formula 2.7 Applying the formula gives us the gain of (-10), which means the output will be 10 times bigger and is inverted in waveform:

The amplified output will go to pin PB0 of STM32 and has the amplitude of ±1, out of phase (the minus sign from the result) This shift of phase is utmost crucial for further use in interrupt and ADC reading

In order to shape the return voltage of PB0 into the range best optimized for STM32 to read (between 0 and 3.3V), a voltage divider form by R5 and R6 was used to offset the reference voltage at the non – inverting pin of the op – amp from – normally 0 – to 1.6V:

Thanks to the offset configuration, the amplified voltage at PB0 changes from (0 ± 1) to (1.6 ± 1)

Figure 3.7 Cosine coil amplifier schematic

The circuit for amplifier of cosine coil remains the same to the sine coil’s [Fig 3.7], using the other half of LM358P The amplified output is sent to pin PB1 of STM32

Pin 8 of the op – amp is supplied 5V from directly from LM7805’s output, whereas pin 4 is connected to GND of the same power supply

The summary of the op – amp’s connection is displayed in [Tab 3.4]

Table 3.4 Operational amplifier LM358P’s connections

Connection PB0 Feedback 1.6V GND 1.6V Feedback PB1 5V

As mentioned in chapter 2’s RTD process, a simple half – wave rectifier is used to create a square wave with the same frequency of the excitation coil to detect the falling – edge moment for interrupt [Fig 3.8]

Figure 3.8 Half – wave rectifier schematic

Figure 3.9 Excitation voltage (yellow) in compared with PA5 returned voltage (blue)

The same source of AC voltage is used as the input of the half – wave rectifier circuit Diode 1N4007 will only allow the positive value of input voltage to flow and

53 the voltage divider R1 and R2 will further decrease the voltage to the base of BJT C1815 Therefore, whenever the input voltage is positive, the BJT will connect pin PA5 of the STM32 to GND, otherwise, PA5 will have 3.3V as the returning voltage Hence, a square wave that out of phase with the excitation coil is returned to STM32 [Fig 3.9], when the excitation coil has positive voltage, the returned at PA5 will become 0V as the BJT is opened

The minus sign in formula 2.7 shifts the amplified sine/cosine voltage to 45 degrees to the excitation coil voltage Thanks to that, the rising or falling edge of the PA5 returned voltage is now at the nearly exact position for ADC reading at the peaks of sine/cosine voltage returned to PB0 and PB1 [Fig 3.10]

Figure 3.10 Amplified sine/cosine voltage in compared to PA5 returned voltage

The connection between GND of the STM32 and the other wires of the excitation coil helps the controller to have a reference point for interrupt and ADC reading.

PMSM controlling circuits

The main control circuit of the system receives the returned signals of sine/cosine voltage by PB0 and PB1 and the order from the throttle using Hall sensor powered by 3.3 VDC STM32 is powered by a voltage regulator LM7805, which

54 consumes 12VDC from an outlet adapter This component also comes along with two capacitors for filtering and smoothing 5VDC supplying to the main controller [Fig 3.11] The used pins for peripherals of the controller can be seen in [Tab 3.3]

Meanwhile, three optocouplers HCPL2631 is used for separating the control and the driver circuit, protecting the controller by using two different power sources These optocouplers are also supplied 5VDC by the driver circuit through the bus connection Each optocoupler distribute a specific phase of the PMSM’s control signals, investigating their pin number 1 and 4 (example: phase A is controlled by two pin signals PA0 and PA3, while phase B with PA1 and PA6, and phase C with PA2 and PA7)

Moreover, for each pin number 2 and 3 of the HCPL2631 is also referenced to the GND of the STM32 On the other side of the optocouplers, pin 6 and 7 deliver the flipped signals to the driver circuit using the power received from pin 6 and pin 8.

Figure 3.11 Schematic of the control circuit 3.4.2 Driver circuit

On the driver circuit, a voltage regulator LM7805 supplies the power to the optocouplers on the control circuit using 12VDC from the outlet adapter This

55 package also contains two capacitors and a LED for alerting the circuit are on

At the heart of the circuit, three IR2103 could be found [Fig 3.12] These ICs use 12VDC, and give out the control signals to the power circuit

Figure 3.12 Schematic of the driver circuit

Using IR2103 as driver for IGBT, we have total two protective layers for STM32, all using three different and separated power sources STM32 uses 5VDC from the controller circuit; the first protective layer optocoupler HCPL2631 uses 5VDC from the driver circuit; IR2103 as the second layer uses 12VDC directly from the adapter on the driver circuit; and IGBTs controlling the PMSM use their own power lines

IR2103 contributes to the control process by not allow two high side and low side IGBT of a coil to be closed at exact same time, preventing short circuit If and only both HIN and LIN̅̅̅̅̅ are at the same logic input, HO and LO will give the output drawing from the source that power IR2103

Bootstrap is used with the set – up of one diode and a capacitor This configuration charges up the capacitor whenever LO is at high logic and release it charge when HO is at high logic In that moment, the releasing current from the capacitor will help energize the coil despite the voltage at the IGBTs’ gate

Control signals from STM32 are flipped two times before they can reach the power circuit The first change in sign is through the optocouplers, and the second is through IR2103 The power circuit has three high side IGBTs and three low side IGBTs [Fig 3.13], with their gate pins are controlled by the IR2103

Figure 3.13 Schematic of the power circuit

The supply voltage comes from outlet, to a step down and filtering adapter (around 24VAC at position 1, increasing more 2V for each next positions; max 36VAC at position 7), and AC to DC rectifier with two 10A fuses Then the smooth

DC voltage is sent to the voltage and current reader and displayed on a LED screen for reference [Fig 3.14] After that, this voltage is supplied to the collector of each high side IGBT, ready to energize to coils

Figure 3.14 Step down adapter (left); AC to DC rectifier (middle); displayer (right)

IMPROVING THE PMSM PERFORMANCE

PMSM control algorithm

To obtain the control constants for the PMSM, this thesis required the assistance of Matlab The values were captured from the waveform of returned sine and cosine voltages using an oscilloscope and then transferred into an Excel file Subsequently, the gathered waveform was plotted in Matlab, and further calculations and plotting were performed to derive the control constants needed to finalize the control code This process was repeated multiple times to achieve the most optimized control result

4.1.1 Examining the outputs from the resolver

In [Fig 4.1], the rotor is rotated in such way that a full rotation of the PMSM is presented in screen It shows the amplified sine and cosine waveform were in the same voltage scale and captured in CSV file

Figure 4.1 The captured sine and cosine waveforms from oscilloscope

The waveforms then are plotted again on Matlab in the form of an Excel file with the same scale and value [Fig 4.2]

Due to the arrangement of sine and cosine coils inside the resolver (perpendicular to each other), the returned waveforms of these coils are out of phase in 90 degrees This results in when sine coil’s voltage reaches its peak, the cosine’s coil voltage approaches to 0 and vice versa [Fig 4.2]

Figure 4.2 The captured sine and cosine waveforms in Matlab 4.1.2 Plotting the tangent value of theta

Figure 4.3 Sine and cosine’s peak values

Using some set up and declarations, some peak investigating are made and connect the reading together, forming approximately a sine wave [Fig 4.3] The examining was repeated a few more times before further calculation is processed

There was still some clunky and unstable in voltage reading due to some factor of environment: the smooth rotation of rotor, start and end point of the processed data…

After plotting sine and cosine waveforms, formula 2.4 will be applied to get the tan theta values as in [Fig 4.4]

Figure 4.5 Tan theta waveform comparing to sine and cosine waveform

From the [Fig 4.5], we can see that whenever cosine value approaches to 0, tan theta value will have a change in sign and soaring up and down to infinity (relatively) This creates a challenge for choosing the correct control constants at these points due to the uncertainty of the value

Tan theta values in [Fig 4.5] then experiences the arctan algorithm in formula 2.7 to get the arctan in degree [Fig 4.6] The change in sign of position where cosine approaches 0 resetting the tendency moving upward of the arctan in degree twice a rotor’s rotation

Figure 4.6 Sine and cosine waveform comparing to arctan in degree

Optimized tan theta values offer optimizing and smooth PMSM’ rotating motion Basing on the tan theta values from the graphs, and multiple times of trials and errors, control constants used in this thesis are presented in the [Tab 3.2].

H – bridge circuit

Initially, the control system was tested by using the 50Hz outlet’s voltage source for the excitation coil and the half – wave rectifier However, this configuration was depending on the outlet source and can only operate on the frequency of 50Hz Therefore, a circuit called H – bridge circuit was used to overcome these drawbacks Using four of 4.2V 18650 batteries, this circuit can give out a nearly perfect sine wave of 100Hz that was developed using Sine PWM method

As mentioned in chapter 2, a sine wave could be generated using the two references wave as a sinusoidal waveform and a carrier waveform [Fig 4.7], with 100Hz reference sinusoidal waveform and 10KHz carrier waveform as example

Figure 4.7 Reference waveform for Sine PWM

Each cycle of the carrier waveform will then be divided into smaller samples, used for counting the number of times in which the reference sinusoidal wave is higher than the carrier wave Subsequently, the high pulse counting per carrier cycle then are normalized in into the range of ARR with 720

An array with the output normalized high pulse counting per carrier cycle in compared to reference sinusoidal waveform is displayed at the last This array will be used as CCR signal for MOSFETs to distribute the control voltage that generate the sine wave of 100Hz

[Fig 4.8] shows the graph for high and low pulse count after all the normalization are made The value of each component in the array is the main reference for the CCR output from the controller This value presents the width of the duty cycle that energize the MOSFETs For example, using the formula 2.9, we can calculate the duty cycle when CCR is 680 (maximum value):

Figure 4.8 PWM pulse counts 4.2.2 Circuit configuration and working principle

The working principle of a H – bridge circuit is to change the direction of current basing on which pairs of MOSFETs is closed Down in [Fig 4.9], two pairs of Q1, Q4 and Q2, Q3 take turn to be closed The current will flow from the batteries to the left of the coil and toward GND when Q1 and Q4 are energized In contrast, current will run from batteries to the right of the coil and return to GND as Q2 and Q3 are activated

Whichever the case, the coil still be energized depending on which pair of MOSFET is closed From that logic, Q1 and Q2 act as High side MOSFETs control the half – positive side of the sine PWM, while the opposite holds true for Q3 and Q4

The Sine PWM generating H – bridge circuit is powered by four of 4.2V 18650 Lithium – ion batteries These are used both as the source at the Drain of the MOSFETs and powering the controller STM32 using the voltage regulator LM7805

Four pins of the microcontroller PA0, PA1, PA2 and PA3 act as the PWM generators using timer feature from STM32CubeMX Referencing the CCR values extracted from the output array mentioned last section, these pins can give out the voltage signals that has a variety of different duty cycles

Two drivers IR2103 – each are equipped with their own bootstrap configuration – are center of the circuit [Fig 4.10], driving 2 pair of MOSFETs by the batteries’ voltage There are also 4 resistors that cut out the parasitic capacitance inside each MOSFETs, helping them can be re – opened fully

[Fig 4.11] has the zoomed in version of the output from the MOSFETs called filter section The configuration contains a 1:1 ratio transformer, 2 small inductors and 3 non – polarized capacitors The transformer acts as a first filter, separating two side electrically thanks to the induction and magnetic field The coils and capacitors

64 can be seen as standard lowpass filter, cutting out the high frequency voltages and spikes, while other smaller capacitors smooth out the waveform In a nutshell, an approximately sine wave could be achieved at the end of the circuit, thanks to the filters

EXPERIMENT RESULTS

Hardware products

Initially, the amplifier and half – wave rectifier circuits are made separately for trial and error [Fig 5.1]

Figure 5.1 Testing amplifier and extracting half – wave output

After achieving the appropriate returned results and components, two circuits are merged into a single board [Fig 5.2]

Figure 5.2 Merging amplifier and half – wave circuits

Down in [Fig 5.3] is the PCB schematic for the merged circuit, while [Fig 5.4] depicts the 3D view of it

Figure 5.3 Schematic of the PCB circuit

This PCB is designed to eliminate most of the parasitic capacitance between the wires, which can be done using two layers and making the distance between the wire as far as possible while the size of the circuit remains the same

Figure 5.4 3D viewpoint of the PCB board

[Fig 5.5] shows the printed PCB board on two sides with two different layers of wire Each side has its own spot for soldering on each hole, helping arranging the component more conveniently

Figure 5.5 Two sides of PCB board

The finalized version of PCB board in action can be seen in [Fig 5.6] Three separated cables are connected to the H – bridge, the resolver and controlling circuit in clockwise

There were 5 separated circuits at first, each with their own attributes and function [Fig 5.7] The circuits were connected by bus wires for easily fixing along

The H – bridge board contains the H – bridge circuit, battery pile, a dock for transformer, lowpass filters and capacitors [Fig 5.8]

Finally, all the circuits contribute to PMSM controlling are stacked using brass hexagonal as the pillars [Fig 5.9] The assembly has 4 layers, adding the neatness to the overall system

Figure 5.9 Assembling the functioning circuits

The PMSM – as the MG1 on Toyota Prius [Fig 5.10]

Control results

Figure 5.11 Sine output from the resolver, before and after

[Fig 5.11] describes the returned sine wave of the resolver (yellow) and it’s amplified version through op – amp (blue) Basing on the reading from oscilloscope, the amplitude of the signal was at 100mV The signal after amplified turned into 1V in amplitude and was offset to 1.6V

Figure 5.12 Returned sine and cosine waveforms

Due to the arrangement of the sine and cosine coils from the resolver, the

71 returned voltages of these two coils are also out of phase to each other This results as the rotor rotates, returned sine voltage will reach maximum as cosine voltage approaches 0 and vice versa

Figure 5.13 Excitation coil and PA5 returned waveform at 50Hz

The excitation coil voltage waveform and the PA5 waveform are in opposite phase [Fig 5.13] basing on the configuration of the BJT and the diode in half – wave rectifier as mentioned in chapter 3

Figure 5.14 Returned sine waveform in comparing to PA5 output

Thanks to both the amplifier and half – wave rectifier, as the rotor rotates, the falling – edge interrupt can help the controller to read the ADC value of sine and

72 cosine coil at the peaks for tantheta calculation

Figure 5.15 H – bridge sine PWM output

Sine PWM output could be seen in [Fig 5.15] This waveform may look as digital but in its essence is a sine wave The high and low side MOSFETs take turn to change the transformer’s current direction and a nearly pure sine wave is formed

Figure 5.16 Excitation coil and PA5 returned waveform at 100Hz

[Fig 5.16] describes the excitation coil’s input and the returned waveform at the PA5 pin as the H – bridge circuit took the original transformer’s place The H – bridge give out a sine wave at 100Hz, further increase the number of ADC reading for enhance the speed of the PMSM twice faster

As the rotor rotates, sine and cosine values are changed consecutively Hence, the control signals from the controller are also varied with time The control signals using the controller’s voltage while optocouplers use their own power supply from the driver circuit

Figure 5.17 A0 output (yellow) in comparing to optocoupler’s output (blue)

Moreover, the feature of the optocouplers also make them producing the outputs that are in opposite phase with the inputs [Fig 5.17]

Figure 5.18 IR2103 control signals to IGBTs’ Gates

Two Gate’s control waveforms of both high and low side IGBT from the same phase A are depicts in [Fig 5.18] Driver IR2103 delivers control signals to each IGBT’s Gate using their own power supply of 12V and making sure the two Gate could not be opened at the same time The waveform of the high side IGBT (yellow) is also in opposite phase of the low side IGBT’s (blue).

CONCLUSION AND RECOMMENDATIONS

General evaluation

In general, the system gave out quite substantial results after research Merging all the components, circuits and rotating the throttle made the PMSM to turn Initially, the PMSM can only worked on the frequency of 50Hz supplied to the excitation coil Furthermore, the rotation of the rotor was not evenly and there were some positions that the control signals could not worked efficiently (cosine approaches to 0) Throughout some plotting and control constants tuning, the rotor is now less stalling when comes to those positions

On the other side, the introducing of the H – bridge circuit also helped making the speed of the rotor twice faster This could be achieved by doubling the frequency to the excitation coil to 100Hz, which led to more ADC values could be read during the operation of the PMSM

The time spent on the laboratory also brought plenty of valuable experience Knowledge about microcontroller, working with datasheets, gathering the information from the oscilloscope, soldering, PCB designing, and troubleshooting were among the key skills honed during the project Working hands – on with the PMSM could even deepening the understanding of motor control principles, creating the base for the preparation of further control techniques.

Improving possibilities

Although the system can still make out a rotation from the PMSM, speed control on different levels was not the main point of this thesis, the role of the throttle was not more than a normal switch: to tell the system to work Therefore, changing the speed of the PMSM could be a topic for further research One way to done the trick could be achieved by altering the PWM signals supplying to the Gate of IGBTs

Six – step commutation is just one of many techniques for controlling PMSM

In fact, this technique has some issues that could not be dealt optimally In the list of PMSM control techniques [Tab 8], using vector control technique might solve the problems encountered that six – step commutation got: torque ripples These ripples could reduce the control efforts and mess up with the returned signals from the resolver In conclusion, each control technique has its own strengths and weaknesses, whichever the one, suitable technique can be chosen depending on the purposes and resources of the project and the system

[1] L.Đ.Thịnh, N.Đ.Thịnh, T.V.Khoa (2021), “Backstepping based speed control of permanent magnet motors with high – gain disturbance observer”, Tạp chí Nghiên cứu khoa học, Trường Đại học Sao Đỏ, ISSN 1859 – 4190, Số 2 (73) 2021

[2] N.B.Thanh, N.N.Tuấn (2023), “Sliding mode controller based on fuzzy logic for pmsm servo system with uncertain disturbance”, Tạp chí Khoa học và Công nghệ,

[3] P.V.Cường, H.V.Huy (2020), “Synthesizing the speed controller of permanent magnet synchronous electrical motor with the blower load using adaptive sliding control”, Tạp chí Khoa học và Công nghệ, Tập 58 - Số 3 (6/2022)

[4] Bida, V M., Samokhvalov, D V., & Al – Mahturi, F S (2018), “PMSM vector control techniques — A survey”, 2018 IEEE Conference of Russian Young Researchers in Electrical and Electronic Engineering (EIConRus)

[5] Hafid, B.A., Said, Z., Youssef, C., Youssef, E.H., & Abdelkarim, D (2022),

“Permanent Magnet Synchronous Motor PMSM Control by Combining Vector and

PI Controller”, WSEAS Transactions on Systems and Control, E – ISSN: 2224-2856,

[6] Ren, N., Fan, L., & Zhang, Z (2021), “Sensor – less PMSM Control with Sliding

Mode Observer Based on Sigmoid Function”, Journal of Electrical Engineering &

[7] Hou, Q., & Ding, S (2020), “GPIO Based Super-twisting Sliding Mode Control for PMSM”, IEEE Transactions on Circuits and Systems II: Express Briefs, 1 – 1

[8] Engineering Solutions, “About motors”, https://about-motors.com/motorcontrol/, (accessed Apr 5, 2024)

[9] Mitch Olszewski (2008), “Evaluation of the 2007 Toyota Camry Hybrid synergy drive system”, Oak Ridge National Laboratory, U.S Department of Energy, January

[10] Martin Staebler, Ankur Verma (2017), “TMS320F240 DSP Solution for

Obtaining Resolver Angular Position and Speed”, Texas Instruments Incorporated,

[11] Nicolas Aupetit (2018), “An5161 – signal conditioning for resolver”,

[12] EETech Media, “EE Reference, Lessons in Electric Circuits”, https://www.allaboutcircuits.com/textbook/, (accessed Apr 7, 2024)

[13] STMicroelectronics (2023), “STM32F103x8, STM32F103xB, Datasheet – production data”, STMicroelectronics, DS5319 Rev 19, September 2023

[14] Tiger Electronic Co., LTD, “LM7805, Product specification”, Tiger Electronic Co., LTD

[15] STMicroelectronics (2003), “LM358, A, Low power dual operational amplifiers”, STMicroelectronics, July 2003

[16] Electronics Tutorials, “Operational Amplifiers”, https://www.electronics- tutorials.ws/opamp/opamp_3.html, (accessed Apr 12, 2024)

[17] QT Optoelectronics (1999), “High speed – 10 Mbit/s, Logic gate optocouplers”,

[18] International Rectifier, “IR2103(S), Product Summary”, International Rectifier

[19] Austin Hughes (2006), “Electric Motors and Drives; Fundamentals, Types and

Applications; Third Edition”, Newnes, Elsevier Ltd., Linacre House, Jordan Hill,

[20] Fairchild Semiconductor Corporation (2002), “KSC1815, Audio Frequency Amplifier & High Frequency OSC”, Fairchild Semiconductor Corporation, Rev A2,

[21] Unisonic Technologies Co., LTD (2012), “20N60, Power MOSFET”, Unisonic Technologies Co., LTD, QW – R502 – 587 E, 2012

[22] Infineon (2019), “Resonant Switching Series, Reverse conducting IGBT with monolithic body diode, IHW20N120R3, Data sheet”, Infineon Technologies AG,

[23] STM32 MCU (2023), “Getting started with STM32 system peripherals”, https://wiki.st.com/stm32mcu/wiki/Category:Getting_started_with_STM32_system_peripherals, (accessed May 07, 2024)

Please scan the below QR code for the used codes in this thesis:

Ngày đăng: 26/09/2024, 10:38