1 Hardware structure design of embedded PLC
1.1 Selection of microcontroller chip
The CPU is the core of the PLC . It can recognize various instructions input by the user in a specific format, and according to the provisions of the instructions and the current state of the field I/O signal, it issues corresponding control instructions to complete the predetermined control tasks. This design uses the LPC2294 microcontroller produced by Philips. LPC2294 is a CPU chip based on 32-bit ARM7TDMI-S and supports real-time simulation and tracing. It has 256kB embedded high-speed Flash memory and 16kB on-chip SRAM. LPC2294 uses a 144-pin package, has extremely low power consumption and up to 112 general-purpose I/O ports, 9 edge or level-triggered external interrupt pins, a maximum of 60MHz working crystal oscillator, multiple 32-bit timers, PWM units, real-time clocks and watchdogs, 8-channel 10-bit ADCs with conversion times as low as 2.44μs, 4-way advanced CAN interfaces, and 2-way UART (16C550), high-speed I2 C (400kbit/s) and 2-way SPI buses. The LPC2294's rich hardware resources and complete functions make this microcontroller particularly suitable for automotive, industrial control applications, medical systems, and fault-tolerant maintenance buses.
1.2 Overall structure of the hardware system
This system uses the ARM chip LPC2294 as the CPU and is designed as a basic mode with 14 PNP inputs and 10 relay outputs. The overall hardware structure includes:
Power supply and reset module, ARM microcontroller, Flash memory expansion module, switch input and output module, analog input and output module, RS485 interface and CAN interface communication module, etc. The structure of the system is shown in Figure 1.
1.2.1 Switching input and output interface circuit
Figure 2 shows a diagram of a switch input. The front end of this circuit is a first-order filter circuit composed of R and C to prevent external interference signals from entering the system. The input control switch signal (DC 24V) connected to the input end is input to the input end of the optocoupler (PC816) through the input point 10.0 and the current limiting resistor. M is the common input end of the input points 10.0~10.7. Because the P0.23 port is set to input mode and there is no pull-up resistor inside the port line, an external pull-up resistor is required to prevent the port line from being suspended. When the 10.0 input terminal is 24V, the photodiode in the optocoupler is turned on, the output end of the phototransistor is pulled to a low level, the LED indicating the input status of this road is lit, and P0.23 is set to a low level. When the CPU accesses this signal, the value of the input process image register corresponding to the input point is set to 1. When the 10.0 input terminal is 0V, P0.23 is a high level. When the CPU accesses this signal, the value of the input process image register corresponding to the input point is set to 0. The circuits and working principles corresponding to the remaining input points are the same.
Figure 3 shows the relay output module diagram. The diode connected in parallel at both ends of the relay coil in the figure plays a freewheeling role. The working principle of this module is as follows: when the internal output process image register is, LPC2294 port P1.16 outputs 0, the phototransistor is turned on, the relay coil is energized, and the output point is connected; conversely, when the internal output process image register is 0, port P1.16 outputs 1, the relay coil is de-energized, and the output point is disconnected.
It should be noted that when the GPIO port of LPC2294 is first powered on, the voltage of its output port (such as P1.16 in this figure) is unstable, which can easily cause the external relay to malfunction and cause the external device to work unstably. For this reason, we designed the circuit in Figure 4 to improve the stability of the relay output.
This is a monostable circuit composed of NE555 timer, in which VCC5.0D is connected to the collector of the photocoupler in Figure 3. Its working principle is: when the system is powered on, the levels of pins 2 and 6 cannot change suddenly and remain at a low level. Analysis of the internal circuit of NE555 shows that at this time, the output pin 3 outputs a high level, and the circuit begins to charge the R and C circuits. As time goes by, the levels of pins 2 and 6 continue to rise. When it rises to 23VCC, the output pin 3 will flip to a low level, turning on the transistor, and VCC5.0D outputs 5V. In this way, after a period of time after the system is powered on, the level of the I/O port stabilizes, and the photocoupler is powered on and starts working. The duration tW of the temporary steady state depends on the size of the external resistor R and the capacitor C. tW is equal to the time required for the capacitor voltage to rise from 0 to 23VCC during the charging process, that is:
1.2.2 Analog input circuit design
First, the current signal output by the field sensor is converted into a 0~5V voltage signal for collection through resistor R66. Considering the anti-interference and protection of the microprocessor circuit, a linear optocoupler HCNR201 is added to the output end of the conversion circuit. The hardware circuit is shown in Figure 5.
1.2.3 Serial communication interface circuit design
In order to be compatible with other industrial control products, we adopted the RS-485 interface standard in our design. In order to convert the TTL level to the RS485 level, the SP485E transceiver was selected. The data transmission rate of the SP485E chip can be as high as 10Mbps. Its biggest feature is that it provides ESD protection circuits for the transmitter output and receiver input pins. The interface circuit is shown in Figure 6.
Previous article:Explain in detail the fundamental differences between JLINK and JTAG
Next article:AVR microcontroller-based smart home monitoring system improves living standards
- Popular Resources
- Popular amplifiers
- 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
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- 【Renovation of old things】 Finished product of graffiti desk lamp
- Prototyped a PCB expansion board
- [Practical sharing] Sharing of analog circuit diagrams commonly used by electronic engineers
- MSP432 MCU realizes speech recognition technology
- [Evaluation of EC-01F-Kit, an NB-IoT development board] - Temperature, humidity and atmospheric pressure equipment based on GD32F350 (completed)
- Dear experts, please help me, I can't figure out what's wrong
- Digital IC Power Supply Noise Suppression and Decoupling Application Note
- Are there any recommendations for cost-effective and stable GPS or Beidou chips?
- [micropython] BLE function is officially added to ESP32
- [RVB2601 Creative Application Development] 3. RGB three-color breathing light of RVB2601