1 / 5

inicio

inicio. e rror = set point - roll. inicializar PWM. pterm = error* Kp. inicializar USART. Iterm = istate.Ki. motores = 0%. d term = (error- error_old )* Kd. Comando de START recibido ?. MOTOR A = pterm + iterm - dterm. no. MOTOR B = - pterm - iterm + dterm. si.

guido
Download Presentation

inicio

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. inicio error = set point - roll inicializar PWM pterm = error*Kp inicializar USART Iterm = istate.Ki motores= 0% dterm = (error-error_old)*Kd Comando de START recibido? MOTOR A = pterm + iterm - dterm no MOTOR B = -pterm - iterm + dterm si error_old = error PID GO? no Istate = istate + error si

  2. USART Rx Complete Interrupt In rxbuff count = (rxbuff & 0b11110000)>>4 handler= rxbuff & 0b00001111 count = 0 si CALL handler fin no In rxbuff param[count] = rxbuff count = count - 1

  3. Timer1 Compare A Handler Set PWM1A comosalida* Set PWM1B comosalida* Habilitar clock timer0 fin

  4. Timer1 Compare B Handler Set PWM1A comoentrada* Set PWM1B comoentrada* fin

  5. Timer0 Overflow Handler Deshabilitar clock timer0 Set flag PID_GO fin

More Related