ROBOTC.net forumshttp://www.robotc.net/forums/ Question About Cable Winding Mechanismhttp://www.robotc.net/forums/viewtopic.php?f=11&t=13144 Page 1 of 1

Author:  SWEETMUSK [ Sun Jan 17, 2016 12:34 am ]
Post subject:  Question About Cable Winding Mechanism

we have the project that is due next week Friday
Cable Winding Mechanism
A telecommunications contractor need you team design a device that can accurately wind up a specific length of cable.
The device must be able to wind a specific length consistently. The device must also be able to be started and stopped(emergency) by using a switch.

what I think is:
I want to start the motor when I press bumb1
the motor will go -63 and 63 depends the value of SONAR<30 and SONAR>=30
If the length is 60, then will go up by auto. And if the length is 20, then it will go down by auto.
The bumb2 will stop the Motor no matter when the length is at
when I press the bumb2 again the motor will start again
*We have thing that is on the rope, so the Sonar will knows how far is it. But it has +-2cm
*We have to stop the motor first before we change the direction

this is what I wrote:
 Code:   while(1==1)   {      if(SensorValue(bump1)==1   &&   SensorValue(SONAR)<30)      {         stopMotor(Motor);         wait(0.2);         startMotor(Motor, -63);      }      if (SensorValue(bump1)==1 && SensorValue(SONAR)>=30)      {         stopMotor(Motor);         wait(0.2);         startMotor(Motor, 63);      }      while(SensorValue(SONAR)>=60)      {         stopMotor(Motor);         wait(0.2);         startMotor(Motor,63);      }      while(SensorValue(SONAR)<=20)      {         stopMotor(Motor);         wait(0.2);         startMotor(Motor,-63);      }      if(SensorValue(bump2)==1)      {         stopMotor(Motor);      }   }

is this right?

 Author: Tabor473 [ Wed Jan 20, 2016 3:12 pm ] Post subject: Re: Question About Cable Winding Mechanism Your program seems to do what you describe. Just by reading the goal my first thought is to use an encoder. Do you have one you could add? This seems it would be easier and more accurate than the sonar sensor.

 Author: SWEETMUSK [ Wed Jan 20, 2016 8:34 pm ] Post subject: Re: Question About Cable Winding Mechanism teacher said sonar is more accurate, because the encoder will affect by the axis.

 Author: Tabor473 [ Thu Jan 21, 2016 10:07 am ] Post subject: Re: Question About Cable Winding Mechanism Okay well that is fine. It is going to be similar either way. The most important thing is that currently the button will not stop the program the entire time that it is pressed. The other problem is that the robot is never satisfied with its winding. We are going to want a threshold that says when the program is satisfied with the sonar values. Something like 2 cm in each direction would be "good enough". I'll edit this post with a quick demonstration later today.

 Page 1 of 1 All times are UTC - 5 hours [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Grouphttp://www.phpbb.com/