I’m writing a program that will stop a motor from running once it recognizes the motor shaft broke a part it’s connected to. Just imagine the shaft is connected to a plastic device that’s connected to the wall and it’s supposed to break that plastic. That is to say, once the current on the motor will be suddenly reduced (since a load is no longer applied on it), it will stop. I have an arduino uno.
I haven’t converted it into a programming language yet, but here is the step by step, please tell me if it’s logical to you:
- User will press a button that will activate the motor (if button is pressed: motor on)
- Save the first current values as an integer
- Save the current ampere value every milisecond as an integer (not sure how I do that in terms of “every second”)
- I attach a plastic part on the motor’s shaft that it will need to break
And this is the core idea of the program:
##This is to make sure the motor feels a load and only then starts the test##
If Current_Amperes > Initial_Amperes +10
StartTest = true;
##This is so the motor would stop once it feels a drop of Amperes
If StartTest == true && If Current_Amperes < Initial_Amperes+5
StartTest = False;
So, 2 main questions:
- How does the overall approach sound?
- Which funcitons should I use to accomplish it?