Go to Post What's the point of competing if you're not going to be competitive? - davepowers [more]
Home
Go Back   Chief Delphi > Technical > Motors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-01-2009, 15:22
FRC1672's Avatar
FRC1672 FRC1672 is offline
Team 1672
FRC #1672 (Mahwah Robo T-Birds)
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Mahwah
Posts: 29
FRC1672 is on a distinguished road
Problem with Motor direction

Our programing / electronics team was trying our bench top test and we found that one of our motors was traveling backwards. The jaguar is receiving a backwards signal as denoted by the LED's color being 'orange-ish'.

We set up the bench top test stock from the KOP. Our cables were hooked up correctly. The motors did drive. We are using the WPI library (unmodified).

Any insight if its just the WPI library? Is there a physical fix (reversing cables???) other than reversing the motors in the library coding.

Last edited by FRC1672 : 20-01-2009 at 15:40.
  #2   Spotlight this post!  
Unread 20-01-2009, 15:26
Miner Miner is offline
Registered User
AKA: Jacob Miner
FRC #2077 (Laser Robotics)
Team Role: Leadership
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Dousman, WI
Posts: 85
Miner is on a distinguished road
Re: Problem with Motor direction

Basically your choices include anything that complies with the rules...

For now you could switch the wires on the jaguars, on the motors, or just switch it in the programming like you said.

Get it to work now and you will have more time to work on it later. Thats something thats good to remember. Dont spend a lot of time trying to solve a problem that can be quick fixed and worked on later...
__________________
Do what you like... Like what you do!
Jake, the Life Is Good guy
  #3   Spotlight this post!  
Unread 20-01-2009, 15:32
FRC1672's Avatar
FRC1672 FRC1672 is offline
Team 1672
FRC #1672 (Mahwah Robo T-Birds)
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Mahwah
Posts: 29
FRC1672 is on a distinguished road
Re: Problem with Motor direction

The jaguar is receiving a backwards signal. The jaguars LED is representative of backwards signal. The LED is 'orange-ish'. Sorry for no saying that above.

Moving your attention to the WPI library where can we switch the motor direction?

We also have an issue with reuploading / recompiling the library.

Last edited by FRC1672 : 20-01-2009 at 15:39.
  #4   Spotlight this post!  
Unread 20-01-2009, 16:00
TotalChaos's Avatar
TotalChaos TotalChaos is offline
Registered User
AKA: Austin
FRC #2837 (Freebird Robotics)
Team Role: College Student
 
Join Date: Apr 2008
Rookie Year: 2006
Location: Gilbert AZ
Posts: 112
TotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud of
Send a message via MSN to TotalChaos
Re: Problem with Motor direction

Quote:
Originally Posted by FRC1672 View Post
Moving your attention to the WPI library where can we switch the motor direction?
Are you using LabVIEW?

- Austin
__________________
The 39th Aero Squadron - Team 39! (Visit our website!)
Team Role: 3 Years as Driver - College Student/Mentor!


Freebird Robotics - On a 1 year hiatus! (Visit our website!)
Arizona 2009: Semifinalists! (69 and 498), Delphi "Driving Tomorrow's Technology" Award
  #5   Spotlight this post!  
Unread 20-01-2009, 16:03
FRC1672's Avatar
FRC1672 FRC1672 is offline
Team 1672
FRC #1672 (Mahwah Robo T-Birds)
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Mahwah
Posts: 29
FRC1672 is on a distinguished road
Re: Problem with Motor direction

WinRiver: C++. I'm sorry if i misspelled that.
  #6   Spotlight this post!  
Unread 20-01-2009, 16:05
TotalChaos's Avatar
TotalChaos TotalChaos is offline
Registered User
AKA: Austin
FRC #2837 (Freebird Robotics)
Team Role: College Student
 
Join Date: Apr 2008
Rookie Year: 2006
Location: Gilbert AZ
Posts: 112
TotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud of
Send a message via MSN to TotalChaos
Re: Problem with Motor direction

Oh, ok. I'm sorry, I can't really help then. I don't really know much C++. Hopefully someone who knows it better will pick up on your thread.

Good luck!

- Austin
__________________
The 39th Aero Squadron - Team 39! (Visit our website!)
Team Role: 3 Years as Driver - College Student/Mentor!


Freebird Robotics - On a 1 year hiatus! (Visit our website!)
Arizona 2009: Semifinalists! (69 and 498), Delphi "Driving Tomorrow's Technology" Award
  #7   Spotlight this post!  
Unread 20-01-2009, 16:28
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem with Motor direction

The WPILib "RobotDrive" class includes the ability to easily reverse motors in software. Normally this would be configured using a call to SetInvertedMotor().

WPILib code a docs:
Code:
/*
 * Invert a motor direction.
 * This is used when a motor should run in the opposite direction as the drive
 * code would normally run it. Motors that are direct drive would be inverted, the
 * Drive code assumes that the motors are geared with one reversal.
 * @param motor The motor index to invert.
 * @param isInverted True if the motor should be inverted when operated.
 */
void RobotDrive::SetInvertedMotor(MotorType motor, bool isInverted)
{
 ...
}
The OTB code probably was configured to reverse one side, since that is almost always desired for a robot drive.

EDIT:
After looking at the Default code and WPILib code, I found where it happens.

For the right side, reversed is considered forward. So, if you want the right side to rotate the same direction as the left you need to call SetInvertedMotor for the right drive motor(s) and set them to inverted. You can see this in the function RobotDrive::SetLeftRightMotorSpeeds.

Bold comments mine
Code:
/** Set the speed of the right and left motors.
 * This is used once an appropriate drive setup function is called such as
 * TwoWheelDrive(). The motors are set to "leftSpeed" and "rightSpeed"
 * and includes flipping the direction of one side for opposing motors.
 * @param leftSpeed The speed to send to the left side of the robot.
 * @param rightSpeed The speed to send to the right side of the robot.
 */
void RobotDrive::SetLeftRightMotorSpeeds(float leftSpeed, float rightSpeed)
{
	wpi_assert(m_rearLeftMotor != NULL && m_rearRightMotor != NULL);

	leftSpeed = Limit(leftSpeed);
	rightSpeed = Limit(rightSpeed);

	if (m_frontLeftMotor != NULL)
		m_frontLeftMotor->Set(Limit(leftSpeed) * m_invertedMotors[kFrontLeftMotor]);
	m_rearLeftMotor->Set(Limit(leftSpeed) * m_invertedMotors[kRearLeftMotor]);

	if (m_frontRightMotor != NULL)
//Notice the "-" before Limit(), but not on the lines above. This is where the right side is reversed.
		m_frontRightMotor->Set(-Limit(rightSpeed) * m_invertedMotors[kFrontRightMotor]); 
	m_rearRightMotor->Set(-Limit(rightSpeed) * m_invertedMotors[kRearRightMotor]);
}
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 20-01-2009 at 16:43.
  #8   Spotlight this post!  
Unread 20-01-2009, 16:34
FRC1672's Avatar
FRC1672 FRC1672 is offline
Team 1672
FRC #1672 (Mahwah Robo T-Birds)
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Mahwah
Posts: 29
FRC1672 is on a distinguished road
Re: Problem with Motor direction

Quote:
Originally Posted by EHaskins View Post
The WPILib "RobotDrive" class includes the ability to easily reverse motors in software. Normally this would be configured using a call to SetInvertedMotor().

WPILib code a docs:
Code:
/*
 * Invert a motor direction.
 * This is used when a motor should run in the opposite direction as the drive
 * code would normally run it. Motors that are direct drive would be inverted, the
 * Drive code assumes that the motors are geared with one reversal.
 * @param motor The motor index to invert.
 * @param isInverted True if the motor should be inverted when operated.
 */
void RobotDrive::SetInvertedMotor(MotorType motor, bool isInverted)
{
 ...
}
The OTB code probably was configured to reverse one side, since that is almost always desired for a robot drive.
Thank you. This was most useful.
  #9   Spotlight this post!  
Unread 20-01-2009, 15:28
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Problem with Motor direction

Before you do this I have a question for you. Is the "backwards" motor you observed just form looking at the two motors not hooked up to anything and seeing that they were spinning opposite directions? If so I recommend orienting the motors as they will be oriented in your robot drivetrain (usually facing opposite ways) and see if they are now both spinning "forwards" or "backwards". In a typical FRC setup the motors must be driven in opposite directions to drive straight unless the wiring is reversed on one.


The physical solution is reverse the cables running from the Motor to the Jaguar. Take the cable currently attached to the negative side of the Jaguar motor output (probably black) and attach it to the positive side of the motor output.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #10   Spotlight this post!  
Unread 20-01-2009, 15:35
Enigma's puzzle's Avatar
Enigma's puzzle Enigma's puzzle is offline
Strategery
AKA: Matt Brechting
FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Sparta MI
Posts: 261
Enigma's puzzle is a splendid one to beholdEnigma's puzzle is a splendid one to beholdEnigma's puzzle is a splendid one to beholdEnigma's puzzle is a splendid one to beholdEnigma's puzzle is a splendid one to beholdEnigma's puzzle is a splendid one to beholdEnigma's puzzle is a splendid one to behold
Re: Problem with Motor direction

This is pretty tricky, we had the same problem our first year, you will want to put encoders on the motors for sure. they don't have the same power going forward and backwards, i am assuming that you are not orientating them the same way. If you don't put encoders on, one side will turn faster than the other, and inevitably cause you to turn.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FTC]: FTC Servo-Motor Problem with Labview dnhansen FIRST Tech Challenge 1 26-10-2008 00:43
Inverting the direction of a Motor willson.thomas Programming 19 17-03-2008 20:16
problem with motor speed bsbllpss Electrical 3 29-01-2008 10:07
CIM Motor Bias Direction jonboy Motors 1 28-01-2008 07:58
Motor Spin Direction archiver 2000 6 23-06-2002 23:43


All times are GMT -5. The time now is 05:07.

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