View unanswered posts | View active topics It is currently Sat Oct 25, 2014 2:27 pm






Reply to topic  [ 6 posts ] 
Servo Motor - jittery 
Author Message
Rookie

Joined: Sun Sep 18, 2011 2:20 pm
Posts: 8
Post Servo Motor - jittery
Having a problem with 2 servos connected to ports 5 & 6. They run, but are very jittery...like shaky. Doesn't seem to be a motor problem, something with channel?


Fri Nov 18, 2011 2:03 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Servo Motor - jittery
Can you give more details on the problem that you're having? How do you have the servos set up? What kind of load are they under? What code are you using to run them?

_________________
sudo rm -rf /


Fri Nov 18, 2011 3:00 pm
Profile
Rookie

Joined: Sun Sep 18, 2011 2:20 pm
Posts: 8
Post Re: Servo Motor - jittery
There is essentially no load - using as a conveyor system. Took off tracks and motors were still jittery. Changed motors, same thing. Servos are connected into ports 5 & 6 on the Cortex. Of course the competition is tomorrow.

Code:
#pragma config(Motor,  port1,           x,             tmotorNormal, openLoop)
#pragma config(Motor,  port2,           boom,          tmotorNormal, openLoop)
#pragma config(Motor,  port3,           ldrive,        tmotorNormal, openLoop)
#pragma config(Motor,  port4,           rdrive,        tmotorNormal, openLoop)
#pragma config(Motor,  port5,           armMotor,      tmotorNormal, openLoop)
#pragma config(Motor,  port6,           armMotor,      tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main ()
{

  while(1 == 1)
  {
    motor[port3]  = vexRT[Ch3];   // drive
    motor[port2] = vexRT[Ch2];   // boom
    motor[port6] = vexRT[Ch6];   // intake
    motor[port4] = vexRT[Ch4];   // drive
    motor[port5] = vexRT[Ch5];   // intake

if(vexRT[Btn5U] == 1)
{
motor[port5] = -127;

}
else if(vexRT[Btn5D] == 1)
{
motor[port5] = 127;

}
if(vexRT[Btn6U] == 1)
{
motor[port6] = -127;

}
else if(vexRT[Btn6D] == 1)
{
motor[port6] = 127;

  }
}
}



Fri Nov 18, 2011 3:09 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Servo Motor - jittery
There is no vexRT[Ch5] or vexRT[Ch6] on the new vex joysticks. you have to access them via the vexRT[Btn5U] type commands like you did later in your code.

remove
Code:
motor[port6] = vexRT[Ch6];   // intake
and
motor[port5] = vexRT[Ch5];   // intake

from your code. Does that seem to solve your problem?

_________________
sudo rm -rf /


Fri Nov 18, 2011 4:22 pm
Profile
Rookie

Joined: Sun Sep 18, 2011 2:20 pm
Posts: 8
Post Re: Servo Motor - jittery
YES it solves the problem, however it doesn't stop running. We'd like to stop on release of button.


Fri Nov 18, 2011 5:00 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Servo Motor - jittery
Well this is where you have to remember that "the robot does what you tell it to, not what you want it to". In your code, you tell the motors to got full forward if this button is pressed, full backwards if this other button is pressed, but you never tell it to stop if neither of the buttons are pressed.

_________________
sudo rm -rf /


Fri Nov 18, 2011 6:42 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.