Forum Comments

J2 and J5 motor issues
In Questions
hh.Lee
Feb 08, 2019
I have the problem of J1 and J6 where both won't perform calibration, or somehow turn very slow in single direction when manual jog. I also checked all connection signal seems ok. Finally I decide to change arduino sketch code just to make sure the correct limit switch is match to mega signal pin. With new code below I managed to nail down the problem is due to I misplace limit switch 1 and 6. Below is the the code I change just to facilitate to check my limit switch:- 1) Remark the below section code. Need to adjust back to original after testing /* //test led if (digitalRead(J1calPin) == HIGH || digitalRead(J2calPin) == HIGH || digitalRead(J3calPin) == HIGH || digitalRead(J4calPin) == HIGH || digitalRead(J5calPin) == HIGH || digitalRead(J6calPin) == HIGH) { digitalWrite(J6dirPin, HIGH); } else { digitalWrite(J6dirPin, LOW); } */ 2) Add below code. The below code is just for testing on the correct limit switch. if (digitalRead(J1calPin) == HIGH || digitalRead(J2calPin) == HIGH || digitalRead(J3calPin) == HIGH || digitalRead(J4calPin) == HIGH || digitalRead(J5calPin) == HIGH || digitalRead(J6calPin) == HIGH) { int BlinkCount=0; //test led J1 if (digitalRead(J1calPin) == HIGH) { BlinkCount=1; } //test led J2 if (digitalRead(J2calPin) == HIGH) { BlinkCount=2; } //test led J3 if (digitalRead(J3calPin) == HIGH) { BlinkCount=3; } //test led J4 if (digitalRead(J4calPin) == HIGH) { BlinkCount=4; } //test led J5 if (digitalRead(J5calPin) == HIGH) { BlinkCount=5; } //test led J6 if (digitalRead(J6calPin) == HIGH) { BlinkCount=6; } for (int i=0;i<BlinkCount;i++) { digitalWrite(J6dirPin, HIGH); delay(200); digitalWrite(J6dirPin, LOW); delay(200); } delay(1000); } else { digitalWrite(J6dirPin, LOW); } After upload the new code. When I press on limit switch 1, it blick once, when press limit switch 6, it blink 6 times follow by one lone pause. This is for me to make sure I have all my limit switch correct link to mega pin number. After I found out my problem I exchange my limit switch 1 and 6 signal. then my problem solved and my J1 and J6 motor turn ok and able to perform calibration. I unremark the original code and remark new code (secion 2 above) and upload again before continue my calibration and testing of AR2. I am sorry if your problem is not the same like mine. However you can give it a try. I suspect it could be due the J2 and J5 limit switch signal is misplaced. Thks & Rgds...HHLee
0
0

hh.Lee

More actions