ciao, allora, il PID è sufficiente, ho visto tantissimi progettini come il tuo usarlo.
I first used the rectangle method for integration but now I've preferred the trapezoid method to minimize the error: what I've found out is that most of the error comes from (1) the sensor and (2) ADC approximation.
Anyone going to replicate this robot should use an angle sensor (maybe I2C based) instead of a gyroscope; integration is bringing avoidable error.
a quanto piare lui usa Regola del trapezio - Wikipedia , ma visto che tu hai una IMU non ti serve.
edit: come non detto
Lui sta mettendo in stato un pò di valori; posiszione stimata? velocità lineare, e un paio di altre cose, poi le moltoplica con il fattore K (quindi è la P di un pid) e le somma per ottenere la forza finale.. non ho idea da che csa sia partito per fare ciò, che io sappia basta un pid sull'angolazione, ma magari lui ha voluto aggiungere robe per poter controllare la posizione, e la cosa mi sfugge