步進電機控制程序編寫 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弧線數值表、遏制步進電機啟用、遏止的視頻,從視頻上不妨鮮明看到啟用時慢加快->快加快->慢加快的進程,以及遏止時慢放慢->快放慢->慢放慢的進程 。

推薦閱讀