| A new electromechanical control system of CAI is put forward in this paper. It is a system which absorbs the electromechanical control of Arduino and designed for course teaching tending to the mechanical and electrical professionals, basing on the analysis of hardware system and software development environment concerning Arduino. It changes the traditional mode that repeated download for updating the software and advantages in user-friendly control and stable operation, which can realize the function of man-machine interaction by the included serial monitor of Arduino. It can improve the beginner to learn faster and easier and motivate the learning interest greatly. The absorbing Arduino in the course teaching will enhance the quality of instruction and promote the responding efficiency. Furthermore, it obtains a good influence in the classroom teaching. The main research contents is be summarized as the following respects:By analysing the needs of CAI of electromechanical system, the overall architecture of CAI system is presented in the paper, and the total design scheme of Arduino terminal interpreter procedure is also presented. After the introduction of the Arduino hardware, software development environment and the interpretation of the Arduino kernel program, the command interpreter is designed according to the principle of finite-state machine. Additionally, the design development of the calling interface about Library function and the communication protocol about Arduino serial port is conducted, which realizes the high/low- level reading and writing of digital ports, the PWM wave writing of simulation port, and the given pulse-number writing of Arduino. It thus satisfied the majority of the functionality regarding the course teaching of mechanical and electrical professionals.For the application of more complex environment, the multitasking control based on Arduino is put forward, which according to the safe and reliable hybrid dispatcher. On the basis of the characteristic of the cooperative dispatcher and preemptive dispatcher, a hybrid dispatcher is designed, which owns the advantages of two above dispatchers. Moreover, the consist of hybrid dispatcher, such as the data structure, initialization function, interrupt service routine,adding-tasks function, scheduling-tasks function and the deleting-tasks function is elaborated in detail. At last, the adding and deleting tasks of serial communication protocol is designed for achieving the multitasking of man-machine interaction, which increases the application of CAI system.Aim at the design of the application layer about the mechanical and electrical control of CAI system and the analysis of the hardware system composition and theory about the stepping motorand steering engine, it can control the direction, position and speed of stepping motor and the steering angle of the steering engine. The added pulse counter in the positioning control of stepping motor can be used for querying the location of the machine by the location-query command and resetting the pulse counter by position reset command. This system can also embed in the mechanical and electrical equipment, such as the intelligent mobile robots and 3d printer, which has an important meaning to research. |