加减速算法的分析及软件设计陈宝罗(西南交通大学 电气工程学院,四川 成都 610031)摘要: 运动控制系统在起始和停止阶段,应采纳合适的加减速算法以避开产生冲击、失步和振荡,以保证运动部件平稳准确定位。分析三种加减速算法,建立离散数学模型,从而优化软件实现,提高运算和控制效率,同时给出可实现的软件流程,并对三种算法进行比较,分析算法的缺陷和优势,得出 S 曲线是比较适用的算法。关键词:运动控制;梯形曲线;指数曲线;S 曲线;软件设计;analysis of accelerating and decelerating arithmetic and software designChen BaoluoElectric Engineering Academe Southwest, JiaoTong University ChengDu SiChuan 610031Abstract: Motion control system should adopt appropriate arithmetic to abstain shock, miss step, and surge on start and stop stage, so motion part is ensured orientation of placidity and nicety. The paper analyzed three kinds of accelerating and decelerating arithmetic, and established discrete mathematics model which bring optimal software design, operation, and efficiency of control, then showed the feasible flow charts for software design. Found that S shape curve is more appropriate than others by analyzing the three arithmetic .Key Word: Motion control ; trapezoid curve; exponent curve; S shape curve; software design;1.引言在运动控制中,加减速是一个重点。在加减速的过程中,希望达到在给定最高速度的情况下,加减速的时间越短越好,被控电机运转越平稳越好,同时在基于微处理器的数字控制中,要求控制算法的可实现性也要好。现代运动控制中,常用的加减速算法有三种,即梯形曲线,指数曲线,S 曲线。2.梯形速度曲线算法分析如图 1 所示是梯形速度曲线,包括三个阶段:恒加速阶段、匀速阶段、恒减速阶段。图 1 梯形速度和加速度曲线在加减速阶段的 v-t 的关系式可描述为:v = at。其中 a>0 是加速,a<0 是减速以下以加速阶段为例,来分析算法的软件实现。关系式:v = at (1)在给定最高速度 Vm 的情况下,可以算出具体的到达时间 Tm = Vm/a,在从坐标点(0,0)开始画轨迹,到达终点(Tm,Vm),所形成的轨...