Design of power control system based on CAN

Publisher:huanhuiLatest update time:2006-08-28 Source: E代电子Keywords:register Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  The CAN bus is a serial communication network that can effectively support distributed control systems. On the one hand, its communication method is flexible and can achieve multi-master operation. It can also implement multiple data sending and receiving methods such as point-to-point and point-to-multipoint; On the one hand, it can perform data communication with higher bit rates over relatively large distances. For example, its transmission rate can reach 20kb/s within a distance of 3.3km. Our system uses a host computer to control and manage multiple parallel single power supply control systems. The distance between single power supplies is about 100m, and they must be placed at a higher position. Fast data transmission is required between systems, and the CAN bus It can meet the requirements of the system very well.

1 Overall system structure
  Figure 1 is a schematic structural diagram of the distributed power supply control system.

Among them: CAN0 node is the host computer.

  This system uses a C51 microcontroller, which is connected to the external CAN controller SJA1000. It transmits control settings to multiple slave computers below, and analyzes and calculates the data sent by the slave computers to change the settings after collecting the data. Nodes CAN1~CAN31 (up to 31 nodes) are the control part of each single power supply. We use TI's TMS320LF2407 chip as the main control, which has a CAN controller module integrated on it.

2 Introduction to LF2407 and its integrated CAN control module
  LF2407 is a fixed-point DSP processor launched by TI. It adopts high-performance static CMOS technology, with a power supply voltage of 3.3V and an instruction cycle of up to 25ns. It integrates a CAN controller including The multiple peripheral modules and memories inside are suitable for the control of motors and inverter circuits.

  The CAN controller module is a 16-bit peripheral module integrated in the LF2407. This module has the following characteristics:
  (1) Supports CAN2.0B protocol, supports standard identifiers (11 bits) and extended identifiers (29 bits), and supports data frames and remote frames.
  (2) There are 6 mailboxes configured, 2 receiving (No. 0, 1), 2 sending (No. 4, 5), and 2 configurable (No. 3, 4); the data length of each mailbox is 8B. The receiving email address can be masked with identifiers. When the identifier bit is masked, the bit identifier does not need to be checked when receiving data frames.
  (3) With programmable bit timer, interrupt service and CAN bus wake-up functions.
  (4) It can automatically reply to remote requests and has an automatic resend function when there is a transmission error or data loss. Each mailbox register contains 7 words of information. Similar to the control registers of each functional module, LF2407 assigns a fixed data memory address to it, such as mailbox 0. Its register allocation is as follows:
 

  MBX0A~D (4 words of storage space) ) Address: 7204~7207, among which: the identifier (set according to 29 bits) is in the last 13 bits of MSGIDnH and MSGIDnL.

3 Hardware circuit design and debugging
  When designing the CAN communication circuit of LF2407, one issue should be noted, that is, the power supply voltage of 2407 is 3.3V, and the high level output by its CAN control module is only 3.3V, which is the same level as the CAN driver PCA80C250 (5V) is not compatible, so be careful when designing the circuit when adding an isolation optocoupler. Figure 2 shows the CAN communication schematic diagram on the lower computer side.



  Since the output optocoupler of TX uses the emitter output mode, our output optocoupler should use 6N136 (137 cannot meet the requirements due to its structure). Figure 3 is the voltage waveform at both ends of R42 that we tested when sending data ( Output 10101010...)


  From our settings of the bit configuration register BCR1 of the CAN communication controller, we can know that in the time period occupied by each bit of data, our sampling point is at 70% of the time, and the output voltage at this point must be Within the set value range of rated high and low levels. We selected R42 = 5kΩ to obtain the above waveform, which satisfies the high level ≥ 3.5V and the low level ≤ 1.5V at the sampling point.

4 Communication protocol and software implementation
  In the system, the upper computer sends operating settings and start and stop signals to the lower computer, and regularly queries the operating status of each individual machine to adjust its status accordingly.
The specific communication process is divided into two categories:

  (1) The upper computer transmits operation commands and fixed values ​​to the lower computer, and the upper computer sends data frames.
  After the upper computer completes sending the data frame, if the lower computer receives the data frame, it will send an acknowledgment frame to the upper computer, and the sending of the data frame ends. If the transmission fails and the host computer does not receive the confirmation frame after waiting for a period of time, it will automatically resend the data frame.

  (2) The upper computer queries the running status and various record settings of the lower computer, and the upper computer sends remote frames.
  The remote frame only contains data type but no data content. After receiving the remote frame, the lower computer transmits data to the upper computer according to the data type required by the upper computer. At the same time, wait for the confirmation frame from the host computer. If the acknowledgment frame is not received, it will be retransmitted regularly.

  In this system, communication is carried out in standard frames, using 11-bit identifiers. The definitions of each are as follows:
  ID0~ID4: node identification. The 5-digit node identification allows the network to accommodate 32 nodes.
  ID5~ID7: Data types. There are many types of data that need to be transmitted. There are 7 types of uploaded data frames (including confirmation frames). Correspondingly, there are 6 types of remote frames that are downloaded, while the data frames that are downloaded are There are 6 types. At least a 3-digit identifier is required to determine the data type.

  ID8~ID10: Frame count, the data type with the largest amount of data contains 17 words of data, and each frame can transmit up to 4 words, so this type of data requires at least 5 frames to complete the transmission. Data frames need to be counted to determine the specific type of transmitted data, so at least a 3-bit identifier is needed to determine the frame count.

  Since LF2407 has a dedicated CAN module interrupt, and a dedicated CAN interrupt flag and mask register are designed in the CAN control module, it is very convenient to use interrupts to start the CAN controller to receive and send data.

  When setting up the CAN controller, you need to enable the change data request bit CCR first and restore it after the change. It is worth noting that there are many register bits in TMS320LF2407 that need to be written to "1" to clear "0", and some bits can only be read and cannot be directly rewritten by the program, such as: mailbox interrupt (including receiving and sending ) flag bit MIFn (0~5), which should be cleared after entering the interrupt response, but this bit is a read-only bit. The user program can only write 1 to the TAn bit of the TCR register (for the sending mailbox) and write 1 to the RCR Only the RMPn bit of the register (for the receiving mailbox) can achieve the purpose of clearing the bit.

5 Functions realized The

  functions realized through this communication system include: fixed value transmission (data frame transmitted from the upper computer to the lower computer):
  (1) Time adjustment: specific data of time, minutes and seconds.
  (2) Transmission of operating fixed values: including flashover parameters (flashover coefficient KSP, given spark rate SPARK_NUM), charging parameters (given peak value Up, rise rate RISE-NUM, charging time limit Ton-max), discharge parameters ( Average voltage Vg, average current Ig, discharge time limit Toff-max).
  (3) Protection settings: including open circuit parameters (voltage, current, delay), short circuit parameters (voltage, current, delay), undervoltage, delay, overload current, bias excitation, IGBT temperature, oil temperature, etc.
  (4) Channel parameters: including primary current, output voltage and current, IGBT temperature, oil temperature, input current (three-phase), and DC voltage.

  Running setting query (the host computer sends a remote frame): including system status, fault records, running setting, protection setting, channel coefficient, etc.

6 Conclusion
  This system has been debugged. In the one-to-one system we initially made (the host computer has a control system), it can resist strong interference and work normally under the condition of large transmission data volume.

References
[1] Liu Heping. TMS320LF240xDSP structural principle and application[M].Beijing: University of Aeronautics and Astronautics Press, 2002.
[2] Wu Kuanming. CAN bus principle and application system design[M].Beijing: University of Aeronautics and Astronautics Press, 1996. 2001.

Keywords:register Reference address:Design of power control system based on CAN

Previous article:Low-cost and simple switching power supply design for set-top boxes and LCD TVs
Next article:Design of new small current ground fault line selection device

Recommended ReadingLatest update time:2024-11-16 16:34

Differential signal common mode voltage ADC input circuit design
As the ADC supply voltage continues to decrease, the input signal swing continues to decrease, and the precise control of the common-mode voltage of the input signal becomes increasingly important. AC-coupled input is relatively simple, while DC-coupled input is more complicated. A typical exa
[Analog Electronics]
Differential signal common mode voltage ADC input circuit design
How the electrification of automobiles develops voltage power board network
The demand for electrical energy in cars is growing as demand for autonomous driving functions as well as comfort, convenience and infotainment features continues to grow. Today's cars have an increasing number of sensors, actuators, and electronic control modules (ECUs) that read the sensors and control the actuator
[Automotive Electronics]
How the electrification of automobiles develops voltage power board network
XC6419 Low Dropout CMOS Dual LDO Voltage Regulator Chip
The XC6419 series is a dual-channel LDO voltage regulator chip that achieves high precision, low noise, high ripple suppression, and low voltage dropout using CMOS technology. The internal structure is composed of a reference voltage source, an error amplifier, a driving transistor, a control current circuit, a phas
[Analog Electronics]
XC6419 Low Dropout CMOS Dual LDO Voltage Regulator Chip
How to measure AC voltage?
Answer: The measurement of AC voltage is divided into single-phase AC voltage measurement and three-phase AC voltage measurement. (1) Single-phase AC voltage measurement: Single-phase AC voltage measurement usually uses an AC voltmeter. When connected to the measured circuit, attention should also be paid to the selec
[Test Measurement]
How to measure AC voltage?
Basic types of voltage shutdown snubbers and how they work
This paper discusses in depth two commonly used modes of RCD snubber circuits : voltage rise rate suppression mode and voltage clamping mode, analyzes their respective working principles in detail, gives the corresponding calculation formulas, and finally proposes an optimal design method for the circuit
[Power Management]
Dual reference voltage source circuit
A voltage source, or an ideal voltage source, is a model abstracted from an actual power source. It can always maintain a certain voltage at both ends regardless of the current flowing through it. A voltage source has two basic properties: First, its terminal voltage constant U or a certain time function U(t) is indep
[Power Management]
Dual reference voltage source circuit
Reset circuit with voltage monitoring function
It can not only solve the problem of system instability caused by power glitch, but also can reliably reset the system when the power supply drops slowly. Figure 4 is an example. When VCC x (R1/(R1+R2) ) = 0.7V, Q1 is cut off to reset the system. The amplification effect of Q1 can also improve the load characteristics
[Analog Electronics]
Reset circuit with voltage monitoring function
Effect of Voltage Reference on Mixed-Signal ADC/DAC Sections
You might be tempted to blame the lack of output stability in an analog-to-digital converter or a digital-to-analog converter on the actual converter itself. After all, these devices are complex. However, don’t jump to conclusions too quickly, because the circuitry surrounding the converter may be the real culprit.
[Analog Electronics]
Effect of Voltage Reference on Mixed-Signal ADC/DAC Sections
Latest Power Management 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号