Application of CAN bus in beer fermentation process control system

Publisher:532829319hmkLatest update time:2011-06-08 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
As people's requirements for beer quality are getting higher and higher, traditional production operations or control methods are no longer suitable for today's production scale and production requirements. The fermentation process is a crucial part of the beer production process, and its control system is particularly important. The CAN bus has the characteristics of simple structure, flexible communication mode, error detection and processing, especially the priority-based non-destructive bus arbitration technology, which is particularly suitable for the interconnection of industrial process monitoring equipment. Therefore, in view of the current equipment status and production needs of beer companies, this article will introduce a beer fermentation distributed control system that uses CAN bus technology for communication.


Figure 1: Structural diagram of field intelligent node


Figure 2 Intelligent node CAN bus interface circuit


Figure 3 Node query sending (left) and interrupt receiving (right) process


Figure 4 Smart adapter USB-CAN hardware principle circuit


Overall structure of control system
The beer fermentation distributed control system based on CAN bus consists of three parts: field intelligent node, monitoring computer and CAN control network.
The field intelligent node is directly oriented to the production process. Its main function is to collect the temperature and pressure values ​​of various places in the field fermentation tank, control the actuators in the temperature and pressure control loop according to a certain control algorithm, send the operation status information of the field fermentation tank to the monitoring machine through the CAN bus communication network, and process various commands transmitted by the monitoring machine in real time.
The monitoring computer is composed of a PC, and there is another PC as a hot backup machine. Once a failure occurs, the other can be started immediately to ensure the reliability of the control system. The main functions of the monitoring computer are: setting the operating parameters of each field intelligent node; obtaining the data of the field intelligent node in real time through the field bus network; monitoring system abnormalities, and immediately issuing corresponding sound and light alarm signals according to the fault information; intuitively indicating the current operation status and parameter information of each fermentation tank with a friendly graphical interface; realizing database management, classifying and managing the operation data of each fermentation tank, and providing data for optimizing the process.
The CAN control network part is mainly composed of intelligent CAN-PC bus adapter, communication medium, interface circuit and corresponding communication software. The CAN-PC bus adapter of this system is an intelligent communication adapter USB-CAN, which can easily realize the connection between the monitoring computer and the CAN bus and complete the user's complex communication tasks at high speed. The communication medium is a twisted pair, and the load is connected between CAN-H and CAN-L. In order to suppress signal reflection, the terminal is connected with a matching impedance of about 120.

Design of field intelligent node
The CAN bus interface circuit in this system is mainly implemented in the field intelligent node part. In order to further explain the application of CAN bus in beer fermentation process control, the overall design of the field intelligent node is introduced below, and the hardware circuit and software flow chart for realizing CAN communication are given.
Overall structure of field intelligent node
As mentioned above, the field intelligent node in the beer fermentation process control system completes the main tasks of field data collection and processing, control of each actuator on the tank body, and communication between the intelligent node and the monitoring computer. The monitoring computer only completes status monitoring, alarm, and intelligent node operation parameter modification. Therefore, the design of the field intelligent node is the key part of the whole system. Each field intelligent node controls a cylindrical cone-bottomed fermentation tank, and its structural block diagram is shown in Figure 1.
Considering factors such as reliability and cost-effectiveness, the field intelligent node CPU adopts the MCS-51 series single-chip microcomputer AT89C52. The intelligent node design adopts a structured design method, including three parts: CAN bus interface part, CPU, watchdog circuit, power management and bus address decoding part, and I/O interface part. Among them, the I/O interface part mainly completes the tasks of field data display and keyboard input, A/D acquisition of field signals and control output of actuators.

Design of CAN
interface circuit for
field intelligent node In the design of field intelligent node, the CAN bus network interface uses Philips' CAN controller chip SJA1000 and CAN bus transceiver PCA82C250 chip. In order to enhance the anti-interference ability of field intelligent node, the bus transceiver and controller are isolated by high-speed optocoupler 6N137. The interface circuit is shown in Figure 2.
In order to ensure the clock synchronization between SJA1000 and AT89C52, this design uses CLKOUT clock signal as the clock input of AT89C52; the end of SJA1000 connected to AT89C52 communicates with CPU through interruption; the RS pin of PCA82C250 is connected with a slope resistor, and the resistance value (16~140K) can be adjusted appropriately according to the bus communication rate. In this design, the value is 47K; a 5 resistor is connected between the two output pins of PC82C250 and the CAN bus to play a certain current limiting role, thereby protecting PCA82C250 from overcurrent impact; in order to filter out high-frequency interference on the bus and have a certain ability to prevent electromagnetic radiation, two 30pF capacitors are connected in parallel between CAN-H and CAN-L and the ground.
Field Intelligent Node CAN
Communication Software Design
The CAN communication software design of the field intelligent node consists of three parts: SJA1000 initialization, data reception and transmission. The main program of the node completes the initialization of SJA1000, opens the interrupt of SJA1000, controls the entire fermentation process, and actively transmits the status information of the fermentation tank to the monitoring computer.
The initialization of SJA1000 mainly sets the communication parameters of CAN, such as setting the mode register memory, etc. In this design, data transmission is active, so the processing of transmission is relatively simple. The main program adopts the method of querying the status identifier of SJA1000. It only needs to send the information frame to the transmission buffer of CAN and start the transmission command. In order to ensure the real-time performance of the system, data reception is realized through the interrupt control of SJA1000. The information to be received is read from the receiving buffer in the ISR, and the error and data overflow interrupts are also judged and processed accordingly. The sending and receiving flow chart is shown in Figure 3.


Design of Intelligent Communication Adapter
USB-CAN
In order to realize the communication between the upper monitoring PC and the lower field intelligent node in the system, a communication adapter must be used to realize the communication protocol conversion function between the CAN bus and the PC bus. In the traditional network adapter design, the communication interface with the PC is mostly ISA bus, RS-232, etc. Although they are relatively simple to implement, they cannot meet the needs of high-speed transmission due to bandwidth limitations; and the popular PCI bus is powerful, but the protocol is complex, the development cycle is long, it does not support hot plugging and is expensive. The USB bus has the characteristics of easy installation, high bandwidth, and high reliability. Therefore, this system uses the independently developed intelligent communication adapter USB-CAN to realize the communication between the CAN network of this system and the PC.
Intelligent Adapter
USB-CAN Hardware Circuit Design
The adapter hardware circuit consists of three parts: CAN bus interface part, USB bus interface part, CPU and power management part. The design of the CAN bus interface part is almost the same as the intelligent node CAN interface. The CPU uses Philips' enhanced MCS-51 compatible microcontroller P89C51RD2, which has a built-in watchdog and programmable clock output. In 6-clock mode, the operating speed is twice that of the standard C51 microcontroller. The USB bus interface uses Philips' PDIUSBD12 chip, which complies with the USB1.1 version specification and can realize a high-speed parallel interface with any external microcontroller/microprocessor. The hardware circuit is shown in Figure 4.
In order to ensure the clock synchronization between P89C51RD2, PDIUSBD12 and SJA1000, the CPU with an external 12MHz crystal oscillator runs in 6-clock mode, and the P1.0 pin is programmed to output a 6MHz square wave as the input clock of PDIUSBD12, and then the CLKOUT pin is programmed to generate a 24MHz output clock to provide to SJA1000 through the setting mode register of PDIUSBD12. The INT-N of PDIUSBD12 is connected to the CPU end, and communicates with the CPU through interrupt mode; the SUSPEND pin is connected to the P1.4 end of the CPU to indicate to the CPU whether the device is suspended; the D+ pin signal is connected to the internal pull-up resistor of 1.5K through a soft connection, indicating to the host that it is a high-speed device; to determine whether the USB cable is connected to the host, the EOT-N pin is used to detect the VBUS voltage of the USB interface; due to the use of multiple address/data bus configuration, A0 is connected to a high level; in addition, the D+ and D- pins are each connected to an 18 resistor, which plays a certain current limiting role to protect PDIUSBD12 from overcurrent shock.
Intelligent Adapter
USB-CAN Software Design
The software of the intelligent communication adapter USB-CAN, namely the USB firmware, mainly completes two tasks: responding to the configuration request from the host and completing the enumeration operation of the USB peripherals; responsible for receiving the host's command and sending it to the nodes on the CAN bus, and receiving the data of each node and transmitting it to the PC via the USB bus.
The USB firmware includes the main program, the external interrupt 0 subroutine and the external interrupt 1 subroutine. In the main program, the initialization of SJA1000 and PDIUSBD12 is completed and interrupts are opened; the external interrupt 0 subroutine handles events on the CAN bus, which is similar to the processing of the CAN bus by the intelligent node; the external interrupt 1 subroutine handles events on the USB bus.
From the perspective of the entire monitoring system, the software design also includes the driver and application of the USB device, etc., which are limited in space and will not be elaborated here.

Conclusion
The CAN bus, with its unique design concept, excellent performance and extremely high reliability, is recognized as one of the most promising field buses. The beer fermentation monitoring system based on the CAN bus has the characteristics of good maintainability, easy expansion, high reliability and low cost, which is very suitable for the current production and development status of beer companies.

Reference address:Application of CAN bus in beer fermentation process control system

Previous article:Three-point three-wheel tracking system for robots on complex routes
Next article:Research on coal mine safety monitoring substation

Latest Industrial Control Articles
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号