Quote:
Originally posted by Mike o.
Hey all! Alright I have a question about measuring the values in the code. When you put the program into the bot and your using a motor to rotate you put in the number that will rotate the motor the right amount right?
|
Maybe a little clarification is needed here. When your program outputs a number to the PWM, it applies a voltage to the motor that make the motor turn at a speed for the given load on the motor. If your load on the motor changes so dose the speed. If I understand your question, you want to rotate the motor a certain distance. To do this you would have to have something that could provide a time reference to your program and the motor load would have to remain constant. I’m sure you are starting to see the problems in this method on controlling distance.
Now a better way. As was referred by the other members, feedback control. Try using limit switches or a potentiometer input to limit the travel of the motor. Limit switches can be used if the travel distance is fixed. Potentiometer feedback can be used if the distance will be variable.
I hope this helps