Need Help Arduino controlled Stepper Motor Proportional Control Answered
Need help with a basic code I'm trying to make for a personal project, I'm new to Arduino and I find an example of this type of coding would be useful for me to learn off. Would like to get better at this programming stuff and move on to other types of coding.
Looked at the basics via the Arduino website but nothing really covered this method of control.
A stepper motors speed can be altered via the use of proportional control. The feedback sensor is a potentiometer, which should tell the stepper motor when to stop.
Here are the basics of what I know the code must contain
Kp = 1;// the gain of the proportional control must contain a multiple factor
error = Setpoint -actual position; // provides the error value
output = error*Kp; // this will provide the drive for the stepper
The stepper should stop when the setpoint value equals the actual value. So the stepper should move faster to its target the further away it is.
Using a ULN2004A for the driver and have this setup for the circuit.
Any help explaining or showing an example code upon how to accomplish this task would be appreciated. No idea how to make this affect the stepper speed or even do this control feedback. Am in need of some help.