controling air cylinder with a joystick.
thank reading this.
i having problems controlling air cylinder moving heavy weight joystick. program below cylinder overshooting , undershooting desired positions in gradually decreasing amounts 3 or 4 times until reaches desired position. part of must compressibility of air in cylinder (the cylinder reacts kind of spring). love other ways of looking @ problem.
i having problems controlling air cylinder moving heavy weight joystick. program below cylinder overshooting , undershooting desired positions in gradually decreasing amounts 3 or 4 times until reaches desired position. part of must compressibility of air in cylinder (the cylinder reacts kind of spring). love other ways of looking @ problem.
code: [select]
// control dual acting air cylinder (one way pushes/ 1 way pulls) joystick
void setup() {
int joystickpot =0;
int aircylinderpot =0;
pinmode(5,output); //retract cylinder valve
pinmode(6,output); //extend cylinder valve
}
void loop() {
int joystickpot=analogread(a0); //reads joystick potentionmeter
int aircylinderpot=analogread(a1); //reads positional pototentionmeter on air cylinder
int diff=joystickpot-aircylinderpot; //is difference between joystick , aircylinder positions
if (diff<-100){analogwrite(6,250);} // open air cylinder extend valve fully
if (diff<=-50 && diff>-100){analogwrite(6,100);} //open air cylinder extend valve halfway
if (diff<=-10 && diff>-50){analogwrite(6,50);} //open air cylinder extend valve slightly
if (diff>-10 && diff<10){analogwrite(6,0);analogwrite(5,0);} //if joystick , cylinder position close each other close air cylinder valves.
if (diff>=10 && diff<50){analogwrite(5,50);} //open air cylinder retract valve slightly
if (diff>= 50 && diff<100){analogwrite(5,100);} //open air cylinder retract valve halfway
if (diff>=100){analogwrite(5,250);} //open air cylinder retract valve fully
}
you have answer. need develop way anticipate movement location want weight , reverse air slow , stop weight. can joystick? don't know. problems three: compressiblity of gas, temperature of gas , inertia of weight. guess there fourth, distance move weight. perhaps 5th, direction move weight.
quite list.
paul
quite list.
paul
Arduino Forum > Using Arduino > Project Guidance > controling air cylinder with a joystick.
arduino
Comments
Post a Comment