View unanswered posts | View active topics It is currently Sun May 27, 2018 11:41 pm






Reply to topic  [ 1 post ] 
Perfect Cable Winding Mechanism Code Script 
Author Message
Rookie

Joined: Sun Jan 17, 2016 12:20 am
Posts: 6
Post Perfect Cable Winding Mechanism Code Script
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.

I want to share my first project that I did for my cable winding mechanism
This machine will go down or up by press bump1 or bump2, also it can change the directions when I press different bumps
Sonar1 controls the length of down and sonar2 controls the length of up
Machine will stop winding no matter what when I press limitswitch, and it will start again by press either bumps
The max and min range for this winding machine is 20cm~60cm, it won't go more or less

This is very accurate(+-1cm) and much better than use encoder, because it won't get effect by the rope axis

Code:
   while(1==1)
   {
      while(SensorValue(Sonar1)<60 && SensorValue(limit)==0   && SensorValue(bump2)==0)
      {
         if(SensorValue(bump1)==1)
         {
            stopMotor(Motor);
            wait(0.2);
            startMotor(Motor, 63);
         }
      }

      stopMotor(Motor);

      while(SensorValue(Sonar2)>20 && SensorValue(limit)==0 && SensorValue(bump1)==0)
      {
         if(SensorValue(bump2)==1)
         {
            stopMotor(Motor);
            wait(0.2);
            startMotor(Motor, -63);
         }
      }


      stopMotor(Motor);

   }


Hope you will like, thank you. :lol:


Sat Feb 06, 2016 12:22 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

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:  
cron



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