View unanswered posts | View active topics It is currently Sun Aug 18, 2019 7:32 pm






Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Gripper Control Challenge 
Author Message
Rookie

Joined: Mon Jun 16, 2014 10:54 pm
Posts: 1
Post Gripper Control Challenge
Code:
forward(0.08,seconds, 50);
moveMotor(motor10; 315, degrees, 50);
moveMotor(motor10; -315, degree, 50);
moveMotor(motor11; 0.03, rotations, 50);
moveMotor(motor10; 315, degrees, 50);


After closing the gripper, the next line is never executed.

Does anyknow why?
I tried to set "0.028" rotations to motor 11, and yes the last line was executed. However, the box wasn't completely grabbed if I used 0.028


Tue Jun 17, 2014 5:03 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Gripper Control Challenge
Great Question. Use time instead of degrees or rotations to close the gripper on the object. That should take care of the problem for you.


Wed Jun 18, 2014 2:36 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post Re: Gripper Control Challenge
vtran40 wrote:
Code:
forward(0.08,seconds, 50);
moveMotor(motor10; 315, degrees, 50);
moveMotor(motor10; -315, degree, 50);
moveMotor(motor11; 0.03, rotations, 50);
moveMotor(motor10; 315, degrees, 50);



Something else to note; you want to make sure you are using commas after your motor port assignments, not semi-colons. Commas are used to separate parameters, while semi-colons designate the end of a function or command.

Code:
forward(0.08,seconds, 50);
moveMotor(motor10, 315, degrees, 50);
moveMotor(motor10, -315, degree, 50);
moveMotor(motor11, 0.03, rotations, 50);
moveMotor(motor10, 315, degrees, 50);


If you're using Graphical Natural Language, this will be done for you automatically but it is a good thing to keep in mind regardless.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.


Wed Jun 18, 2014 3:44 pm
Profile
Rookie

Joined: Thu Jul 03, 2014 1:33 pm
Posts: 23
Post Re: Gripper Control Challenge
This may be a stupid question, but are all the challenges trial and error? Was any information provided on how to control the gripper - degrees, rotations, etc..., or do we just play around with things until we discover a solution.....


Thu Jul 17, 2014 12:05 pm
Profile
Rookie

Joined: Thu Jul 03, 2014 1:33 pm
Posts: 23
Post Re: Gripper Control Challenge
Does anyone know why the command to close the gripper will not execute?

Using graphical language:

Forward 3.5 rotations, 50 (moves him to the object)
movemotor - port10 - -315, 50 (lowers arm)
movemoter - port 11 - 10 or 100 ms, 50 (should close gripper, does nothing)

If I comment out the first two, and then execute, it closes gripper and gives success message...


Thu Jul 17, 2014 12:14 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post Re: Gripper Control Challenge
Without seeing the full execution of the code in real time, my guess would be that the arm is hitting the ground (and stopping its movement) before the -315 encoder counts are reached. The program flow gets stuck in the 'moveMotor' command as a result, and never moves on to the next line of code. Try lowering the value to -180 and see if that works, then tweak the value until it both lowers the arm and opens the claw consistently.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.


Thu Jul 17, 2014 12:47 pm
Profile
Rookie

Joined: Thu Jul 03, 2014 1:33 pm
Posts: 23
Post Re: Gripper Control Challenge
Thanks John, I will try that. Are there instructions on how to control the gripper arm somewhere? Should you do degrees, rotations, time, etc..., to comtrol the gripper?


Thu Jul 17, 2014 1:40 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Gripper Control Challenge
Gripper motor is in port 11. You can use the moveMotor command block to operate the gripper. As I mentioned, I would use time to operate the motor.

Image

Thanks,


Thu Jul 17, 2014 2:12 pm
Profile
Rookie

Joined: Thu Jul 03, 2014 1:33 pm
Posts: 23
Post Re: Gripper Control Challenge
Thanks parkway, but one other question - using time works better for sure, but how do you open the gripper to release an object? Does the motor move the opposite way on the second command with time?


Thu Jul 17, 2014 6:30 pm
Profile
Rookie

Joined: Thu Jul 03, 2014 1:33 pm
Posts: 23
Post Re: Gripper Control Challenge
Parkway,

How do we copy and paste snippet of code in this forum? copy/paste not working.......and I see you copied a command below.

Thanks.....


Thu Jul 17, 2014 6:37 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Gripper Control Challenge
That is just a screenshot. That's what I used to post the code snippets.


Thu Jul 17, 2014 8:42 pm
Profile
Rookie

Joined: Thu Jul 03, 2014 1:33 pm
Posts: 23
Post Re: Gripper Control Challenge
I have tried printscreen and the windows snippet tool, but it will not let me paste a screenshot in this box....not sure why....


Thu Jul 17, 2014 9:12 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post Re: Gripper Control Challenge
I use ShareX, which is a free download, to capture what I want on the screen. When the capture occurs, you are given a URL. I put the URL between the Img tags, and the code appears. Try using it.


Thu Jul 17, 2014 10:19 pm
Profile
Rookie

Joined: Thu Jul 03, 2014 1:33 pm
Posts: 23
Post Re: Gripper Control Challenge
Thanks, will do....


Thu Jul 17, 2014 10:24 pm
Profile
Rookie

Joined: Thu Mar 13, 2014 8:22 am
Posts: 10
Post Re: Gripper Control Challenge
And to answer your other question, set the motor speed to a negative value to move the gripper the other direction.

Image
This code will move the gripper closed and then open.


Fri Jul 18, 2014 9:29 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 16 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


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.