ROBOTC.net forums
http://www.robotc.net/forums/

Gripperbot Wrist
http://www.robotc.net/forums/viewtopic.php?f=53&t=6459
Page 1 of 1

Author:  vla7 [ Fri Aug 02, 2013 11:32 pm ]
Post subject:  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;
}
}

Author:  Ernest3.14 [ Fri Aug 02, 2013 11:40 pm ]
Post subject:  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;
}

Author:  vla7 [ Sat Aug 03, 2013 8:46 am ]
Post subject:  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;
}

Author:  Ernest3.14 [ Sat Aug 03, 2013 11:20 am ]
Post subject:  Re: Gripperbot Wrist

hmmm... I work with NXTs, can't help you here :P

Author:  tr24em [ Sat Aug 03, 2013 10:04 pm ]
Post subject:  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

Author:  vla7 [ Wed Aug 07, 2013 6:31 am ]
Post subject:  Re: Gripperbot Wrist

Thanks,

I got it working now without falling off.

Author:  gul123 [ Sun Oct 20, 2013 2:50 am ]
Post subject:  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?

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/