EFeru / hoverboard-firmware-hack-FOC

With Field Oriented Control (FOC)
GNU General Public License v3.0
1.05k stars 876 forks source link

Update interrupt priorities so ADC can not get preempted #496

Open CatoLynx opened 3 weeks ago

CatoLynx commented 3 weeks ago

After running my vehicles with this change for quite a while now, I am confident in saying that this has fixed an issue that would cause random MOSFET shorts. I suspect that the overcurrent detection interrupt was just a tiny bit too slow because it was preempted. This commit fixes that.

Candas1 commented 3 weeks ago

Thanks for sharing, I will try it on my combat robot end of this month lol

Candas1 commented 3 weeks ago

I think it can make things worse for PWM and PPM variants, but ideally those variants should use input capture to not be impacted by the interrupt execution timing