Skip to content
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

Line Sensor Error Handling #49

Open
Kython89 opened this issue Mar 27, 2019 · 1 comment
Open

Line Sensor Error Handling #49

Kython89 opened this issue Mar 27, 2019 · 1 comment

Comments

@Kython89
Copy link
Contributor

Investigate the root cause of the line sensor seemingly dying.
Detect a dead line sensor in code.
Ignore the line sensor when dead.

Bonus: Ability to reset the line sensor if it dies.

@Kython89
Copy link
Contributor Author

https://github.com/wpilibsuite/allwpilib/blob/master/wpilibc/src/main/native/include/frc/Counter.h
The following options on the counter should let us easily detect a missing PWM.

We want to update the period when pulses stop.

 void SetUpdateWhenEmpty(bool enabled);

Max period should be set based off of the PWM frequency. I would recommend a 2x safety factor.

void SetMaxPeriod(double maxPeriod) override;

Once the max period is set and the update when empty is enabled the following should tell us if the sensor is working. If GetStopped returns true then the PWM is no longer being sent from the Teensy.

bool GetStopped() const override;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant