Share this

Industrial online control system based on microprocessor and CAN

2026-04-06 05:22:36 · · #1

Abstract: Fieldbus Control System (FCS) technology is increasingly widely used in the field of automation. This paper details the design of a CAN bus node based on an industrial equipment online control system, providing a comprehensive explanation of the node's hardware and software design. Different types of CAN bus nodes are designed according to system requirements. Various communication methods are available between nodes. The system is suitable for multi-machine network control in a single location, multi-floor equipment network control, or network control of multiple specific locations. The system is scalable, allowing a host computer to be connected via a specific CAN interface device for system monitoring.

Keywords: Equipment control system; CAN bus node; Microcontroller

Abstract: CAN (Controller Area Network) is one of popular field bus and a new kind of network based on micro control unit. The paper introduces the CAN node based on the industrial instruments controlling system and node design of hardware and software. The paper design different CAN nodes which can communicate each other in several modes. The node can be applied in control network which is composed of many special sites or industrial workshops. The system can be monitored through personal computer which connected the CAN bus through special CAN device.

Keywords: Air-Condition Control System; CAN Bus Nodes; Micro Controller

1 Introduction

CAN bus is one of the popular bus technologies currently available, a network based on microcontrollers. It interconnects various field controllers and instruments using an open, interoperable network to form a fieldbus control system, completely decentralizing control functions to the field and reducing installation and maintenance costs. FCS is essentially an open, interoperable, and thoroughly distributed control system. CAN bus falls under the category of industrial fieldbus and is one of the currently popular fieldbus control systems. Compared to general communication buses, CAN bus data communication has outstanding reliability, real-time performance, and flexibility, while also possessing the advantages of fieldbuses. This paper proposes a device online control system based on CAN intelligent nodes.

2 System Overview

This paper designs a CAN bus-based intelligent node for an industrial equipment control system. The nodes are divided into three types: control nodes, master nodes, and slave nodes. Multiple different nodes are connected via the bus to form a multi-machine control system. Although the system has three types of nodes with different functions, each type of node adopts the same CAN node structure.

Figure 1 Schematic diagram of CAN bus node structure

CAN bus nodes can be categorized into three configurations: 1) a microcontroller with a CAN controller + a CAN transceiver; 2) a microcontroller with a CAN controller + a CAN transceiver; and 3) I/O ports with a CAN controller + a CAN transceiver. The system architecture is shown in Figure 1. This paper selects the first configuration because its flexible component combination makes it easy to achieve a high cost-performance ratio.

3-node hardware architecture design

3.1 Selection of Node Control Chip

This study uses the PIC chip (PIC16F873, 28-pin FLASH) from Microchip Technology Corporation (USA) and the MPLAB development tool from Fuzhou Beineng Company. The MPLAB development system is an inexpensive development tool that integrates a programmer and debugger. It utilizes the in-circuit debugging capabilities of the PIC16F87X and Microchip's in-circuit serial programming technology. It operates within the MPLAB-IDE integrated development environment software package and connects directly to the application system. The PIC16F87X is a mid-range product from Microchip Technology Corporation (MICIZOCHII), inheriting the traditional characteristics of the Microchip-III: practicality, low cost, limited instruction set, and low power consumption.

The shortcomings of the PIC16F873 development device are as follows: the system can only set one breakpoint; the single-step execution speed is slow after running the system program; due to the occupation of chip resources, the I/O pins RB3, RB7, and RB6 are not functioning properly and cannot be debugged. In addition, when debugging the program, care should be taken to ensure that the programming voltage is not too low.

3.2 Hardware Design for Node CAN Communication

The main components used in CAN include the CAN controller and the CAN transceiver. This paper selects an independent CAN controller. The PHILIPS SJA1000 has too many pins, occupying too many I/O ports. The MCP2510 is currently the smallest CAN controller on the market, connecting to the microprocessor via SPI communication with fewer connection ports. Therefore, the system chooses the MCP2510 as the CAN controller. The MCP2510, along with the MCU and the driver chip (8X250), can form a simple local area network node. The MCP2510 can fully implement the CAN2.0A and CAN2.0B protocols. Figure 2 shows the internal structure of the MCP2510 chip.

Figure 2 Internal structure diagram of MCP2510

Its features include: most CAN bus transceivers are 8-pin DIP packages, and products from different companies are similar in price and performance, with no significant differences. PHILIP's newly released high-speed fault-tolerant CAN transceivers, TJA1050 and TJA1040, are roughly the same price as the earlier PCA82C250, but offer stronger anti-interference capabilities and can prevent electromagnetic interference. This article uses the PCA82C250 CAN transceiver.

3.3 Control Node Design

The control node uses a PIC16F873 for control and communication. The structure of the control board is shown in the figure. The control board consists of the following circuits: keyboard input circuit, IC card control circuit, LCD display circuit, wireless signal receiving circuit, main control circuit, and CAN communication circuit. Figure 3 is a schematic diagram of the control node structure.

Figure 3 Schematic diagram of control node structure

1. The keyboard input circuit uses the 74C922 keyboard encoder chip. Its valid output (DATA AVAILABLE) is connected to the hardware interrupt of PORTB on the I6F873 microcontroller. Its decoded outputs are connected to PORTA and PORTB respectively. The 74C922 chip performs keyboard scanning via an external clock or external capacitor, has low power consumption, and a wide power supply range of 3V-15V. When a key is pressed, the valid data output is high; otherwise, it is low. The data output port retains the decoded output state of the previous key press until the next key press.

2. IC Card Control Circuit. The control chip communicates with the IC card via I2C. The control board can only be operated after the data in the card is read; otherwise, the control board only displays the current time, and the buttons are ineffective. The IC card is packaged from a general-purpose memory chip. Due to its simple structure and function, low production cost, and ease of use, it has been widely used in various fields. Currently, most general-purpose memory chips used in IC cards are E2PROMs, and their commonly used protocols are two-wire serial connection protocol (I2C) and three-wire serial link protocol. This paper uses the commonly used AT24 series EEPROM chip AT24C01 produced by Atmel, which has a 1KB storage capacity, two-wire serial I2C communication, and is suitable for operation at low/standard voltages of 2V to 5V. It has advantages such as low power consumption and high reliability.

3. LCD displays are a typical application in microcontroller-controlled products. Currently, there are several methods to implement LCD display control: one is to directly integrate the LCD driver circuit within the microcontroller. This method is commonly used in 4-bit microcontrollers, but less so in 8-bit microcontrollers, and is also more expensive. Another method is to use an LCD module, which includes both an LCD display and an LCD driver circuit. This is more convenient to use, but the cost is higher, making it unsuitable for mass production. This paper adopts a microcontroller + LCD driver + LCD display approach. Different microcontrollers can be selected, and the cost-effective HT1621 LCD driver is chosen.

4. The wireless signal receiving circuit designed in this system uses the MICRF002 chip. The MICRF002 chip is a superheterodyne circuit. The MICRF series of superheterodyne circuits from Micrel Corporation in the United States offer high sensitivity and good selectivity. A single integrated circuit can perform both reception and demodulation functions. The Micrel MICRF002 is an improvement on the MICRF001, offering lower power consumption and a power-off control terminal compared to the MICRF001. The MICRF002 is stable and very easy to use.

5. The master and slave nodes have the same hardware circuitry (which we call the motor board), differing only in software design. The motor board consists of a PIC16F873 main control chip, a water level detection circuit, a pulse detection circuit, and a drive circuit.

4-Node Software Design

The system software design is divided into three main parts: CAN node communication program, control board program (including keyboard input program, wireless receiver program, IC card communication program, and LCD interface control program), and motor board program. The IC chip on the control board contains the control board program and the CAN communication program. The IC chip on the motor board stores the CAN communication program and the motor board program. For the CAN node to effectively and in real-time complete communication tasks, the CAN communication software design is crucial. It includes initialization program message sending subroutines, message receiving subroutines, and error handling subroutines, etc.

The main program flowchart of the control board is shown in Figure 4. The system design requires that the system can only be controlled via keyboard or remote control after an IC card is inserted. Both the keyboard processing subroutine and the wireless receiving subroutine are executed using interrupt mode, and only one of them can be executed at any given time. The interrupt for the keyboard processing subroutine is an external INT interrupt, and the wireless receiving subroutine uses pin RB6 of port B.

Figure 4 Control board program flowchart

One point to note during programming is that while a level change at PORTB pins RB7-RB4 can generate an interrupt, this interrupt only occurs when the I/O pins are set to input mode. The chip compares the input signal at RB7-RB4 with the previously read latch value; if they are not equal, they are XORed and output, generating a change interrupt and setting the RBIF flag to 1. During control board program execution, the program receives the status of each motor board and displays the number of motors and the water level in the tank on the control board's LCD. The control board receives commands from the keyboard and remote control and sends information to the bus. The motor boards receive bus information and execute the commands from the control board. They also periodically send water level status values ​​to the control board. The freezing function simultaneously performs flushing and ventilation functions. The freezing function program is a subroutine of the motor board program. Cleaning must be performed after each freezing cycle to keep the filter clean.

The CAN controller MCP2510 communicates with the control chip PIC16F873 via SPI. The PIC microcontroller operates in master mode, enabling full SPI functionality. Data transmission and reception utilize software buffers. When transmitting data, the software buffer loads the data to be transmitted and simultaneously issues an SPI interrupt. The CAN bus has abolished station address encoding, instead encoding the communication data. Data encoding is identified by the frame ID number. The data ID number can be set via an encoding switch. Bus arbitration refers to the process where two or more units simultaneously begin transmitting messages, resulting in a bus access conflict. This conflict is resolved through bit-by-bit arbitration using identifiers. The arbitration mechanism ensures no loss of message quality or time. When a data frame and a remote frame with the same identifier are initialized simultaneously, the data frame takes precedence over the remote frame. During arbitration, each transmitter compares the level of its transmitted bits with the level of the monitored bus.

The author's innovative points

This paper constructs a CAN bus node based on an industrial equipment control system, designing three different functional nodes. The hardware structures for each node are designed. Using PIC assembler code, the basic CAN communication method and the functional requirements of each node are implemented. The CAN bus node designed in this paper addresses some drawbacks of the traditional 485 bus industrial communication control method, such as the inability to form a multi-master structure, excessive workload on master nodes, potential system paralysis due to master node failure, reduced data transmission efficiency, poor real-time performance, and weak error handling capabilities.

References:

[1] Jiang Jianwen, Analysis and Implementation of CAS Bus Communication Protocol [J]. Computer Engineering, 2002, 3

[2] Yang Zhenjiang, Du Tiejun, Li Qun. Practical Subroutines and Application Examples of Popular Microcontrollers [M]. University of Electronic Science and Technology Press. Xi'an. 2002, 7

[3] Sun Shuwen, Yang Jianwu, Zhang Huihui, Zheng Gang. Application of CAN bus in vehicle distributed control system [J]. Microcomputer Information, 2007, 3-2: 45-47

Read next

CATDOLL 126CM Emelie

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22