Distributed Motor Control System Based on DSP-LF2407A and CAN Bus

Publisher:清新风华Latest update time:2011-06-08 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

CAN (Controller Area Network) is a local area network mainly used for monitoring and controlling various devices. It was originally designed by Bosch of Germany for automobile monitoring systems. It has good functional characteristics and high reliability, and has strong anti-interference ability on site. The bus form is a serial data communication bus.

TI's 24X series chips have excellent processing performance (30MIPS), high peripheral integration, large program memory capacity, and fast A/D conversion speed. They are DSP (digital signal processing) chips designed for industrial control. LF2407A provides a digital motor control solution with its rich integrated peripherals. Its embedded CAN bus controller provides CAN communication functions based on CAN2.0B specification requirements, providing a solution for realizing distributed industrial monitoring local area networks.

Introduction to CAN Bus

CAN belongs to the category of fieldbus, which effectively supports serial communication networks for distributed control or real-time control. CAN has a wide range of applications, from high-speed networks to low-cost multi-channel boundaries. In the field of automation electronics, such as automotive engine control components, sensors, anti-skid systems, etc., the bit rate of CAN can be as high as 1Mbps.

Different from the traditional control system that uses a one-to-one connection method based on control loops, the field bus uses intelligent field devices with computing, control and communication functions. It can complete data collection, data analysis, control processing and other functions on site, and send relevant data to the host and other field devices to achieve thorough distributed control.

CAN bus features:

1. Openness of the system. 2. Field equipment has a high degree of autonomy and intelligence. 3. High degree of decentralization of the system. 4. Strong adaptability to the field environment.

Hierarchical structure of CAN nodes

.CAN object layer

.CAN transfer layer

.The physical layer

The object layer is responsible for message filtering and status and message processing. The transport layer is the core of the CAN protocol. It provides received messages to the object layer and receives messages from the object layer. The physical layer defines the actual signal transmission method. The role of the physical layer is to perform the actual transmission of bit information between different nodes based on all electrical properties.

Figure 1 CAN node layered structure

LF2407A Introduction

DSP (Digital Signal Processing) is the process of collecting, transforming, filtering, evaluating, enhancing, compressing, and identifying signals in digital form to obtain a signal form that meets people's needs. LF2407A is a new industrial control digital signal processing chip with the following features:

1. Chip features :

1) 32-bit CPU, 32-bit ALU, 16*16-bit parallel multiplier, 3 scaled shifters, 8 16-bit auxiliary registers; 544 words of on-chip data/program DARAM, 2K SARAM, 32K on-chip program FLASH, 64K data and memory addressing range;

2) Four-stage pipeline operation, eight-level hardware stack, five external interrupts;

3) Two event managers EVA and EVB, including: 16 PWM channels, 10 comparison CMP units, 4 16-bit general timing counters, 6 capture units CAP , 4 integral coded pulse QEP units ;

4) 16-channel 10-bit A/D conversion, conversion time is 500ns, and the maximum sampling rate is 1MHz;

5) 41 individually programmable multiplexed I/O pins; clock module based on phase-locked loop circuit (PLL); watchdog timer module (WATCH_DOG) with real-time interrupt; serial communication interface (SPI) and serial peripheral interface (SPI), and CAN communication module interface ;

6) 33ns instruction cycle, 30MIPS per second , system +3.3V power supply.

2. LF2407A Embedded CAN Controller

The LF2407A chip has a built-in CAN control module, which integrates a 16-bit control chip with full CAN functions. It is fully compatible with the CAN2.0B protocol and supports standard and extended formats. The CAN module of the LF2407A consists of two parts: the CAN control/status register and the CAN mailbox RAM area. Its structural block diagram is as follows:

Figure 2 LF2407-A CAN module block diagram

The CAN control/status register section contains 16 16-bit CAN control/status registers, namely control register, status register, interrupt register and receive mask register. It completes all the services and functions of the data link layer defined by the ISO/OSI model, including the object layer and the transport layer. It realizes the control frame structure, execution arbitration, error detection, error calibration, fault definition, etc.

CAN controller interface----PCA82C250: PCA82C250 is the interface between CAN protocol controller and physical bus. This device provides differential transmission capability to the bus and differential reception capability to the CAN controller, which complies with the "ISO11898" standard.

System Structure

This system is a motor control system based on the distributed field bus CAN bus for communication and DSP as the microcontroller. It is a distributed industrial control system that combines the high-speed processing capability of DSP with the high performance and high reliability of CAN bus communication. The main body of the system design is divided into two parts: the first is the execution component: LF2407-A controls the motor action; the second is network communication: CAN realizes distributed monitoring communication.

Node 1 Node

Figure 3 System structure diagram

Its system structure can be mainly divided into three layers: the first layer, the PC and CAN bus interface layer - realize the visual operation control between the PC and the CAN communication bus, which is realized by PC-CAN - the intelligent CAN bus communication adapter card; the second layer, the CAN bus and DSP controller LF2407 interface layer - realize the physical interface and communication between the CAN bus and the CAN controller of the LF2407-A board; the third layer, the I/O port of LF2407 and the drive interface of the stepper motor - realize the electrical isolation protection of the LF2407-A board and the high-current drive of the stepper motor, and complete the actual movement of the motor.

PC is the host computer of the system, which effectively utilizes the advantages of PC's strong computing power, large capacity and good human-machine interface. PC-CAN is an intelligent CAN bus communication adapter card with high performance and price ratio, which enables PC to be easily connected to CAN bus and realize high-speed data exchange between CAN bus and host PC. PC-CAN has built-in photoelectric isolation to protect PC from damage due to ground loop current and enhance the reliability of the system in harsh environment.

PCA82C250: It is the interface transceiver between LF2407 embedded CAN controller and CAN bus. 8-pin, high speed, up to 1Mbps transmission rate. It provides differential transmission capability to CAN bus and differential reception capability to CAN controller.

Figure 5 DSP 2407-A and stepper motor driver interface

The drive circuit interface realizes the electrical isolation between the DSP chip and the stepper motor, protects the safety of the DSP chip, and completes the conversion from the weak current (less than 10mA) output by the DSP to the large current (+1.5A) required for the stepper motor drive, providing the required drive current for the motor. Among them, TLP521 is the optoelectronic isolation coupler between the DSP and the stepper motor, which plays a role in level isolation, protects the DSP chip, and completes the signal conversion. RIF530 is a VMOS tube, which is the drive current switch of the stepper motor.

CAN bus physical layer : CAN's physical link communication medium can be twisted pair, coaxial cable or optical fiber. It adopts a non-destructive priority-based bus arbitration method. In this system, twisted pair is used as the communication medium.

Software Design

The software design of this system is the key to complete the distributed control system based on CAN bus. The multi-machine communication of CAN bus is realized by software programming to receive and send data. Two nodes communication is realized on two LF2407-A boards: one is the local node, which receives the request data frame from the remote node and sends the data frame; the other is the remote node, which sends a request frame to request the remote node to send data.

It is mainly divided into: 1. The whole motor control system---implements system initialization, generates motor control frequency signal, implements the modification of motor control word in interrupt mode, implements motor speed control by delay subroutine, and initializes CAN module. 2. CAN sends a remote frame request---initializes CAN request frame, makes CAN mailbox 3 the mailbox for sending request frame, and CAN mailbox 0 the mailbox for receiving data frame. Mailbox 3 sends a request frame to request motor control word data. When the received message flag is 1 (RMP=1), mailbox 0 receives data. 3. CAN initializes an automatic response remote frame request---initializes CAN to automatically respond to remote frame request, and makes CAN mailbox 3 the sending mailbox. When a remote request is received, a frame of data is sent. The following software program flow chart is given by taking CAN initializing an automatic response remote frame request as an example, see Figure 6.

Figure 6 CAN initialization of an automatic response remote frame request program flow chart

Conclusion

This paper studies the composition and implementation of a distributed motor control system based on the CAN bus. Combining the high-speed processing capability of DSP with the high reliability and high stability of the CAN field bus provides a good solution for building a new real-time, fast-response distributed industrial control network. In particular, the embedded modules of this industrial control chip LF2407A: pulse width coding PWM, comparison unit CMP, capture unit CAP, integral coding pulse QEP unit, etc. provide direct control applications for DC and AC motors, eliminating the large amount of tedious algorithm programming required in the past in the single-chip control system, and effectively speeding up the development and application of industrial control systems.

Reference address:Distributed Motor Control System Based on DSP-LF2407A and CAN Bus

Previous article:Digital Thermometer and Temperature Controller DS7505 and Its Application
Next article:Sensorless AC motor control technology improves operating efficiency

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号