Go to Post Every match they would leave blue and red skid marks all over the carpet. It was like someone roadkilled a Smurf. - Koko Ed [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 05-12-2014, 22:43
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: 105
FRC Team CC is an unknown quantity at this point
[FTC]: RobotC Coasting Not Working

Hey Chief Delphi,

We are the Charging Champions, a six-member FTC team from SoCal. In our teleop program, we needed to coast our drive wheels (only) since the weight of our robot was causing it to fall backwards every time we stopped. However, after we enabled the bFloatDuringInactiveMotorPWM function for the drive motors, the other motors also started coasting. To prevent this from happening, we turned the function off for the other motors, and ALL of the motors (including the drive motors) stopped coasting.

Here is our code (Note that there are four motors for driving and two for other things):

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 25
  		motor[leftTopDrive] = joystick.joy1_y1 * 25/127;// the left-front wheel drives at power 25
  	}
  	else
  	{
  		bFloatDuringInactiveMotorPWM = true;
  		motor[leftBottomDrive] = 0;//left-back wheel does not move
  		bFloatDuringInactiveMotorPWM = true;
  		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 25
  		motor[rightTopDrive] = joystick.joy1_y2 * 25/127;// the right-front wheel drives at power 25
  	}
  	else
  	{
  		bFloatDuringInactiveMotorPWM = true;
  		motor[rightBottomDrive] = 0;//right-back wheel does not move
  		bFloatDuringInactiveMotorPWM = true;
  		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
  	}
    }
}
Did we use the bFloatDuringInactiveMotorPWM function incorrectly? If so, what is the correct way to use?

All help is appreciated. Go FTC TEAMS!!!

Thanks,
The Charging Champions
Reply With Quote
 


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 18:29.

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