1. Introduction
At present, domestic excitation power cabinets generally have problems such as incomplete detection functions, backward information transmission technology, control and detection technology. In order to solve this problem, this paper presents a communication method between the intelligent excitation power cabinet and the CAN bus by using the highly integrated single-chip microcomputer C8051F060. This solution has complete detection, control and communication functions.
2 Characteristics of the C8051F060 single-chip microcomputer
The C8051FXX series microcontroller is a microcontroller launched by the American company CYGNAL that is compatible with the 51 series microcontroller core. Based on my experience with the C8051F060, I will introduce its new features:
(1) The core adopts a pipeline structure with a speed of up to 25 MIPS (25 MHz crystal oscillator), which is 10 times faster than ordinary 51 microcontrollers; its instructions are compatible with the standard series 51 microcontrollers, so it is very easy to master the development process; the chip's JTAG debugging mode supports in-system, full-speed, non-insertion debugging and programming, and does not occupy on-chip resources.
(2) The chip integrates 64kB Flash, 4352B internal RAM (256+4kB, which can be expanded to 64kB), 59 I/O ports, 2-channel 16-bit 1MSPS programmable gain ADC, 8-channel 10-bit 200kSPS programmable gain ADC, 2-way 12-bit DAC, 3-way analog comparator, internal voltage reference, and on-chip power supply monitoring, voltage drop detection and watchdog functions. Due to the high integration of C8051F060, there is no need to expand ROM, RAM, AD, DA, watchdog, programmable I/O port and EEPROM (implemented by on-chip Flash), which greatly simplifies the hardware circuit and creates conditions for the construction of a single-chip microcomputer system with C8051F060 as the core, while also improving the reliability of the system.
(3) Two UARTs, one SM (compatible with I2C) and one SPI are integrated in the chip. The most convenient thing is that C8051F060 integrates a CAN bus controller, which makes the CAN bus have the characteristics of low development cost, strong anti-interference, and applicable to industrial field applications. It can be widely used in various industrial field measurement and control fields with very serious interference environments. C8051F060 only needs to add a CAN bus transceiver circuit to connect to the CAN communication network, which greatly simplifies the design of the communication system and reduces the probability of communication nodes being interfered with.
(4) Programmable 16-bit Counter Array (PCA) has six capture/compare modules and five general-purpose 16-bit counter/timers, which provides convenience for timers/counters with more measurement and control nodes.
(5) C8051F060 can meet the requirements of most industrial measurement and control nodes, and can form a single-chip microcomputer system with C8051F060 as the core. If it is equipped with a peripheral measurement unit, it can also form a complete measurement and control node.
3 System structure of intelligent excitation power cabinet
The principle block diagram of the intelligent power cabinet system is shown in Figure 1. The most critical component in the power cabinet is the three-phase fully controlled bridge. The core parameter for controlling this bridge is the trigger angle, which can be sent by the CAN bus through the regulator and sent to the current value that the local cabinet should send. The output current obtained by detection is compared with the given current that the regulator should send and the PI operation is completed to generate a new fine-tuning trigger angle. The trigger angle forms a trigger pulse through the PCA and then drives the three-phase fully controlled bridge, thereby achieving current sharing between cabinets. At the same time, the temperature in the cabinet, the on-off state of the thyristor, and the output current value can also be sent to the microcontroller through the signal detection module to calculate and analyze each parameter, and compare it with the set threshold value. Finally, the measurement results are displayed in real time and an alarm is issued at the same time.
Figure 3 Synchronous signal acquisition circuit
3.1 Digital phase shift trigger based on PCA module
The working principle of the three-phase thyristor fully controlled bridge and the phase sequence relationship of the trigger pulses of the six thyristors are shown in Figure 2.
The PCA contains 6 capture/compare modules based on the same 16-bit counter and can be used as time base. Each module can be configured in 6 modes: positive edge capture, negative edge capture, positive and negative edge capture, software timer, high-speed output, pulse width modulator, etc. The high-speed output mode is used in this design. When the PCA counter matches the 16-bit capture/compare register of the module, the logic level of the CEX pin of the corresponding module will change and cause a corresponding interrupt.
The trigger signal starts timing from the zero crossing point of the synchronization signal, and the regulator sends the electrical angle value α of the trigger angle, the synchronization signal period value TSYN and the pulse width W to each power cabinet through the CAN network. The synchronization signal sampling circuit is shown in Figure 3. When the synchronization signal crosses zero and generates an interrupt, the PCA counter starts counting, and calculates the corresponding values of α Tα1~Tα6 and the corresponding values of the pulse trailing edge TW1~TW6 according to α, W, TSYN and the PCA counting frequency, and then writes Tα1~Tα6 into the 16-bit capture/compare registers of the six modules. When the value of the capture register matches the value of the PCA counter, the CEX pin will become a high level to cause the corresponding module to generate an interrupt. At the same time, in the interrupt subroutine, the corresponding TWN is written into the 16-bit capture/compare register. When it matches the PCA counter value, the CEX pin becomes a low level, and one of the channels triggers a single pulse. The six single pulses can be combined into six double narrow pulses using a gate circuit. The following formula is the calculation method of Tα and TW:
TαN=TSYNα+90N-1 /360TCLK
TWN=TSENa+++90N-1 /360TCLK
Where, N can be 1, 2, ..., 6, and TCLK is the counting period of the PCA counter.
3.2 Modify parameters online through on-chip Flash [page]
The address range of Flash 0X0000~0X007F in C8051F060 can be used for both the on-chip 64KB Flash and the additional 128KB sector, which can be achieved by setting the SFLE bit of the PSCTL register. Since the on-chip Flash must be erased before writing, and it should be done in sectors of 512KB, the additional 128KB sector is more suitable for non-volatile data storage. In the power cabinet, the parameters that usually need to be modified online are P and I of the PI regulator. The following is a procedure for modifying parameters online, taking the KEYL C statement as an example:
WrRe Flash
unsigned int xdata *pwrite
unsigned int code *pread
unsigned char i
unsigned char i1
WDTCN=0xde//Disable watchdog
WDTCN=0xad
FLSCHL | = 0x09 / / 25MHz clock erase frequency
PSCTL | = 0X02 / / Allow Flash sector erase
PSCTL | = 0X05 / / Allow Flash sector writing
pwrite=0x00000 0x00000 points to the 128B sector
*pwrite=0//Erase Flash
PSCTLR & = ~ 0X02 / / Flash erasure is prohibited
for i=0i<2i++ //Write P and I parameters into
*pwrite++=PIi
PSCTLR & = ~ 0x01 / / Flash writing is prohibited
pread=0x0000 //Read the current value
fori1=0i1<2i1++
PIi1=*pread++
4 Application of CAN bus in excitation device
CAN bus is one of the main field buses. Due to its low development cost and good anti-interference ability, CAN bus has been widely used in the field of industrial measurement and control. There are many related contents about the basic concept and interface circuit of CAN bus. This article only introduces how to use C8051F060 to realize CAN bus communication.
4.1 CAN controller structure of C8051F060
Figure 4 shows the internal CAN structure of C8051F060. Since the MCU cannot directly access the information RAM, it must exchange data with the information RAM through the IF register. The information RAM can store 32 frames of information. The IF register is divided into two groups, IF1 and IF2, which are defined as receiving and sending functions respectively. The Command Request register of the IF can be used to define which frame of the 32 frames of information to access, and the Command Mask is used to define which part of a frame of information is transferred to the information RAM.
When the interrupt register IR is 0x0000, it means that no interrupt occurs; when it is 0x0001-0x0020, it indicates which frame of the 32 frames of information caused the interrupt; and when it is 0x8000, it indicates that the status change (send completion, receive completion, error status, etc.) caused the interrupt.
4.2 CAN communication
The initialization process of communication is similar to that of other CAN controllers. Figure 5 shows the block diagram of its sending, information RAM and IF communication and receiving interrupt subroutines.
4.3 Application of CAN bus in intelligent power cabinets
The CAN communication system consists of four nodes, including a regulator and three power cabinets. The power cabinet is completed by C8051F060 to complete the communication function, and the regulator is responsible for communication by the network card HT-1302B integrated with the CAN protocol. The regulator can send parameters such as the current value, trigger angle, synchronization signal cycle, and pulse width of a single cabinet to each power cabinet. The power cabinet feeds back the output current value, conduction monitoring results, and temperature of each point in the cabinet to the regulator.
5 Conclusion
Due to the high integration of C8051F060, only a small number of peripheral measurement circuits are needed to form a single-chip system integrating control and communication functions, which can improve the overall reliability of the system. In addition, the C8051F060 core is compatible with the ordinary 51 series, and the instructions are simple and easy to learn, so the system development cycle can be shortened. This system uses a shielded twisted pair as the communication medium, the maximum communication distance does not exceed 150 meters, and the communication rate can reach 250kbps. The actual operation proves that the communication effect is very good. It can be seen that this control solution has high integration, simple hardware, reliable operation, and has good promotion value.
Previous article:51 single chip microcomputer plus CPLD makes the system more efficient
Next article:51 MCU serial communication design and input and output introduction
Recommended ReadingLatest update time:2024-11-16 20:46
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- When processing this signal, how do we calculate Z if we know the coordinates of Z-1, Z0, and Z1?
- Zigbee (CC2530) connected to esp8266 can only send but not receive
- Mini RP2040 development board minik
- Analysis of the Design Method of DSP and Slow Peripheral Device Interface
- 【LuatOS-ESP32】Download tool——Luatoose installation and use
- [ST60 short-distance evaluation] Part 1: First release on the Internet! Detailed evaluation!
- How reliable is Dupont wire???
- Q and D values of capacitors
- TI CC3200 WIFI Training Development Kit——by light-s
- HDMI to MIPI universal driver horizontal screen 1080P HD PC Raspberry Pi projector set-top box PS4 camera sub-screen side-transparent monitor TF card