Bumblefuck / HBR-Proportional-Valve

This is an arduino C sketch for controlling a proportional valve with potentiometer joy stick
27 stars 11 forks source link

X and Y joystick values of exactly zero may be ignored. #4

Closed googolp closed 8 years ago

googolp commented 8 years ago

There is a missing case where a value of zero will pass though all of the if conditions and the analog output will remain unchanged.

queuetue commented 8 years ago

Although this deserves some consideration (seeing as we're swinging steel around with man-crushing power), the only time you're likely to see a perfect zero with an analog control is when a ground wire breaks.

This probably falls into a larger class of "error response" handling - ie, what we do when someone hits a "soft" error condition and how best to assume we're not killing anyone that can't reach the do-not-kill switch.

@Bumblefuck how much consideration do you want wrt not making human paste?

Bumblefuck commented 8 years ago

meh. I'll make a sign. ;)

On Thu, Apr 14, 2016 at 7:08 AM, Scott Russell notifications@github.com wrote:

Although this deserves some consideration (seeing as we're swinging steel around with man-crushing power), the only time you're likely to see a perfect zero with an analog control is when a ground wire breaks.

This probably falls into a larger class of "error response" handling - ie, what we do when someone hits a "soft" error condition and how best to assume we're not killing anyone that can't reach the kill switch.

@Bumblefuck https://github.com/Bumblefuck how much consideration do you want wrt not making human paste?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Bumblefuck/HBR-Proportional-Valve/issues/4#issuecomment-209960900

googolp commented 8 years ago

I agree that it is unlikely to read a true analog 0, but in this case it is a joystick position 0 that causes the error. A joystick position 0 is actually an ADC reading of 520 if I understand the code correctly.

Bumblefuck commented 8 years ago

But really, yes; excellent idea. I think that soft faults should just trigger the e-stop loop. It would be nice to have a couple leds orange for faults, red for e-stop. Later we could get the leds to blink at different rates to indicate various fault conditions. But that's in the "later" column.

On Thu, Apr 14, 2016 at 7:24 AM, Arduino Evil arduinoversusevil@gmail.com wrote:

meh. I'll make a sign. ;)

On Thu, Apr 14, 2016 at 7:08 AM, Scott Russell notifications@github.com wrote:

Although this deserves some consideration (seeing as we're swinging steel around with man-crushing power), the only time you're likely to see a perfect zero with an analog control is when a ground wire breaks.

This probably falls into a larger class of "error response" handling - ie, what we do when someone hits a "soft" error condition and how best to assume we're not killing anyone that can't reach the kill switch.

@Bumblefuck https://github.com/Bumblefuck how much consideration do you want wrt not making human paste?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Bumblefuck/HBR-Proportional-Valve/issues/4#issuecomment-209960900

googolp commented 8 years ago

@Bumblefuck

The sign can read: DANGER DUE TO: off by one error

queuetue commented 8 years ago

CAUTION: Human paste manufacturing area. Please wear squints.

googolp commented 8 years ago

Additional safety can be had by getting a joystick with dual wipers on each axis. If the wipers disagree by a certain margin an error condition can be asserted.

This might be overkill if the joystick is just for temporary prototyping purposes.

Bumblefuck commented 8 years ago

​​

On Thu, Apr 14, 2016 at 7:29 AM, Scott Russell notifications@github.com wrote:

CAUTION: Human paste manufacturing area. Please wear squints.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Bumblefuck/HBR-Proportional-Valve/issues/4#issuecomment-209970379

vector76 commented 8 years ago

Along the lines of emergency stop I might offer another idea: a second arduino that controls emergency shutdown (mini is super cheap). Primary arduino could send a pulsed signal meaning "everything ok" and if the pulses ever stop coming (or if the emergency button is pressed), secondary arduino performs the E-stop. If primary arduino has any chance of getting hung or in some other bad state (perhaps likely if it's under heavy development) the secondary arduino E-stop feature is still assured to be intact. If the primary arduino loses its mind, that's the worst time for the emergency stop button to quit working.

Bumblefuck commented 8 years ago

Very clever! Yes! On Apr 15, 2016 10:21 PM, "Jamie" notifications@github.com wrote:

Along the lines of emergency stop I might offer another idea: a second arduino that controls emergency shutdown (mini is super cheap). Primary arduino could send a pulsed signal meaning "everything ok" and if the pulses ever stop coming (or if the emergency button is pressed), secondary arduino performs the E-stop. If primary arduino has any chance of getting hung or in some other bad state (perhaps likely if it's under heavy development) the secondary arduino E-stop feature is still assured to be intact. If the primary arduino loses its mind, that's the worst time for the emergency stop button to quit working.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Bumblefuck/HBR-Proportional-Valve/issues/4#issuecomment-210738834

Bumblefuck commented 8 years ago

And visa versa... both units should be capable of triggering e stop if either unit stops pinging. But I still think the panic button should just kill all power. It' s not inconceivable that both units would crap out in tandem. On Apr 16, 2016 12:18 AM, "Arduino Evil" arduinoversusevil@gmail.com wrote:

Very clever! Yes! On Apr 15, 2016 10:21 PM, "Jamie" notifications@github.com wrote:

Along the lines of emergency stop I might offer another idea: a second arduino that controls emergency shutdown (mini is super cheap). Primary arduino could send a pulsed signal meaning "everything ok" and if the pulses ever stop coming (or if the emergency button is pressed), secondary arduino performs the E-stop. If primary arduino has any chance of getting hung or in some other bad state (perhaps likely if it's under heavy development) the secondary arduino E-stop feature is still assured to be intact. If the primary arduino loses its mind, that's the worst time for the emergency stop button to quit working.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Bumblefuck/HBR-Proportional-Valve/issues/4#issuecomment-210738834

DanNixon commented 8 years ago

@vector76 This could be done using the watchdog timer, there is really no need for a second arduino.

This approach protects against both hardware and software faults, two devices running identical code are vulnerable to the same software issues.

DanNixon commented 8 years ago

The original issue was a significant oversight and is fixed in the referenced PR.

googolp commented 8 years ago

Thank you @DanNixon.