Share this

Development of a Multifunctional Automation Device for Small Hydropower Based on CAN Bus

2026-04-06 06:00:51 · · #1
Abstract: To address the issues of outdated measurement and control technology, obsolete equipment, and frequent safety accidents in many small hydropower stations in China, and to improve the automation level of small hydropower, a functional modular design scheme is adopted. The functional modules are connected via a CAN bus to form a multi-functional automation device for small hydropower. This device integrates generator protection, comprehensive measurement and control, synchronization control, sequential control, and remote communication functions. Its internal communication is fast and reliable, and it has strong anti-interference capabilities. The device can operate independently to meet the various automatic control requirements of small hydropower stations, and it can also easily communicate with a host computer to form a hydropower station monitoring system when multiple systems are operating in tandem. Keywords: CAN bus; automation device; DSP; small hydropower automation Abstract: In order to solve the problems of low control technology, obsolete device and frequent accidents in many small hydropower stations in our country, improve the technology of automation in small hydropower stations, the multi-function automation device for small hydropower stations is composed of many functional modules which are connected by CAN Bus. The device has the functions of generator protection, measuring and control, sychrolization control, PLC, remote communication and so on. The communication inner the device is fast and reliable, and the performance of anti-famming is strong. The device can run alone to complete the function of automatic control for small hydropower stations, and when many devices run together they also can communicate with PC conveniently to form monitor and control system in small hydropower stations. Key words: CAN Bus; Automation Device; DSP; Automation in Small Hydropower Stations 1 Introduction Currently, many small hydropower stations in China suffer from lagging automation levels, outdated electromechanical equipment, and frequent safety accidents. The operation of automatic control systems requires multiple operators for equipment maintenance and accident handling, severely impacting the economic benefits of small hydropower. In recent years, most small hydropower stations have requested technical upgrades to their automation equipment to improve measurement and control technology, reduce accident rates, and minimize or eliminate the need for operator staff. The development and application of bus technology offers a convenient solution to these problems. Using high-speed fieldbus technology—CAN bus—the functional requirements of various measurement and control systems in small hydropower stations can be modularized and centrally designed to form a CAN bus-based multifunctional integrated measurement and control device for small hydropower stations. 2 Characteristics of Small Hydropower Station Measurement and Control Systems and the Determination of the CAN Bus 2.1 Characteristics of Small Hydropower Station Measurement and Control Systems The main measurement and control systems of small hydropower stations include generator protection, speed measurement and control, temperature monitoring, integrated measurement and control, synchronization control, sequential control, human-machine interface, and communication. Compared to large hydropower stations, the automation requirements for small hydropower stations are relatively simple. Directly applying the automation control schemes and equipment configurations of large hydropower stations would result in complex modes, high costs, large equipment footprints, and significant functional waste. Considering the characteristics of small hydropower station automation control systems, the optimal solution is to design a modular, integrated system where various control systems are connected via bus technology. The integrated unit operates independently, simplifying installation and operation. 2.2 Characteristics and Communication Protocols of CAN Bus Currently, several widely used fieldbuses include CAN, HART, Profibus, and Lonworks. Among these, the CAN bus, with its extremely high performance, reliability, and unique design, is increasingly valued and has become one of the most promising fieldbuses. CAN (Control Area Network) is a highly reliable fieldbus network that effectively supports distributed or real-time control. Originally developed by Bosch in Germany to solve the data exchange between sensors and actuators in automobiles, it is particularly suitable for interconnecting industrial process monitoring equipment. Its applications have expanded to industrial control automation, automotive automation, machinery industry, building automation, and other fields. (1) Characteristics of CAN Bus Compared with other fieldbuses, CAN bus has a unique design concept for the development requirements of multi-functional measurement and control devices: • Multi-master operation: Any node on the network can actively send information to other nodes on the network at any time, without master-slave distinction, and the communication method is flexible. This feature allows each module node inside the device to actively send information without time restrictions, and the real-time performance of communication is good. • Non-destructive bus arbitration technology is adopted, which greatly saves the bus conflict arbitration time. This feature makes the communication of each module node inside the device fast and reliable. • Data can be transmitted in several ways, such as point-to-point, point-to-multipoint, and global broadcast, simply by message filtering. Based on this feature, the communication methods of each module node inside the device can be diversified. For example, time synchronization can be achieved by broadcasting. • The number of nodes on the CAN network can currently reach 110; the number of message identifiers can reach 2032 (CAN2.0A), while the message identifiers of the extended standard (CAN2.0B) are almost unlimited. Therefore, adopting the CAN2.0B standard can solve the problem of large message volume when each module node communicates. • Short frame data format is adopted, which has short transmission time, strong anti-interference ability and good error detection effect. • Each frame information has CRC check, which makes the data communication highly reliable. • Communication nodes can automatically shut down the output function and disconnect from the network in case of serious errors, without affecting the operation of other nodes. (2) Communication protocol of CAN bus The message transmission of CAN bus is represented and controlled by four different types of frames: [3] data frame, remote frame, error frame and overload frame. Data frame and remote frame can use standard frame format and extended frame format. Data frame carries data from a sending node to one or more receiving nodes. It consists of frame start, arbitration field, control field, data field, check field, acknowledgment field and frame end. The arbitration field of standard frame consists of 11-bit identifier and remote transmission request bit RTR. The arbitration field of extended frame consists of 29-bit identifier and alternative remote request SRR bit, flag bit IDE and remote transmission request bit RTR. Remote frame has no data field and consists of frame start, arbitration field, control field, CRC field, acknowledgment field and frame end. A receiving node on a CAN network can initiate data transmission by sending a remote frame to the network. The data sending source node is addressed by an identifier, and the RTR bit of the corresponding frame is set to "1". The identifier, serving as the message name, is first sent to the bus during arbitration. It is used in the receiver's acceptance judgment and in determining access priority during the arbitration process. The Remote Transmission Request (RTR) bit is used to determine whether to send a remote frame or a data frame. When RTR is high, the CAN controller sends a remote frame; when it is low, a data frame is sent. 3. Application of CAN Bus in Multifunctional Automation Devices for Small Hydropower Projects Developing an integrated automatic measurement and control device using the CAN bus can improve the level of comprehensive automation in China's small hydropower projects. The developed measurement and control device adopts object-oriented design principles and a functional module design method, enabling functions such as unit protection, speed measurement and control, temperature monitoring, power acquisition, non-power acquisition, synchronization control, sequence control, human-machine interaction, and communication. Seven CPU modules are installed inside the device, respectively used for integrated measurement and control, automatic synchronization, panel display, communication management, PLC sequential control, light bar display and voice alarm, and generator-transformer group protection. Each module is connected via a high-speed CAN fieldbus to complete functions such as production process control, equipment status monitoring, equipment parameter setting, operating parameter monitoring, and device self-diagnosis fault display. The CAN communication structure diagram of each CPU module is shown in Figure 1. [align=center] Figure 1 Internal CAN communication structure diagram of the small hydropower multi-functional automation device[/align] 3.1 Hardware selection of the main controller The main controller uses the high-performance DSP digital signal processor DSP56F807 from Motorola. The selection of the main control chip depends on the functional requirements of the small hydropower measurement and control device. The small hydropower measurement and control device adopts a multi-CPU hardware mode, with each major functional module completed by an independent control chip. Many of these functions require high real-time performance, such as the timing capture of the closing of the quasi-synchronous function and the action output of the generator protection. In addition, the power acquisition in the device requires the use of Fourier algorithm, which has a very large amount of computation. Therefore, the main controller needs to select a CPU chip with fast computing speed and good anti-interference performance. The DSP56F807 is a main control chip with the above advantages. The DSP56F807 [4] has a multi-bus and pipeline structure, fast instruction execution rate, and the DSP has a hardware multiplier inside, which can complete the multiplication in one instruction cycle, and the computing speed is fast. The CPU modules inside the device use CAN bus communication, and the DSP chip integrates the controller LAN module CAN2.0A/B. Therefore, there is no need to configure a separate CAN bus chip, which reduces costs and simplifies the hardware circuit. This is another reason why the main controller uses the DSP56F807. Through the CAN control module MSCAN that comes with the DSP chip, the nodes on the CAN bus can be easily interconnected in hardware, so that the bus does not leave the chip. Since the CAN controller must be connected to the CAN bus through the CAN driver chip, the 82C250 CAN bus transceiver produced by PHILIPS is selected as the CAN driver chip. The connection diagram between the DSP and the 82C250 is shown in Figure 2. [align=center] Figure 2 Connection diagram between DSP and 82C250[/align] 3.2 Software implementation of CAN communication In this design, the program is mainly written in C language, while the program is written in assembly language in a few places where it is necessary to directly interact with the hardware. When writing the CAN communication program, there are three very important steps: CAN module initialization, CAN receiving data and CAN sending data. (1) Initialization of CAN module When the CAN controller is running, the MSCAN module must be initialized first, and some of its internal registers must be set. The CAN module initialization flowchart is shown in Figure 3. [align=center] Figure 3 CAN initialization flowchart[/align] First, MSCAN is put into software reset state, because only in this way can the relevant registers of MSCAN be written. At this time, MSCAN will exit all sending and receiving operations and lose bus synchronization. Therefore, after MSCAN sets the relevant registers and exits the software reset state, it is necessary to determine whether MSCAN is synchronized with the bus. Only when synchronization is completed can MSCAN receive and send data frames normally. (2) Data reception of CAN module When CAN receives data frames, it adopts an interrupt mechanism. Since the receive interrupt enable register is set during MSCAN initialization, the receive buffer full interrupt is allowed. That is, when the receive buffer is full, an MSCAN receive interrupt request will be triggered. The CAN receive interrupt flowchart is shown in Figure 4. In the receive interrupt service routine, in order to avoid the interrupt from happening again, the interrupt enable register is set before receiving the data frame to prevent the receive buffer full interrupt. After receiving the data frame, the receive buffer full flag is cleared and the receive buffer full interrupt is allowed to facilitate the processing of the next receive interrupt. [align=center] Figure 4 CAN Receive Interrupt Flowchart[/align] (3) Data Transmission of CAN Module CAN also uses an interrupt mechanism when transmitting data frames. However, unlike the receive interrupt, since the transmitter control register CANTCR is set during MSCAN initialization, an empty transmit buffer interrupt is not allowed. Therefore, when transmitting data frames, it is necessary to set CANTCR to allow an empty transmit buffer interrupt, thereby starting the transmit interrupt and entering the transmit interrupt service routine. The CAN transmit interrupt flowchart is shown in Figure 5. In the interrupt service routine, CANTCR is set to not allow an empty transmit buffer interrupt until the next transmit interrupt is started. When it is determined that the transmit buffer is empty, the transmit buffer data register is filled and the transmit buffer empty flag is cleared, so that MSCAN can start transmitting data. [align=center] Figure 5 CAN Transmit Interrupt Flowchart[/align] 3.3 CAN Communication of Each CPU Module Inside the Device The amount of information in the CAN communication between each CPU module inside the device is very large, so the communication protocol uses the CAN 2.0B extended mode, and the message identifier is almost unrestricted. At this time, the identifier of the arbitration field is 29 bits. The CAN specification only defines the structure of the data frame, not the structure information for sending and receiving. Therefore, when writing a communication program, it is necessary to assign specific meanings to different bits of the data frame, which contain all the information required for data transmission, including the source address, destination address, frame type, number of bytes transmitted, and the data body. Since the CAN protocol stipulates that each frame can transmit a maximum of 8 bytes of data, a better solution to ensure that all 8 bytes are data bodies is to include the other information in a 29-bit identifier. In this design, the CAN communication data frame format is defined as shown in Table 1. Table 1: CAN Communication Data Frame Format Definition. The first 4 bytes are the arbitration field and control field of the extended data frame, and the last 8 bytes are the data field. In the design: PRI: Priority. 1 is low priority, 0 is high priority, and the remaining priorities are determined by the source address, with lower addresses having higher priority. This function can effectively support the transmission of emergency information such as alarms. Source Address: The source address for sending data. Type: Frame type, including single frame, multi-frame, point-to-point transmission, and broadcast transmission. SRR: In a data frame, SRR must be at a dominant level, while in a remote frame, SRR must be at a recessive level. IDE: Belongs to the arbitration field and is at a recessive level. DLC: Indicates the number of bytes to be sent, equal to the number of bytes minus 1. Since each frame can send a maximum of 8 bytes of data, the maximum DLC is 7. Data index: Index byte. There is no index byte in a single frame, so this byte is empty; in multi-frame data, Data index indicates the frame sequence number of the data frame being sent. Destination Address: The destination address for sending data. RTR: Defines whether the information in this frame is a data frame or a remote data frame request bit. Data length (L), Data length (H): The length of the multi-frame information packet. It is only filled in the first frame of multi-frame data transmission; other frames are not filled, but can be filled with the information body to be transmitted. 6 bytes data: The information body to be transmitted. Following the above-mentioned CAN protocol, communication between CPU modules is fast and reliable, with strong anti-interference capabilities, and the transmission baud rate reaches 500kbps, meeting the performance requirements of the research and development. 4. Conclusion To meet the requirements of small hydropower stations for reduced or unmanned operation and improve their automation level, a combined intelligent device integrating generator monitoring and control protection, excitation regulation, synchronization and parallel operation, sequential control, remote communication, and human-machine interaction is an economical and feasible technical solution and will inevitably become the future trend of integrated automation in small hydropower. The multi-functional monitoring and control device developed here adopts an object-oriented hierarchical distributed structure. Each CPU module is connected via a CAN bus, ensuring fast, reliable, and highly interference-resistant data exchange between modules. Visually, all these functional modules are housed in a single chassis, resulting in a compact structure that facilitates installation and use. In practical applications, it can operate independently on-site or, when running in conjunction with other systems, be configured with a host computer to form a hydropower station monitoring system, demonstrating a very broad range of application prospects. References: [1] Li Jinglan, Wang Ping. CAN bus communication based on Motorola embedded controller DSP56F805 chip [J]. Electrical Drive, 2004, 2: 48-51. [2] Bao Guanjun, Ji Shiming, Zhang Li, Wang Yaliang. CAN bus technology, system implementation and development trend [J]. Journal of Zhejiang University of Technology, 2003, 2, 31(1): 58-62. [3] Yang Hui, Tian Liang, Tian Min. CAN bus protocol analysis [J]. China Instrument and Meter, 2002, 4: 1-4. [4] Shao Beibei, Gong Guanghua, Xue Tao, Liu Yongyi. Principles and Practice of Motorola DSP 16-bit Microcontroller [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2003.
Read next

CATDOLL 115CM Hedi TPE

Height: 115cm Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22
CATDOLL 115CM Kiki TPE

CATDOLL 115CM Kiki TPE

Articles
2026-02-22
CATDOLL 60CM Sasha Silicone

CATDOLL 60CM Sasha Silicone

Articles
2026-02-22
CATDOLL Dodo 109CM TPE

CATDOLL Dodo 109CM TPE

Articles
2026-02-22