With the continuous updating of programmable controller(PLC)technology,PLC has become the cornerstone of the whole industrial system.While the PLC market continues to expand,the domestic PLC market share is less than 5%,and there is also a big gap in the technical level compared to foreign PLC.In this thesis,a small embedded programmable controller is developed.The design scheme is given in terms of hardware construction,embedded software and ladder diagram programming software,and the direction of embedded PLC localization is explored.The main research contents are as follows:(1)STM32F103RCT6 chip based on ARM is selected as the central processing unit,and the functions of power supply,input and output,serial communication and download of PLC are built around this chip.The research draw the corresponding schematic diagram according to the electrical rules,generate PCB board and make the physical object,and debug the performance of each hardware module.(2)The research write embedded PLC software programs,and configure it around four parts: initialization module,register,input/output module,communication and download module.Self-check,initialization,cycle scan and timer interrupt of embedded system are realized.The register and port functions of embedded system are configured,and the logic instruction response is set to realize the system scanning,reading and output refreshing.The research configure the communication between the controller and the programming software and download the storage address.The special simplex protocol instruction suitable for embedded PLC system is developed to realize the value reading and rewriting of soft components and registers.(3)The ladder diagram programming software was built.The programming software interface is built based on Visual Studio 2019 C# NET.Framework environment,and the ladder diagram program is created,compiled and saved.The trapezoidal graph is stored as AOV data structure by AOV map simplification method,and the function of transforming instruction table of trapezoidal graph is realized after traversal.The function of converting instruction table into binary instruction table is realized by referring to the execution encoding data structure table.(4)Aiming at the problem that PID module in traditional PLC is insufficient to deal with integral saturation,a fuzzy fractional order PID control instruction with self-tuning parameters is studied in embedded PLC.Compared with traditional PID module,this instruction is not affected by integral saturation.Taking the hard arm precision digging system of dredger as the object,MATLAB comparison simulation is carried out to analyze the parameter self-tuning qualitative energy and control performance of fuzzy fractional PID control instruction module.Finally,the ladder diagram program and operation mode of fuzzy fractional PID instruction are designed in embedded PLC system.The fuzzy control module is developed. |