基于单片机的小球平衡控制系统实验设计

Design of MCU-based Small Ball Balance Control System Experiment

  • 摘要: 针对综合设计型实验课程,研制了一套小球平衡控制的实验系统。该系统以单片机STC12C5A60S2为核心处理器,通过外设PWM占空比的调整控制风扇转速,从而调整风速的大小,利用超声波测量距离传感器测量小球在管内位置并反馈给单片机,单片机通过PID算法计算出所需要的PWM占空比驱动风扇,形成完整的闭环控制系统。PID系数整定采用Z-N系数法整定,整个系统实现了快速稳定控制小球在中心位置。

     

    Abstract: In view of the comprehensive design experiment course, an experimental system of small ball balance control is developed. The system, with the STC12C5A60S2 as the core processor of the system, adjusts the wind speed through the adjustment of the peripheral PWM duty cycle. The ultrasonic measuring distance sensor is used to measure the position of the small ball in the tube and give feedback to the MCU. Next, the MCU calculates the PWM duty cycle needed to drive the fan via PID algorithm, thus forming a complete closed-loop control system. The whole system, adopting the Z-N coefficient method in the PID parameter tuning, realizes the fast and stable control of the small ball in the central location.

     

/

返回文章
返回