hai guyz,
i want to control a analog output with PID controller but input must be digital input from sensor. help me to finish this task....
this is pretty easy.
based on the quality and details you gave,
here is what you need to do.
connect your digital input to the arduino.
connect your output to the arduino, you may need to use an interface
then program the arduino to read
program the arduino to use PID
if you want more detailed information, you have to tell us more about what devices you have.
Thanks Friend.
am using four sensor to detect the obstacles based on sensor output the speed in motor has to be changed. here sensor used as a switch(digital input). sensor output will be yes/no (0/1) condition.
using this condition output of PID controller has to be made. do you have any code means help me. am new to arduino with PID controller.
it does not sound like you need PID.
you have 4 inputs, all digital.
these represent obstacles.
when an obstacle is encountered, the motor only needs to start to move until the obstacle value returns to normal.
PID is not used on digital inputs in this way. simple on/off control is.
since there is no analog value, there is no analog feedback.
if your actions seem jerky, just ramp up and ramp down in motor speed.
Hi,
I think what you are referring to is PWM, control of the motor.
Each of the four digital inputs means a different motor speed?
What is the application, what are you sensing the location of and why do you need to change the motor speed.
Is it to do with obstacle avoidance or separation, like between moving objects.
The full picture please so we can give you quick and accurate answers
Thanks.. Tom.... ![]()
i read one paper in that a guy used 6 sensors t0 control robot with line follower and PID
arulnanopix:
Thanks Friend.am using four sensor to detect the obstacles based on sensor output the speed in motor has to be changed. here sensor used as a switch(digital input). sensor output will be yes/no (0/1) condition.
using this condition output of PID controller has to be made. do you have any code means help me. am new to arduino with PID controller.
this seems contradictory.
sensor will be on/off output that is yes/no is digital.
PID requires analog feedback,
A simple fuzzy type logic would work after a fashion.
since you have 4 line sensors, you either have one center and two wingmen, or you do not know if you are on the line, but assume you are if the wingmen do no show the line. or you have T arrangement. this is pure guessing.
the better information you offer, the better we can figure what will work.
As for simple line following, there are lots of bits on the web about line following.
I will offer that the more sensors you have the better your control will be.
Do you have any example for this project...