View unanswered posts | View active topics It is currently Wed Aug 27, 2014 5:15 pm






Reply to topic  [ 7 posts ] 
Gripperbot Wrist 
Author Message
Rookie

Joined: Fri Aug 02, 2013 11:23 pm
Posts: 6
Post Gripperbot Wrist
I'm able to control the wheel motors and arm using the nMotorEncoder() functions with the Gripperbot but I am having trouble with the wrist motor. Can someone please tell me why this little bit of code causes my wrist motor to turn in and then snap off and fall to the ground?

task main()
{
nMotorEncoder[wrist] = 0;

while(nMotorEncoder[wrist] < 50)
{
motor[wrist] = 40;
}
}


Fri Aug 02, 2013 11:32 pm
Profile
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: Gripperbot Wrist
I don't know how your robot is set up, but you never actually stop any motors. You set the wrist motor to 40, but the motor is never set back to zero after that. Try this:
Code:
task main()
{
    nMotorEncoder[wrist] = 0;

    while(nMotorEncoder[wrist] < 50)
    {
        motor[wrist] = 40;
    }
    motor[wrist] = 0;
}

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Fri Aug 02, 2013 11:40 pm
Profile
Rookie

Joined: Fri Aug 02, 2013 11:23 pm
Posts: 6
Post Re: Gripperbot Wrist
Here is my complete code. I just took the Gripperbot example code and replaced the task main. The suggestion above didn't work. I tried stopping the motor after the while loop by setting wrist to 0 but the wrist will still turn all the way back no matter what value I enter in for nMotorEncoder[wrist]. Whether I enter 100 or 10 it still turns down and all the way back.

#pragma config(Hubs, S1, HTMotor, HTMotor, none, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Sensor, S2, IRSeeker, sensorHiTechnicIRSeeker1200)
#pragma config(Sensor, S3, lightSensor, sensorLightActive)
#pragma config(Sensor, S4, sonarSensor, sensorSONAR)
#pragma config(Motor, motorA, gripper, tmotorNXT, PIDControl, encoder)
#pragma config(Motor, motorB, wrist, tmotorNXT, PIDControl, encoder)
#pragma config(Motor, mtr_S1_C1_1, right, tmotorTetrix, openLoop, encoder)
#pragma config(Motor, mtr_S1_C1_2, left, tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor, mtr_S1_C2_1, arm, tmotorTetrix, openLoop, encoder)
#pragma config(Motor, mtr_S1_C2_2, motorG, tmotorTetrix, openLoop, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{
nMotorEncoder[wrist] = 0;

while(nMotorEncoder[wrist] < 10)
{
motor[wrist] = 40;
}
motor[wrist] = 0;
}


Sat Aug 03, 2013 8:46 am
Profile
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: Gripperbot Wrist
hmmm... I work with NXTs, can't help you here :P

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Sat Aug 03, 2013 11:20 am
Profile
Rookie

Joined: Thu May 02, 2013 10:52 am
Posts: 22
Post Re: Gripperbot Wrist
Are you using the gripper bot on the FTC Ring-it-Up virtual world? For these questions I am going to guess that is correct.

What is the start position of the wrist? Is in in the initial position (all the way up), is it all the way downward, or is it in between?

Which way are you trying to turn the wrist (up or down)?

up = motor positive, down = motor negative, is this what you are expecting?

If it is all the way down and you want it to go up it works fine for me.

If it is all the way up and you want it to go down, have the motor = -40, and the while look for > -40, or you could reverse the motor and use -nMotorEncoder instead of nMotorEncoder. Both of those work fine for me.

I have not been able to get it to snap off and fall to the ground though, even when I try to

_________________
What is easy you have done, what is hard you can do, what is impossible will take a little longer


Sat Aug 03, 2013 10:04 pm
Profile
Rookie

Joined: Fri Aug 02, 2013 11:23 pm
Posts: 6
Post Re: Gripperbot Wrist
Thanks,

I got it working now without falling off.


Wed Aug 07, 2013 6:31 am
Profile
Rookie

Joined: Sun Oct 20, 2013 2:46 am
Posts: 1
Post Re: Gripperbot Wrist
What is the start position of the wrist? Is in in the initial position (all the way up), is it all the way downward, or is it in between?

Which way are you trying to turn the wrist (up or down)?

up = motor positive, down = motor negative, is this what you are expecting?

_________________
http://www.youtube.com/user/Apple
http://www.selftestengine.com/350-029.html
http://www.emc.com
http://www.uq.edu.au/
http://selftestengine.com/


Sun Oct 20, 2013 2:50 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 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.