Design and application of intelligent power cabinet based on single chip microcomputer C8051F060

Publisher:Mingyue1314Latest update time:2011-12-19 Keywords:C8051F060 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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α+90N-1 /360TCLK

TWN=TSENa+++90N-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=0i<2i++ //Write P and I parameters into

*pwrite++=PIi 

PSCTLR & = ~ 0x01 / / Flash writing is prohibited

pread=0x0000 //Read the current value

fori1=0i1<2i1++

 PIi1=*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.

Keywords:C8051F060 Reference address:Design and application of intelligent power cabinet based on single chip microcomputer C8051F060

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

Design of frequency response tester based on C8051F060 and AD9834
Abstract: In order to test the frequency response characteristics of the circuit system, it is usually necessary to add different frequency excitations to the input end of the circuit system, and then measure the output of the circuit to obtain the frequency response function. This paper introduces the design method
[Microcontroller]
Design of frequency response tester based on C8051F060 and AD9834
Application of uCOS II Embedded System on C8051F060
With the rapid development of integrated circuits and the continuous improvement of CMOS process level, system-on-chip SOC has begun to become the mainstream of design. The C8051F060 microcontroller is designed and manufactured by Cygnal Corporation of the United States. It is a fully integrated mixed-signal system-on-
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号