Go to Post Go with a Big Block. The torque is awesome and you cant beat the sound of a built Big Block with a high lift cam and some open headers. A blower would be a nice addition as well. Good luck getting past the inspector. - GBK [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-12-2014, 21:19
FRC Team CC FRC Team CC is offline
Registered User
FRC #6560 (Charging Champions)
 
Join Date: Sep 2014
Rookie Year: 2012
Location: Southern California
Posts: 102
FRC Team CC is an unknown quantity at this point
[FTC]: Field Control System Not Working

Dear Chief Delphi,

We are the Charging Champions, a six-member rookie team from SoCal. Our teleop program works fine on the RobotC joystick function but when we tested our program on the Field Control System, the robot started to act quite weirdly - the right set of wheels started to move even when we did not move the joystick thumbstick.

Here is the program:
Code:
#pragma config(Hubs,  S1, HTMotor,  HTMotor,  HTServo,  HTMotor)
#pragma config(Motor,  mtr_S1_C1_1,     rightTopDrive, tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     rightBottomDrive, tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C2_1,     brush,         tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C2_2,     pulley,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C4_1,     leftBottomDrive, tmotorTetrix, openLoop, reversed)
#pragma config(Motor,  mtr_S1_C4_2,     leftTopDrive,  tmotorTetrix, openLoop, reversed)
#pragma config(Servo,  srvo_S1_C3_1,    basket,               tServoStandard)
#pragma config(Servo,  srvo_S1_C3_6,    brushUpAndDown,       tServoStandard)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c" //call joystick functions
task main()
{
  waitForStart();
	getJoystickSettings(joystick); //call the function
	servo[basket] = 15; // servo basket at 15 degrees
	
	while(true) //constantly check for the joystick input
	{
		if(abs(joystick.joy1_y1) > 10)// if the absolute value of the left joystick in Joystick 1 is greater than 10
  	{
  		motor[leftBottomDrive] = joystick.joy1_y1 * 25/127;// the left-back wheel drives at power 50
  		motor[leftTopDrive] = joystick.joy1_y1 * 25/127;// the left-front wheel drives at power 50
  	}
  	else
  	{
  		bFloatDuringInactiveMotorPWM = true;//start coasting
  		motor[leftBottomDrive] = 0;//left-back wheel does not move
  		bFloatDuringInactiveMotorPWM = true;//start coasting
  		motor[leftTopDrive] = 0;//left-front wheel does not move
  	}
  	if(abs(joystick.joy1_y2) > 10)// of the absolute value of the right joystick in Joystick 1 if greater than 10
  	{
  		motor[rightBottomDrive] = joystick.joy1_y2 * 25/127 ;// the right-back wheel drives at power 50
  		motor[rightTopDrive] = joystick.joy1_y2 * 25/127;// the right-front wheel drives at power 50
  	}
  	else
  	{
  		bFloatDuringInactiveMotorPWM = true;//start coasting
  		motor[rightBottomDrive] = 0;//right-back wheel does not move
  		bFloatDuringInactiveMotorPWM = true;//start coasting
  		motor[rightTopDrive] = 0;//right-front wheel does not move
  	}
  	if(joy2Btn(4) == 1 || joy1Btn(4) == 1) //if joystick button Y is pressed
  	{
  		motor[brush] = 70;// brush will spin at power 70
  	}
  	else
  	{
  		bFloatDuringInactiveMotorPWM = false;
  		motor[brush] = 0; //motor will not spin
  	}
  	
  	if(joy2Btn(5) == 1) //if Joystick button LB is pressed
  	{
  		servo[brushUpAndDown] = 255;// brush goes up the arm
  	}
  	else if(joy2Btn(6) == 1)// if Joystick button RB is pressed
  	{
  		servo[brushUpAndDown] = 0;// brush goes down the arm
  	}
  	if(joystick.joy2_TopHat == 0)// if the "North" button on Tophat is pressed
  	{
  		servo[basket] = 230;// basket lifts up
  	}
  	if(joystick.joy2_TopHat == 4)//if the "South" button on Tophat is pressed
  	{
  		servo[basket] = 115;// basket drops down
  	}
  	if(abs(joystick.joy2_y1) > 5 && abs(joystick.joy2_y2) > 5)// if the absolute value of both joysticks in Joystick 2 is greater than 5
  	{
  		motor[pulley] = (joystick.joy2_y1 + joystick.joy2_y2) * 25/128;//pulley goes up and down
  	}
  	else
  	{
  		bFloatDuringInactiveMotorPWM = false;
  		motor[pulley] = 0;// pulley does not go up or down
  	}
	}
}
Is it a problem with the FCS or is our program not correctly written?

All help is appreciated. Go FTC Teams!!

Thanks,
The Charging Champions
Reply With Quote
  #2   Spotlight this post!  
Unread 05-12-2014, 21:35
IceStorm IceStorm is offline
Mentor FRC 5046, FTC 8688
AKA: Chad
FRC #5046 (Jacked Up Jackets)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Michigan
Posts: 134
IceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of light
Send a message via AIM to IceStorm Send a message via Yahoo to IceStorm
What mode is the switch on the bottom of your joysticks in? We had a similar problem and it was because it was on the X not the D mode. It's not documented very well but I found the same answer on the FTC forums after quite a bit of digging.
__________________

Reply With Quote
  #3   Spotlight this post!  
Unread 05-12-2014, 21:41
FRC Team CC FRC Team CC is offline
Registered User
FRC #6560 (Charging Champions)
 
Join Date: Sep 2014
Rookie Year: 2012
Location: Southern California
Posts: 102
FRC Team CC is an unknown quantity at this point
Re: [FTC]: Field Control System Not Working

Thanks! This worked.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-12-2014, 09:01
IceStorm IceStorm is offline
Mentor FRC 5046, FTC 8688
AKA: Chad
FRC #5046 (Jacked Up Jackets)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Michigan
Posts: 134
IceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of light
Send a message via AIM to IceStorm Send a message via Yahoo to IceStorm
Glad I could help.
__________________

Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 17:19.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi