New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad ignition module /noisy RPM input can crash AP by generating too many interrupts #15384
Comments
I've reproduced the problem by connecting a 921600 baud uart to the RPM input pin |
@tridge will check soon, please notify me when what @peterbarker pointed out is fixed. |
@AndKe it's fixed, ready for your testing |
@tridge - I tried to ask you on gitter;
|
This implements a max quota of GPIO interrupts per 100ms period to prevent high interrupt counts from consuming all CPU and causing a lockup. The limit is set as 10k interrupts per 0.1s period. That limit should be high enough for all reasonable uses of GPIO interrupt handlers while being below the level that causes significant CPU loads and flight issues This addresses issue #15384
@AndKe use gitk to cherry pick, and click the patch. You want this for 4.0.6 I presume? |
For Dev Call: Discussion as to adding this as our first User Alert. |
The patch works as intended, somewhere before 600kRPM pulses (RPM_SCALING = 1) there is no more RPM data - then you can see the signal generator approach pass 100khz around 1h 07m CPU load increases, and then the interrupt is not handled anymore until rebooted, saving the CubeBlack from reboot. tested on:
Thank you, please pull the patch into master. |
This implements a max quota of GPIO interrupts per 100ms period to prevent high interrupt counts from consuming all CPU and causing a lockup. The limit is set as 10k interrupts per 0.1s period. That limit should be high enough for all reasonable uses of GPIO interrupt handlers while being below the level that causes significant CPU loads and flight issues This addresses issue ArduPilot#15384
This implements a max quota of GPIO interrupts per 100ms period to prevent high interrupt counts from consuming all CPU and causing a lockup. The limit is set as 10k interrupts per 0.1s period. That limit should be high enough for all reasonable uses of GPIO interrupt handlers while being below the level that causes significant CPU loads and flight issues This addresses issue #15384
This implements a max quota of GPIO interrupts per 100ms period to prevent high interrupt counts from consuming all CPU and causing a lockup. The limit is set as 10k interrupts per 0.1s period. That limit should be high enough for all reasonable uses of GPIO interrupt handlers while being below the level that causes significant CPU loads and flight issues This addresses issue #15384
This implements a max quota of GPIO interrupts per 100ms period to prevent high interrupt counts from consuming all CPU and causing a lockup. The limit is set as 10k interrupts per 0.1s period. That limit should be high enough for all reasonable uses of GPIO interrupt handlers while being below the level that causes significant CPU loads and flight issues This addresses issue #15384
Issue details
At least using PCI 1.3 ICE ignition module , this issue is 100% reproducible.
http://www.falkon.cz/op.htm
RPM_TYPE=2
RPM_PIN=54
When this ignition module is unpowered, / looses power, it will try to come to life using the weak pullup power from the Cube.
Feeding this module weak power from a IO pin, it will try to come to life, and pull down the weak pullup, effectively generating a 1Mhz signal (for this to work, the ignition module must not have external power, just GND and RPM signal connected.)
In real life, this happens if the ignition module die, or it's power supply fail.
This happens because the ArduPilot spends way too much time in the interrupt handling routine.
Reproducing on bench, no ignition module needed:
Configure as mentioned above.
From a signal generator;
1: apply 12kHz signal, observe that the CPU load barely increases
2: apply 35kHz signal, observe that the CPU load reach 96%
3: apply 100kHz signal, observe that autopilot becomes unresponsive/crashes repetitively
Summary:
a ground loop, disconnected long wire in a noisy environment or defective RPM sensor or ignition module , can produce more interrupts that ArduPilot can handle, resulting in repetitive reboots and sluggish behavior in between those reboots.
Solution would be to temporarily disable IRQ if incoming signal is too fast.
Version
AP 4.0.6
Platform
[x] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Airframe type
5.5m Plane
Hardware type
Cube2
Logs
(none attached)
The text was updated successfully, but these errors were encountered: