Application of PSoC Microprocessor in the Controller of Electric Vehicle Brushless Motor

Application of PSoC Microprocessor in the Controller of Electric Vehicle Brushless Motor

As a new type of transportation tool, electric vehicles have been really accepted by the people. Especially in the current skyrocketing oil prices, limited issuance of motorcycle licenses, and the dream of cars is beyond expectation, electric vehicles are becoming more and more popular. In such a "biking kingdom" in China, the market space for electric vehicles is worth looking forward to. Industry insiders predict that in the next few years, the capacity of electric vehicles is almost equivalent to the market capacity of bicycles. At least 300 million of the 450 million bicycle users in the country will become users of electric vehicles. As the electric vehicle market matures, brushless motor electric vehicles gradually occupy more than 80% of the market share, and brushless motor controllers are also loved by the majority of users in continuous technological progress, and will continue to introduce new products to enrich Function to adapt to changes in the market.

The PSoC microprocessor is a field-programmable system-on-chip launched by Cypress Semiconductor Corporation. There are general analog and digital modules in the chip, users can call the modules at will according to the development needs, and realize the dynamic configuration of the mixed signal array. Taking CY8C24423 as an example, the article introduces the application of PSoC on the brushless motor controller of electric vehicles. It integrates the functions of voltage and current signal amplification, processing, analog-to-digital conversion, and PWM signal output into the microprocessor. , Reduce the peripheral devices of the chip, improve the overall integration performance and reliability of the system.

Programmable system on chip

Adopted and launched by Cypress Semiconductor Corporation of the United States is based on the universal IP module, which is composed of programmable options to form the product SoC, and promotes the development of single-chip microcomputers from MCU to a new stage of SoC. This programmable SoC is named Programmable System-on-Chip (PSoC) and consists of a basic CPU core and preset peripheral devices. It is a PSoC module (configurable analog and digital peripherals) integrated in and around a proprietary MCU Device array), using the chip's internal programmable interconnect array, the chip's analog and digital circuit resources can be effectively configured to achieve the purpose of a programmable system-on-chip.

Compared with the traditional MCU, in the fundamental sense, the PSoC series is a kind of microcontroller and a programmable system-on-chip microcontroller. Its emergence has made designers gradually get rid of the board-level electronic system design method level. Entering the design of chip-level electronic systems has reduced the variety and specifications of single-chip microcomputers, and is more conducive to the development and upgrading of new products. Compared with ordinary single-chip microcomputers of the same price, its rich internal resources, novel design interface, flexible design methods, and simple programming skills all make it very unique. PSoC is completely different from the traditional microprocessor in the past. PSoC developers do not need to build ADCs, DACs, and other peripherals by themselves, they can allocate resources through PSoC configurability, and PSoC successfully introduces dynamic reconfigurable functions for the controller to truly achieve online programming PSoC microcontrollers can replace many types of microcontrollers.

PSoC internal block diagram structure and resources

Cypress CY8C21 × × ~ 29 × × × series internal structure shown in Figure 1. Its resources include:



Figure 1: Block diagram of internal system resources in CY8C24423.

Processor core

The PSoC microprocessor CY8C21 ××× ~ 29 ××× series devices use a powerful 8-bit Harvard processor core (M8C CPU), which has independent program memory and data memory bus, and the processor speed can reach 24MHz. Has rich M8C architecture instructions, and can perform operations on I / O and memory. In addition, the system provides a convenient addressing method.

The CPU core has a perfect fast multiply-add capability, and all processors in the PSoC series have a multiplier / adder (MAC). As an independent component in the MAC system, and mapped to a specific register address space, the input register and output register can perform signed 8 × 8 multiplication and 32-bit addition. As long as the data is transferred to the input register in the next instruction cycle, the operation result can be obtained in the output register. Registers accelerate memory data exchange and greatly increase the speed of data processing.

2. Internal memory

PSoC series devices have flexible on-chip memory, including 4 ~ 16KB of fast program memory (Flash Program Memory) and 256 bytes of on-chip SRAM data memory, fast memory can be written and erased 100,000 times, and can be modified in real time in blocks The size of the chip flash memory is different. In addition, the system has a serial programming function (ISSP), that is, the flash memory on the program header or the user board can solidify the program into the internal program flash memory in a serial manner. PSoC provides multiple protection encryption methods for on-chip memory. To ensure the safety of users' sensitive information. This function allows the user to selectively lock and protect the read and write operations of the memory module. This allows part of the code to be upgraded without revealing important data.

3. PSoC module

There are several PSoC digital modules in each PSoC chip. The digital modules within the PSoC chip reduce the need for multiple microcontroller types and peripheral components. Digital PSoC module can be configured into various user modules, such as time timer, real-time clock, pulse width modulation (PWM) and dead-band pulse width modulation (DB PWM), cyclic redundancy check module, full duplex (UARTS) ), Serial master-slave communication (SPI) function. The PSoC software development kit provides automatic configuration of the PSoC module. The user simply selects the required function block, and the PSoC software development kit can generate the correct configuration information and device data sheet.

There are also several analog PSoC modules in each PSoC chip. The analog PSoC modules in the chip can reduce the complicated serial number of the CPU and the requirement of peripherals. The analog PSoC module can be configured with many peripheral functions, for example, 12 PSoC modules can provide 11-bit delta-sigma analog-to-digital conversion, 8-bit successive approximation analog-to-digital conversion, 8-bit direct analog-to-digital conversion, 12 incremental analog-to-digital conversion, Programmable gain amplifier, sample and hold function, programmable filter, differential comparator and on-chip temperature sensor, etc. The PSoC system contains three types of analog modules: continuous clock module (CT), type A and type B switched capacitor (SC) modules.

4. General I / O

The number of general-purpose I / O for PSoC microcontrollers varies from * 4 bits, depending on the model. Each I / O function is programmable. The output drive mode can be selected in the output mode, and the analog output drive can reach 40mA. Through the internal pull-up or pull-down resistor output, strong output, the maximum output drive current can be set to 25mA. All pins can be used as an interrupt power supply, and an interrupt is generated by the change of the pin signal. And can choose the bit rising edge trigger terminal, falling edge trigger. The pin can be connected to the analog module. In addition, there are TTL and I / O used as Schmitt triggers.

5. Oscillator

PSoC series devices have a variety of oscillators to choose from, and can always find a suitable oscillator for the clock of the CPU clock, analog PSoC module, and digital PSoC module. There are mainly internal oscillators up to 24 / 48MHz, a 32.768MHz external crystal oscillator and an internal low-speed oscillator. The main oscillator error is ± 2.5%, and there is no external compensation. The external crystal oscillator can select the accuracy of the PLL. The internal low-speed oscillator is generally used as the clock for the PSoC module and the watchdog / sleep timer. A clock divider can be used to optimize code execution speed and reduce power consumption.

6. Dedicated peripherals

PSoC series devices also provide some special peripherals, including watchdog / sleep mode clock (Watchdog / Sleep TImer), power threshold low voltage detection (LVD / POR), interrupt controller, sampling decimator ( Decimator), on-chip temperature sensor and on-chip voltage reference, etc.

7. Static COMS device

The PSoC microprocessor series uses a fully static CMOS device with advanced Flash technology to achieve a highly low-voltage function. Normally the voltage is maintained at 3.0 to 5.5V DC. Using on-chip switching voltage mercury can reduce the operating voltage to 1.0V DC and work at -40 ℃ ~ + 85 ℃.

Brushless controller system for electric vehicles

The block diagram of the electric vehicle brushless controller system composed of CY8C24423 is shown in Figure 2.



Figure 2: Functional block diagram of the electric vehicle brushless controller system.

To rotate the motor shown in the figure, the control part must first determine the sequence of turning on (or turning off) the MOSFET according to the current position of the motor rotor sensed by the motor hall, as shown in A, B, and C up (these are called upper bridge power transistors) and A down, B down, and C down (these are called down bridge power transistors), so that the current flows in sequence through the motor winding coils to generate a forward (or reverse) rotating magnetic field Interacting with the magnet of the rotor, so that the motor can rotate clockwise / counterclockwise. When the motor rotor rotates to the position where the Hall sensor senses another group of signals, the controller turns on the next group of MOSFETs, so that the circulating motor can continue to rotate in the same direction until the controller decides to stop the motor rotor. Then turn off the MOSFET, if the motor rotor is reversed, the MOSFET is turned on in the reverse order.

A basic brushless motor controller for electric vehicles needs to implement functions including, in addition to the speed regulation of the handlebar, it should also include undervoltage protection, overcurrent protection, and brake power off. In addition, in recent years, there are some practical and popular functions such as fixed speed cruise, ABS brake regenerative braking, 1: 1 power assist and so on. It can be clearly seen from the above principle block diagram that the entire system uses only one PSoC chip to realize all the above control functions. Figure 3 is the physical diagram of the semi-finished product of the brushless controller designed in this paper.



Figure 3: The physical appearance of the semi-finished product of the electric vehicle brushless motor controller.

In addition to the above functions, this system uses the powerful and flexible configuration resources of the PSoC chip, and also has the following advantages that ordinary controllers do not have:

1. Ultra-quiet: extremely low noise during start-up and driving, which greatly surpasses the traditional brushless controller, reduces motor vibration, and greatly extends the life of the motor;

2. Low heat generation: The use of international advanced synchronous rectification technology greatly reduces the heat loss of the controller, improves the energy efficiency of the vehicle, and extends the driving range;

3. Multiple current limit protection: both average current limit and peak current limit. The peak current limit detects the current waveform in each PWM cycle to prevent exceeding the maximum allowable current of the MOSFET and will not burn down under any circumstances;

4. Average value: The current limit enables the controller to maintain the same current limit value on various motors, and the current limit value does not change under light and heavy loads, even under locked-rotation conditions. This greatly facilitates production commissioning and OEM inspection;

5. Anti-speeding function: solves the speeding phenomenon caused by the handle or line fault of the brushless controller, and improves the safety of the system;

6. Stall protection function: the motor is blocked for more than 3 seconds, and the controller automatically protects it to prevent burning the motor;

7. Short-circuit protection function: the output terminals of the three phase wires of the motor are short-circuited at any two ends or all three-terminals are short-circuited, and the controller will not be burned.

The above functions do not increase the hardware cost. The PSoC programmable on-chip system minimizes the peripheral devices. Most functions are completed by the chip, which greatly reduces the hardware cost and reduces the point of failure. The pin and function of the SoC chip used in this system are shown in Figure 4.



Figure 4. CY8C24423 pin definition illustration in this system.

The internal module structure of the chip is shown in Figure 5.



Figure 5: An illustration of the internal modules of PSoC used in this system.

As can be seen from Figure 5, this system uses a total of 7 types of PSoC internal modules, including analog modules including AD converter ADCINC_1, programmable amplifier PGA_1, comparator CMPPRG_1, four analog switches AMUX4_1, digital-to-analog converter DAC6_1. Digital modules include AD converter ADCINC_1, 8-bit PWM module with dead zone PWMDB8_1, 8-bit timer module TImer8_1. This makes good use of the internal resources of CY8C24423, and also saves a lot of peripheral chips that would otherwise be used outside the chip.

The control software flow of this system is shown in Figure 6.



Figure 6: Basic flow of control software.

Since the PSoC development system PSoC Designer supports C language programming and is equipped with a powerful C language compiler, the main program is written in C language, which is simple, intuitive, and portable.

Summary of this article

Through the electric vehicle brushless motor controller system introduced in this article, you can get a glimpse of the powerful configurable functions of the PSoC chip. Configuring the connection inside the chip is like designing a new chip. The entire system uses very few components and has a huge cost advantage over other brushless controller solutions.

PSoC's convenient and fast design interface, object-oriented design and development system, and the modularity and dynamic configurability of mixed signal arrays make it a more flexible design method in embedded system applications, allowing designers to create new ones at will System functions. Using PSoC can quickly and easily complete the development of the corresponding program, shorten the product development cycle, reduce development costs and production costs. Through the integrated application and dynamic configuration of the programmable mixed signal array of the system on chip, the working efficiency is greatly improved, the development cost is reduced by 1/2, the board space of the PCB is reduced by l / 3, and the production cost is reduced by 1/5 .

LED Outdoor Lighting is the name of the lighting is exposed in the outdoor lighting. Usually with the surrounding roads, landscapes, buildings combined lighting design and installation, so as to achieve its functional and artistic unity.

LED Outdoor lighting, including street lamp, wall lamp, road lights, landscape lights (Chinese lights, fireworks lights, cherry lights, etc.), lawn (stainless steel grass lamp), buried lights, wall lights, outdoor spotlights, Wall lights and so on.


Many domestic residential use of led outdoor lighting (according to tree lights, lights, etc.) are 220V high-pressure lights, in the event of leakage or damage is easy to hurt people, with the relative in foreign countries have been thoughtful in this regard, most of the led outdoor lightings through the transformer buck, to control it within the human safety voltage, so as to ensure safety.

In addition, some Outdoor LED Garden Light appropriate use of glass products, some people think that glass is also outdoor lighting safety instability in one of the factors, but experts believe that good quality glass (especially special glass) even if the damage to people's damage is also very Small, if the developers can focus on the use of building materials, willing to use the cost of good materials, can greatly improve the safety factor.
outdoor led lighting

LED Outdoor Lighting

LED Outdoor Lighting,Energy Saving LED Outdoor Lighting,Waterproof LED Outdoor Lighting

Shenzhen Mingxue Optoelectronics CO.,Ltd , https://www.led-lamp-china.com