Go to Post Ah, free slave labor. One of the many benefits of being a mentor - Ari423 [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 02-04-2013, 14:45
Dragonslayerend Dragonslayerend is offline
DuncanDynamics lead programmer
AKA: Tom Xiong
FRC #3970 (DuncanDynamics)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Fresno, CA, Duncanpoly Tech
Posts: 33
Dragonslayerend will become famous soon enoughDragonslayerend will become famous soon enough
Multiple Encoder issues

Okay So we want to create an auton drivetrain using two encoders. The encoders are to be wired to the Digital sidecard. Each encoder is wired accordingly to specs. a & b to two signal ports and positive and negative to respective pins. The issue we have is when we add a second encoder to the digital sidecard the new encoder gives me flickering values, although the first encoder still gives me normal values. Another thing is also if the second encoder is programmed to anything besides GetDistance()(We use C++) Function, it will not give me any values. When using only one encoder we can use it with any port. Though after adding a second encoder, all other ports will result in the same flickering response besides the port used by the first encoder. We can interchange encoders and the result is still the same even with different encoders. We also got the same results from using a whole second set of electronics(new cRIO ect.). So what we would like to ask is how do you use multiple encoders on a digital sidecard?
  #2   Spotlight this post!  
Unread 02-04-2013, 14:57
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Multiple Encoder issues

What does the 5v light on the digital sidecar do when the additional encoders are added? Can you post your code?

In 2009, we used 5 encoders. We've used 2 encoders each year since then.
  #3   Spotlight this post!  
Unread 02-04-2013, 15:57
Phalanx's Avatar
Phalanx Phalanx is offline
Formerly Team 1089 (Mercury)
AKA: Michael Reffler
FRC #5431 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 1999
Location: Lewisville, TX (previously NJ)
Posts: 384
Phalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond repute
Re: Multiple Encoder issues

A few years ago I ran into something similar. I banged my head against the way for the better part of a day trying to isolate it.

We swapped encoders, we continuity tested the cables, even checked for bleed over on each pin. We could find nothing wrong.

Purely by accident, one encoder was not plugged into the digital side car and suddenly all but that one were working flawlessly. I replaced that cable with a new one and presto everything started working.

What it turned out to be was ONE bad encoder cable, where in cable, heck if I know, because it passed every test I could do at the event. But that was it.

So my suggestion would be to disconnect all your encoders, and then add them back one at a time until you find the culprit.
__________________
Don't just ask the experts, become one!
Leadership is not about ability. It's about responsibility!
Diagonally Parked in a Parallel Universe. It's okay we do Quantum Physics


  #4   Spotlight this post!  
Unread 02-04-2013, 17:31
Dragonslayerend Dragonslayerend is offline
DuncanDynamics lead programmer
AKA: Tom Xiong
FRC #3970 (DuncanDynamics)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Fresno, CA, Duncanpoly Tech
Posts: 33
Dragonslayerend will become famous soon enoughDragonslayerend will become famous soon enough
Re: Multiple Encoder issues

Quote:
Originally Posted by Joe Ross View Post
What does the 5v light on the digital sidecar do when the additional encoders are added? Can you post your code?

In 2009, we used 5 encoders. We've used 2 encoders each year since then.
This is my simple encoder code to test the encoders. Also the encoder wires work, I switch the wires connected to the ports.
#include "WPILib.h"

class RobotDemo : public SimpleRobot
{
Encoder *Encoder1, *Encoder2;
CANJaguar *Jag1, *Jag2;
Servo *Shift;
DriverStationLCD *DsLCD;
Joystick *One;

public:
RobotDemo(void)
{
Encoder1 = new Encoder(2,3);
Encoder2 = new Encoder(4,5);
Jag1 = new CANJaguar(3);
Jag2 = new CANJaguar(4);
Shift = new Servo(1);
DsLCD = DriverStationLCD::GetInstance();
One = new Joystick(1);
}

void Autonomous(void)
{
}

void OperatorControl(void)
{
while (IsOperatorControl())
{
Encoder1->Start();
Encoder2->Start();
while(IsEnabled())
{
Jag1->Set(One->GetY());
Jag1->Set(One->GetY());
Shift->Set((One->GetRawAxis(4)/2)+.5);
DsLCD->Printf(DriverStationLCD::kUser_Line1,1,"Speed:%f" ,Encoder1->GetRate());
DsLCD->Printf(DriverStationLCD::kUser_Line2,2,"Speed:%f" ,Encoder2->Get());
DsLCD->UpdateLCD();
}
}
}
void Test() {

}
};

START_ROBOT_CLASS(RobotDemo);

Last edited by Dragonslayerend : 02-04-2013 at 17:36.
  #5   Spotlight this post!  
Unread 10-04-2013, 22:31
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 582
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Multiple Encoder issues

If you put the encoders on higher numbered ports on the DSC do you get the same results?

Have you swapped the cable that connects the DSC to the cRIO?

Which encoders are you using?

When you say "flickering values", what do you mean?

A couple things on your test code -- don't think they're causing your problem, but good to fix.

1. You're setting Jag1 twice and not setting Jag2.
2. Should print out the same value from each of the encoders.
  #6   Spotlight this post!  
Unread 16-04-2013, 01:34
Dragonslayerend Dragonslayerend is offline
DuncanDynamics lead programmer
AKA: Tom Xiong
FRC #3970 (DuncanDynamics)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Fresno, CA, Duncanpoly Tech
Posts: 33
Dragonslayerend will become famous soon enoughDragonslayerend will become famous soon enough
Re: Multiple Encoder issues

Quote:
Originally Posted by stevep001 View Post
If you put the encoders on higher numbered ports on the DSC do you get the same results?

Have you swapped the cable that connects the DSC to the cRIO?

Which encoders are you using?

When you say "flickering values", what do you mean?

A couple things on your test code -- don't think they're causing your problem, but good to fix.

1. You're setting Jag1 twice and not setting Jag2.
2. Should print out the same value from each of the encoders.
Yeah we get the same results. And By flickering I mean it jumps back and forth from 1-2. Ex: *It gives me* 1,2,1,2,1,2,1. (over and over again as I spin the encoder). We have swapped the cables multiple times. We are using Ep4 360 and 250 encoders. Oh and I have multiple versions of the code to test the encoders that didn't involve Jags and printed out only GetDistance() for both.
  #7   Spotlight this post!  
Unread 16-04-2013, 09:38
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: Multiple Encoder issues

Check the A & B signals with a scope. You should see two square waves that are 90 degrees out of phase. If they are on the ragged edge of right you will get the sequence you described. Be sure the encoder wheel is paired with the correct sensor base. The different line count requires a different sensor to maintain the 90 degree phase response. The distance the encoder wheel is from the sensor also will affect this. Use the special tool US Digital provides to set the distance. End play or shaft run out will also cause trouble.

-Hugh
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


All times are GMT -5. The time now is 20:09.

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