Hi, im not sure if this is the right thread but, im trying to create a levitating propeller that levitates at a setpoint (chosen known distance from vertical platform) and im having trouble trying to control the motor. I am using a brushless dc motor, arduino uno, and a ultrasonic sensor. Is there a way to control the motor without a potentiometer?
Im not much of a programmer but i am thinking of something along the lines of:
setpoint = 30
pid for motor
//motor turns on
if sensor (not equal) setpoint
if sensor (less then) setpoint
increase motor speed
else // sensor (greater than setpoint)
decrease motor speed
else // (sensor = setpoint)
hold motor speed
end
Can you simply tell the motor what velocity you want and then hold its speed using a delay? The goal is to use a pid controller for the motor to optimize its performance to reach its setpoint.