MaslowCNC / Firmware

Maslow Firmware
GNU General Public License v3.0
261 stars 133 forks source link

Closed loop breakdown needs to send alert back to ground control. #277

Open JDogHerman opened 7 years ago

JDogHerman commented 7 years ago

When a motor is disconnected while ground control is running the firmware does not stop the run.

If a break in the closed loop fails the cut should be halted and not continue to run.

BarbourSmith commented 7 years ago

šŸ‘ I agree

I think the way to implement this is by watching both the applied voltage (_pidOutput) and the measured speed (_currentSpeed) variables in the MotorGearboxEncoder object

blurfl commented 7 years ago

Would this check be called from the main loop, and post a ā€˜!ā€™ stop if triggered?

BarbourSmith commented 7 years ago

If we called it from the compute speed function it would be easier I think. I love the idea of posting a '!'. That's a great way to reuse our existing stop apparatus!

blurfl commented 7 years ago

Iā€™ve looked into watching _currentSpeed and _pidOutput, but havenā€™t figured out a reasonable value of _pidOutput to use as a trigger. Can you suggest a value?

davidelang commented 7 years ago

On Fri, 4 Aug 2017, Scott Smith wrote:

Iā€™ve looked into watching _currentSpeed and _pidOutput, but havenā€™t figured out a reasonable value of _pidOutput to use as a trigger. Can you suggest a value?

Both motors hitting 100% for more than a few seconds??

blurfl commented 7 years ago

Ok, thanks. Iā€™ll give that a try.

On Aug 3, 2017, at 11:51 PM, David Lang notifications@github.com wrote:

On Fri, 4 Aug 2017, Scott Smith wrote:

Iā€™ve looked into watching _currentSpeed and _pidOutput, but havenā€™t figured out a reasonable value of _pidOutput to use as a trigger. Can you suggest a value?

Both motors hitting 100% for more than a few seconds?? ā€” You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

BarbourSmith commented 7 years ago

I've been imagining two criteria

1) The motor hitting 100% for a time period (1s?) ---> PID output is 255 2) The speed is zero ----> PID input is close to 0

From having watched both of them does that seem reasonable? It might not need to go all the way to 255

blurfl commented 7 years ago

I found that triggering on PID output > 1.5 and speed 0, the last part of a z movement tripped the trap (sticky motor slide? ;) ) I didnā€™t look at _howlong it had been in that state, though. That might be the key. Is 5 seconds reasonable?

BarbourSmith commented 7 years ago

I can see how we would need a time threshold too because the motor will momentarily be stopped right at the beginning and end of the move. I'd guess that 1 second or even 1/2 second should be enough. That seems like an eternity in for the microcontroller

blurfl commented 7 years ago

Iā€™ll play with some different values and report back šŸ™‚

JDogHerman commented 7 years ago

Just a follow up this appears to still exist on GC 0.87 and FW 0.87