View unanswered posts | View active topics It is currently Wed Feb 26, 2020 10:39 am

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
Rookie

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

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

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

Joined: Tue May 19, 2015 3:07 pm
Posts: 91
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
Display posts from previous:  Sort by
 Page 1 of 1 [ 4 posts ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

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

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning