Golf-Cars Golf Trolleys Mobility Scooters Electric Bicycles Street Sweepers Life Style "NEV&LSEV"
You are here: Home > electric golf buggy > PSoC-based controller design for electric bicycle
 
PSoC-based controller design for electric bicycle
2012-01-03 by seoer1

Cypress Semiconductor's PSoC is a 8-bit MCU core, and digital and analog mixed-signal programmable system on a chip array. Programmability of PSoC with all three in one, not only with MCU, programmable capabilities, but also contains some of the programmable logic functions, but also provides a programmable analog array; through the register configuration or control, among can interact and coordinate the work. PSoC's digital resources (such as timers, PWM, UART, etc.) and analog resources (such as amplifiers, comparators, filters, etc.) to digital modules and analog modules give way. Different models of PSoC chip with the difference mainly lies in the number of modules and the number of different analog modules. Users can define specific requirements of these modules. PSoC Designer integrated development environment for the user is also a pre-defined 70 commonly used digital and analog resources for the user to select. These predefined module called user modules, such as digital resources: timers, PWM, UART, SPI, CRC, PRS, etc.; simulation resources amplifiers, comparators, filters, etc.; ADC from several figures combination of modules and analog modules. PSoC developers need to build them by setting the register peripherals, just in PSoC Designer, select and place the required user module and set parameters. PSoC Designer can not only configure the user module, but also to provide these user module API function calls for user programming.

CY8C24533 is specifically for motor control and the development of a PSoC chip. It inherited the CY8C24XXXA series chips almost all of the resources, while for the motor control part of the expanded resources and capabilities, making it suitable for use in the control of Electric Bikes and other motor control.

CY8C24533 system resources and the surrounding properties

CY8C24533's internal structure shown in Figure 1. The resources include:

newmaker.com
Figure 1: CY8C24533 internal block diagram of system resources
System resources

CY8C24533 use 8-bit Harvard architecture processor core (M8C CPU), it has separate program memory and data memory bus, the processor speeds up to 24MHz. M8C architecture has a rich command, the system provides a convenient way of addressing. CY8C24533 of system resources, including a multiply accumulate (MAC). MAC system as a separate component, and mapped to a specific register address space, the input register and output register, can perform 8 × 8 signed 32-bit multiplication and addition operations. As long as the data sent to the input register, the next instruction cycle, the output register will be able to get the results of operations. Register memory speed data exchange, greatly improving the data processing speed. CY8C24533 has two clock generators: low-frequency master clock generator and clock generator. Which is 24MHz master clock generator as the system clock can be divided into frequency or no frequency as the CPU clock. System clock N1, N2 and N3 times (can be set by the user) generated by the clock frequency VC1, VC2 and V3 can be provided to the user as analog and digital PSoC PSoC block clock input module. System clock can generate 48MHz clock frequency as the PWM input to improve the PWM resolution. 32KHz frequency clock generator is a low-speed internal oscillator is mainly used for watchdog / sleep timer clock. Other system resources can also set the threshold voltage of the power low-voltage detection (LVD / POR), interrupt controller, I2C, for △-Σ ADC sample extractor (Decimator), on-chip temperature sensor and on-chip voltage reference and so on.

On-chip memory

CY8C24533 has 8KB of flash memory for program storage and 256B on-chip SRAM data memory. Portion of the space can be simulated flash E2PROM. In addition, it has a serial in-system programming feature (ISSP). CY8C24533 chip memory to provide a variety of encryption protection. Encrypted with the traditional fuse protection in different ways, CY8C24533 is a block encryption methods to implement encryption on-chip memory protection, and therefore have a higher security.

Module Resources

CY8C24533 has 4 digital modules and 4 analog modules. Chip digital modules can be configured into a variety of user modules, such as timer, real-time clock, pulse width modulation and pulse width modulation dead (DB PWM), cyclic redundancy proofing module, full-duplex UART, SPI other functional modules. On-chip analog module can be configured to simulate a variety of peripheral functions, such as comparators, programmable gain amplifier, differential amplifier, a programmable filter. Combination of digital and analog modules can implement a variety of analog-digital conversion, such as 14-bit incremental ADC, 8 and 11 of the △-Σ analog-digital conversion, and so on. PSoC Designer integrated development environment provides users a flexible and comprehensive digital and analog input and output routing module, routing module and between modules and digital modules and analog modules routing. These routes are also included in some of the hardware logic operation block (LUT), the logical block can be 16 kinds of logical operations. Users can route selection and routing logic operations between the module and module correlation between the organic functional blocks, these blocks have a more complex and more powerful unique features. Thereby reducing the use of chip resources, make the system more compact.

newmaker.com
Figure 2: Block diagram of synchronous triggering
SAR ADC module

In motor control typically requires a high-speed ADC is used to detect over-current signal and then implementation of the power MOS protection. CY8C24533 incorporates a dedicated 8-bit successive approximation ADC. It's a conversion time of only 3.33μs, which for fast over-current detection signal is very useful. In addition to the time at the right analog to digital conversion, CY8C24533 also offers a variety of ways to start the trigger analog-digital conversion. It includes the freedom to run, manual trigger and synchronize a single trigger. Synchronization trigger block diagram shown in Figure 2. There are two ways in the synchronous triggering pathway (Low Path and High Path) can be implemented trigger. These two pathways were 8-bit registers and a number of modules from a comparison of the count, if the Low Path of the comparison results equal CMP_LO output high, if the High Path of the comparison results equal CMP_HI output high , CMP_LO and CMP_HI the output path logic (Path Logic) logic operation, logic operation result is 1 when they start the analog-digital conversion is triggered. Access logic with "and" and "or" two kinds of logic functions, CMP_LO and CMP_HI the value set by the user. The performance of the motor control is very useful. For example, when DBB0 be configured as an 8-bit PWM, in a PWM cycle, ADC can be triggered once or twice. When CMP_LO or CMP_HI register a set, and the logical channel set up "or" operator is triggered when a; when CMP_LO and CMP_HI register is set and the same logical channel set up "and" operator is triggered when a; when CMP_LO and CMP_HI register is set and not the same as the logical channel set up "or" operator is triggered when two. When DBB0 and DBB1 is configured as a 16-bit PWM, a PWM period, the analog-digital conversion can be triggered once, when the logical channel set up "and" operator. In the DC brushless motor control, motor control PWM value is usually voltage or speed, each PWM cycle phase current size is changing, with a simultaneous trigger in each PWM cycle time trigger mode fixed digital conversion, sampling the motor current signal, to determine whether the current is abnormal, the motor and the implementation of effective protection of the MOS tube.

Electric bikes controller system

Figure 3 shows a block diagram of electric bicycle controller system. The figure, CY8C24533 as the master chip, on the left for a variety of input signals: the signal transfer speed, brake signal, battery voltage, motor and other peripheral signals Hall signal. The right is the MOSFET driver circuit, three-phase power MOSFET bridge circuit and battery display circuit. Electric bikes are now using the "brushless DC motor" as transmission parts, so CY8C24533 Hall from the motor must generate the appropriate signal phase sequence signal to the MOSFET driver circuit, which in turn drives three-phase power MOSFET bridge, so no brush DC motor according to certain rules to be three-phase winding excitation current changes.

newmaker.com
Figure 3: Block diagram of electric golf buggy controller system
PWM output

In order to control through the speed control switch to the speed, the PWM signal must be superimposed on the phase sequence signal, by adjusting the PWM duty cycle to control the motor winding phase voltage and current to achieve speed control. Typically the MCU PWM output pin is the output from the fixed, so the traditional MCU approach is to increase the chip's logic to the external 6-channel or 3-phase signal and the PWM signal phase sequence "and" output. The CY8C24533 PSoC chip module with flexible input and output routing resources to choose from, all the way to the PWM signal can be at different times or simultaneously routed to a route to multiple I / O on. Figure 4 shows a digital module configured as a dual buffers, PWM signal output with a double buffer in the buffer LUT put the PWM signal is routed to four output, and then routed through the digital output bus to one or multiple I / O on. So that a phase commutation and when required, or several phase PWM output can be obtained through the commutation interrupt routine will switch to the corresponding PWM output I / O port. I / O port output can be directly input to the MOS tube drive circuit, it does not need additional external logic. Figure 5 is in PSoC Designer development environment of the PWM output routing configuration diagram.

newmaker.com
Figure 4: PWM comparator output routing and output routing map

newmaker.com
Figure 5: PWM output routing configuration diagram
Peak current protection

Electric bicycle in the course will lead to a variety of possible instantaneous peak current is large, the current MOS tube if more than the maximum tolerated current, MOS tube will be breakdown. Therefore, the peak current protection is necessary. Peak current protection is the key to the response speed. Commonly used way to implement the hardware, such as the current sample compared to a comparator, the comparator output and through logic circuit and the PWM input signal "and." Included in the CY8C24533 chip analog modules, CT (continuous clock) for analog modules can be programmed and programmable comparator amplifier. We make the CT module amplifier for amplifying the current signal, and the other CT modules for comparator for comparing the current signal, the comparator threshold can be setup. The output of the amplifier output as a comparator, the comparator output to more buses, more bus through the LUT input to the digital module in the double buffer to another buffer, the buffer output via the output bus line and the PWM signal to achieve the LUT "and" operation (see Figure 4 or Figure 5). If the peak current exceeds a set threshold, the comparator output will shut the PWM output, the MOS implementation of effective protection.

Average current protection

Average current protection to protect motor and MOSFET is very important, especially in the stall. Because of long high temperature, which results in blocking the transfer or MOSFET motor burned. CY8C24533 high-speed successive-approximation ADC, so you can use the synchronous triggering of each PWM cycle, the current value of fixed sampling time to obtain the average current. If this value exceeds a set threshold value and a period of time (such as 3s and above), the controller automatically protection software that will take the appropriate measures, such as reducing or off the PWM output PWM, the motor and MOSFET to implement effective protection .

1:1 power

CY8C24533 with digital timer module can be used to capture, capture the pedal shaft speed signal, received signal power analog 1:1, then the output of the PWM control, power analog 1:1 or 1: N control. As the CY8C24533's flash memory up to 8KB, the program allows users to design multiple functions and protection. Based on PSoC CY8C24533 controller also includes an electric bike ultra-quiet, anti-Speed ​​function, short-circuit protection, undervoltage protection, cruise control, ABS brakes regenerative braking and other functions. Ultra-quiet function reduces the noise started; anti Brushless Speed ​​Controller function to solve or line failure due to switch to the phenomenon caused by Speed, improve system security; short circuit protection to prevent motor three phase short circuit across the output of any full short circuit or three-terminal, and the controller does not burn; voltage battery protection feature allows the user to replace the battery when timely notice. Cruise control, ABS brakes so more perfect performance of the controller.

Conclusion

PSoC CY8C24533-based controller for electric bicycle, the use of its analog, digital and routing resources to make the whole system with a single PSoC chip will achieve all of these control functions, so without any external chip, the number of external components are reduced accordingly. This fully embodies the advantages of SoC, while the chip's resources have been fully and effectively utilized. As the CY8C24533's analog, digital and programmable routing resources are, it gives design engineers more wisdom and creative expression, but also the performance of the controller of electric bicycles to get more improved.

   keywords:electric golf buggy
Copyright © 2009-2018 Zhejiang Repow (RIPU) Electric Scooters Co. Ltd. All Rights Reserved.