EFeru / hoverboard-firmware-hack-FOC

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

Update interrupt priorities so ADC can not get preempted #496

Open CatoLynx opened 5 months ago

CatoLynx commented 5 months 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 5 months ago

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

Candas1 commented 5 months 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