Software design of electric control system for the

2022-10-03
  • Detail

6. Software design of electronic control system of DOF motion platform

the main functions of the main controller include two parts: communication with the upper computer and monitoring the slave controller using can communication. The controller software mainly includes the main program and can interrupt service subroutine. The software adopts modular design, as shown in in in 6. In the main program, the initialization of the module must be completed first, and then the main tasks to be completed include the interrupt and corresponding register setting of can module and SPL module, as well as the high repeatability of clock test; The latter is cheap configuration, declaration and initialization of variables. D. the contact gauge measurement method will have a great impact on the tensile test of the sample. The register configuration of spic30f6012 a mainly includes: system clock configuration, system reset setting, watchdog setting and PWM output setting. After the initialization of the main controller, start the SPL interrupt to receive the attitude command sent by the upper computer. When the master controller receives the attitude command, it calculates the position inverse solution, and then sends the position command of each electric cylinder to the corresponding slave controller through the CAN bus, and the slave controller completes the position closed loop of each corresponding electric cylinder. Wait for can receiving interrupt in the main program cycle, judge the data type in the can interrupt service subroutine, classify, package and send it to the upper computer

however, the sensor adopted by Shanghai xinrenda Instrument Co., Ltd. is an American

servo slave controller, which mainly completes the can communication with the master controller and drives the servo electric cylinder to execute the instructions sent by the superior. The whole control software is composed of the main program and the interrupt service subroutine of each module. The CAN bus communication of servo driver adopts the mode of timing sending and interrupt receiving. The real-time displacement value of the electric cylinder is sent to the main controller by executing the timer 0 timed interrupt service subroutine. In recent 10 years, the medium and short cycle of tim-er0 is set to l ins. The timing transmission subroutine is shown in Figure 7

the can module configured with DSP will generate receiving interrupt after receiving the can message. In the interrupt service subroutine, read the contents of the can buffer register and unpack the data, judge different types of data packets, and update the target location value variable. The interrupt receiving subroutine is shown in Figure 8

when the PWM counter is set to zero in the PWM module initialization program, the interrupt frequency is l o kHz, that is, the interrupt occurs every 0.1 Ms. PWM interrupt processing program is the most important part of the whole control software. The interrupt processing program mainly completes the following functions:

(1) rotor position identification, providing reliable commutation information for the electric cylinder

(2) convert the real-time displacement of the electric cylinder through the rotor position information

(3) position closed-loop PID calculation, update PWM duty cycle and adjust motor speed according to PID calculation results

the block diagrams of PWM interrupt service subroutine, PID calculation subroutine and rotor position identification subroutine are shown in Figure 9 respectively

when IPM module has faults such as undervoltage, overtemperature and overcurrent, fault signal will output low level, which triggers Intl interrupt. In the Intl interrupt service subroutine, DSP turns off the PWM module output, controls to turn on the fault alarm lamp, and sends the fault code to the upper computer through can communication

Copyright © 2011 JIN SHI