Single-chip microcomputers can be programmed in assembly language, high-level languages C and Basic, or graphical languages. Programmable controllers are widely used in industrial control. The microcontrollers in their CPU modules are often ordinary single-chip microcomputers, while programmable controllers can be programmed in ladder diagrams or flowcharts. The current intelligent educational robot controllers all use single-chip microcomputers, and most of these robots support flowchart programming. The Ability Storm series robots of Shanghai Guangmaoda Electronic Information Co., Ltd. use VJC visual flowcharts and C language programming; the Zhongming robot series uses Robot Express software programming, which is also a visual flowchart and C language programming; the Lego series of Simia, Bosiweilong robots, the VEX series robots of the United States, and the robot DIY series of Ssangyong can all be programmed in visual flowcharts and C language. The core of the control system of these robots is a single-chip microcomputer. It can be seen from this that the development of ordinary single-chip microcomputers can definitely use flowchart programming. In fact, the flowchart compilation software of the robot can be used as the programming software of the corresponding single-chip microcomputer in turn. The following example uses a detailed explanation of how to use graphical programming for single-chip microcomputers.
1 Problem Description
On a certain machine, two motors drive the workbench to move sequentially through ball screws, as shown in Figure 1. The two motors are controlled by a single-chip microcomputer system to achieve the specified sequential action. When the travel switch KX1 is pressed, motor D1 drives the clamping mechanism to move right. When it moves right to the impact block pressing KX2, motor D1 stops, and this state is delayed for a period of time T1. Motor D2 starts to move in the following order: when the travel switch KX3 is pressed, motor D2 drives the workbench to move right. When the workbench moves right to the impact block pressing KX4, motor D2 stops, and this state is delayed for a period of time T2; then motor D2 reverses and drives the workbench back to the left. When the workbench returns to the left and presses KX3, motor D2 stops, and motor D1 reverses at the same time, loosens the clamping mechanism until KX1 is pressed, and motor D1 stops.
Figure 1 Sequential actions of the clamping mechanism and the workbench
The sequence is shown in Figure 2.
Figure 2 Action sequence diagram
2. Composition of single chip microcomputer control system
There are many schemes to realize the above control functions, such as relay contactor control system, programmable controller control system, single-chip microcomputer control system, etc. This paper uses single-chip microcomputer control system to realize the above control action. The composition of single-chip microcomputer control system is shown in Figure 3.
Figure 3 MCU control system structure diagram
The single-chip microcomputer uses the MC68HC11E1 of Motorola. In order to meet the needs of the simulation experiment, the single-chip microcomputer control system uses the main control board of the Ability Storm robot ASUII of Shanghai Guangmaoda Electronic Information Co., Ltd. The travel switches KX1~KX4 are simulated by the collision switches on the robot, and the collision switch circuit is shown in Figure 4(a). The motors D1 and D2 are simulated by the driving motors of the two wheels of the robot, and the circuit is shown in Figure 4(b). Among them, the motor drive chip selected is SN754410 of TI.
Figure 4. Collision switch circuit and drive motor circuit on the AbilityStorm robot
3 VJC Procedure Flow
Use the programming development environment VJC1.6 of the Ability Storm robot (which can be downloaded from the website of Shanghai Grandar Electronic Information Co., Ltd. www.grandar.com ) to compile, debug and download the program. For the above-mentioned single-chip dual-motor start-stop control system, the flowchart compiled by VJC1.6 is shown in Figure 5. For the actual single-chip control system, as long as the corresponding sensors and their drive circuits, motors and their drive circuits are changed to components that adapt to the actual object, this single-chip control board and corresponding programming software can still be used. Further applications can expand the software and hardware system.
The overall program is a cyclic program. In each cycle, the four collision switches are detected in turn, and the motor is started or stopped according to the motor's action sequence. The use of program modules and the setting of variables are omitted here. Please refer to the manual or contact Shanghai Guangmaoda Electronic Information Co., Ltd.
The flowchart of FIG5 can be converted into a C language program in the VJC1.6 environment. For details, please refer to the use of VJC1.6.
Programs compiled in the VJC1.6 environment, whether flowcharts or C language programs, can be directly downloaded to the flash memory or EEPROM of the microcontroller, which is why this programming and development method is popular. However, this method is currently only used in the program development of intelligent robots with microcontrollers as the core. There is no such graphical programming environment specifically for microcontroller development. I believe that this method will appear in the near future.
Figure 5 Dual motor start-stop control flow chart
Conclusion
The functions realized by the single-chip microcomputer system here are equivalent to a programmable controller system, and the programming language is a flowchart language. It can be seen that some single-chip microcomputer systems can be slightly expanded to become a fully functional programmable controller that can use flowchart programming, C language programming and assembly language programming, thus keeping pace with existing programmable controllers in the field of industrial control.
Previous article:1-wire system TM card single chip equivalent replacement
Next article:Clock Synchronization in Distributed Data Acquisition Systems
Recommended ReadingLatest update time:2024-11-17 04:54
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- 【Ended】Microchip Live Broadcast|Unveiling the ISA/IEC 62443 Safety Standard for Industrial Systems
- OEM or research lab? Where does innovation come from?
- Sharing of wireless quality resources!
- Comparison of main control with storage chip SD NAND and eMMC
- There is a small thing in the water heater. If you don't pay attention, it can consume 1000 degrees of electricity in a month???
- Based on GD32E231 smart door lock
- Award: ST MEMS Sensor Forum User Survey
- CC2640R2F supports Alibaba Cloud Link IoT platform
- [Recommendation] Improvement of switching power supply protection circuit based on UC3842 (3)
- Switching Converter Dynamics: Modeling, Analysis, and Control