步进电机控制程序编写 stm32步进电机控制程序系统( 二 )

<= (motor->steps + motor->stopremainstep)){motor->runstate = MOTOR_RUN_STATE_DEC;motor->runtimer = 0;}motor->runsnapfreq = freq; }else{ if(motor->runtimer >= motor->stoptime){freq = motor->stopfreq;}else{freq = fnMC_GetFreq(motor->runtimer, motor->halfstoptime, motor->alpha, motor->runsnapfreq, motor->stopfreq);//U16 n,U16 halftn,U16 alpha,U16 maxfreq,U16 minfreq)} }if(motor->steps >= motor->totalstep) {motor->starting = FALSE; }if(FALSE == motor->starting) { MOTOR_A_DISABLE(); }else{ motor->curfrequency = freq; fnMT_Cal_MotorA_TimeConf(); }试验
底下是天生S弧线数值表、遏制步进电机启用、遏止的视频,从视频上不妨鲜明看到启用时慢加快->快加快->慢加快的进程,以及遏止时慢放慢->快放慢->慢放慢的进程 。

推荐阅读