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.
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
- Popular Resources
- Popular amplifiers
- Microgrid Stability Analysis and Control Microgrid Modeling Stability Analysis and Control to Improve Power Distribution and Power Flow Control (
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- New Energy Vehicle Control System Inspection and Maintenance (Edited by Bao Pili)
- Intelligent Control Technology of Permanent Magnet Synchronous Motor (Written by Wang Jun)
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- SPI slave returns data to the host in dislocation
- SensorTile.box V335 Firmware
- SensorTile.box IoT-related application supplementary content
- Introduction to DDS Principle (Chinese).pdf
- BlueNRG-1 adds DeviceInformation information
- [GD32L233C-START Review] 15. Flash erase and write operations, using FLASH as EEPROM
- [Original] [Ultra-low power STM32U5 IoT Discovery Kit] - 3: BLE-1
- How to test ch9328?
- 【ATmega4809 Curiosity Nano Review】 Flashing Light
- Slappy.io, a web development environment for CircuitPython