View unanswered posts | View active topics It is currently Wed Jun 20, 2018 2:38 pm






Reply to topic  [ 4 posts ] 
Question About Cable Winding Mechanism 
Author Message
Rookie

Joined: Sun Jan 17, 2016 12:20 am
Posts: 6
Post 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?


Sun Jan 17, 2016 12:34 am
Profile
Moderator
Moderator

Joined: Tue May 19, 2015 3:07 pm
Posts: 91
Post 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.


Wed Jan 20, 2016 3:12 pm
Profile
Rookie

Joined: Sun Jan 17, 2016 12:20 am
Posts: 6
Post Re: Question About Cable Winding Mechanism
teacher said sonar is more accurate, because the encoder will affect by the axis.


Wed Jan 20, 2016 8:34 pm
Profile
Moderator
Moderator

Joined: Tue May 19, 2015 3:07 pm
Posts: 91
Post 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.


Thu Jan 21, 2016 10:07 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.