Go to Post If I'm going to mentor someone, I'm going to be involved in their life as a positive force. - Mechvet [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 20-02-2012, 13:00
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Arrow Encoders getting different rates

Hey guys
Been working with encoders the past few days on the drive train. Both encoders are e4p models, though one has an H in the model while the other has all Ds. I'm not exactly sure of the entire model number as I don't have them in front of me, but I definitely know one is all Ds and the other has Ds and a H.

Our Problem: The one with the H is reading the values way slower than the other. The robot could be on full throttle for 5 seconds and this encoder would be at 40 while the other would be at 1500. Major difference. I figure you could just scale the faster one way down to match the slower...?

Any ideas?

please help!!!
Reply With Quote
  #2   Spotlight this post!  
Unread 20-02-2012, 14:53
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Encoders getting different rates

are they both consistant (when the fast one reads 3000 does the other read 80)?
Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2012, 15:00
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Encoders getting different rates

Quote:
Originally Posted by tilky View Post
are they both consistant (when the fast one reads 3000 does the other read 80)?
what do you mean by consistent? I haven't really looked at the numbers like that if they are consistent with one another.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-02-2012, 15:05
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Encoders getting different rates

if, for exampe, for every 800 counts of one of the encoders is 1 count for the other, the slow one you can set 800 for the distance per count, and the other one (the faster one) you can set 1 for that amount. This will make them equal the same.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-02-2012, 15:11
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Encoders getting different rates

Quote:
Originally Posted by tilky View Post
if, for exampe, for every 800 counts of one of the encoders is 1 count for the other, the slow one you can set 800 for the distance per count, and the other one (the faster one) you can set 1 for that amount. This will make them equal the same.
I see what you mean now. That's probably what I'll end up doing later when I go to work on the bot.

I have another question: The side with the higher reading on the encoder right now spins faster than the other side. Once I tune the encoders to be consistent like you said, is there a way I can get the faster side to spin the same speed as the slower? I assume like a pid system where the encoder on the slower side is the setpoint and the encoder on the faster side is the process variable.
How would I make this work with a tank drive though?

Any help?
Reply With Quote
  #6   Spotlight this post!  
Unread 20-02-2012, 15:22
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Encoders getting different rates

you would have to tune them when both motors are running at the same speed. do you have a rpm meter in your shop?
Reply With Quote
  #7   Spotlight this post!  
Unread 20-02-2012, 15:26
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Encoders getting different rates

Quote:
Originally Posted by tilky View Post
you would have to tune them when both motors are running at the same speed. do you have a rpm meter in your shop?
I don't believe we have one. Yesterday, I was trying to multiply the faster side by a constant before it is fed into the tank drive block to attempt and get it close to the other side. I didn't get very far as my mentor was telling me that it would be easier to do it when the encoders are in sync.
Reply With Quote
  #8   Spotlight this post!  
Unread 20-02-2012, 15:28
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Encoders getting different rates

that is right, but how would you get them in sync if the motors aren't turning at the same speed?
Reply With Quote
  #9   Spotlight this post!  
Unread 20-02-2012, 15:31
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Encoders getting different rates

Quote:
Originally Posted by tilky View Post
that is right, but how would you get them in sync if the motors aren't turning at the same speed?
That's exactly what I was thinking. Today when I go to work on the robot, I'll probably work again with that constant to multiply by. Seems like the only way I can really get both sides close to each other.
Reply With Quote
  #10   Spotlight this post!  
Unread 20-02-2012, 15:50
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,658
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Encoders getting different rates

This seems like a very bad idea. You currently have two encoders that aren't functioning at all the same, and you're thinking of fixing the problem by scaling the outputs? You don't even know if you're getting good reliable values from the encoders. I would very much recommend that you first verify that the values from your encoders at least somewhat correspond with reality.

If you get the wheels off the ground and give your drive train a full forward command, the motors will be turning pretty darn close to their no-load speed. That'd be 5200 RPM. You should be able to calculate what the rate reading of your encoder should be based on that and the gear ratio of your transmission. Hopefully one of your readings gets close to this number. Then you know which encoder is wrong and you can start looking at that one to figure out what's wrong. It might be bad wiring, a bad code wheel, a different code wheel, an incorrectly installed code wheel, bad programming.... What ever it is, you're better off figuring out why these encoders are so different and fixing that problem instead of making a workaround based off assumptions you haven't verified. For all you know, the encoder that's reading 50 counts isn't actually plugged in and you're reading noise on the digital IO lines.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #11   Spotlight this post!  
Unread 20-02-2012, 15:57
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Encoders getting different rates

Quote:
Originally Posted by Kevin Sevcik View Post
This seems like a very bad idea. You currently have two encoders that aren't functioning at all the same, and you're thinking of fixing the problem by scaling the outputs? You don't even know if you're getting good reliable values from the encoders. I would very much recommend that you first verify that the values from your encoders at least somewhat correspond with reality.

If you get the wheels off the ground and give your drive train a full forward command, the motors will be turning pretty darn close to their no-load speed. That'd be 5200 RPM. You should be able to calculate what the rate reading of your encoder should be based on that and the gear ratio of your transmission. Hopefully one of your readings gets close to this number. Then you know which encoder is wrong and you can start looking at that one to figure out what's wrong. It might be bad wiring, a bad code wheel, a different code wheel, an incorrectly installed code wheel, bad programming.... What ever it is, you're better off figuring out why these encoders are so different and fixing that problem instead of making a workaround based off assumptions you haven't verified. For all you know, the encoder that's reading 50 counts isn't actually plugged in and you're reading noise on the digital IO lines.
I know for a fact both are plugged in. The wheels have been off the ground since we put the encoders on (2 days ago). I plan on calculating the distance per count by pushing the robot 10 feet and taking the readout from Labview and going from there. A much simpler approach then what you said. I'm NOT trying to make a workaround based off assumptions. We already switched the slower encoder once and don't have anymore left.
Reply With Quote
  #12   Spotlight this post!  
Unread 20-02-2012, 15:57
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Encoders getting different rates

i said to do that if they are consistant, meaning that there isn't a problem, other than different scaling
Reply With Quote
  #13   Spotlight this post!  
Unread 20-02-2012, 16:08
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,658
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Encoders getting different rates

Quote:
Originally Posted by jhellr13 View Post
I know for a fact both are plugged in. The wheels have been off the ground since we put the encoders on (2 days ago). I plan on calculating the distance per count by pushing the robot 10 feet and taking the readout from Labview and going from there. A much simpler approach then what you said. I'm NOT trying to make a workaround based off assumptions. We already switched the slower encoder once and don't have anymore left.
If you switched out all the parts of the slower encoder with another one and it stayed the same, that points to a software problem. In that case, I'd try replacing your "fast" encoder with the original "slow" encoder. If your formerly "slow" reads fast, then try swapping the cables. If it still reads fast, then it's a software thing or a really weird DSC problem. If it reads slow, then the problem is following the cable and you need a new cable. If you end up with two "slow" encoders back there at the beginning, then atleast you have two encoders that seem to be performing the same.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #14   Spotlight this post!  
Unread 20-02-2012, 16:10
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Encoders getting different rates

Quote:
Originally Posted by Kevin Sevcik View Post
If you switched out all the parts of the slower encoder with another one and it stayed the same, that points to a software problem. In that case, I'd try replacing your "fast" encoder with the original "slow" encoder. If your formerly "slow" reads fast, then try swapping the cables. If it still reads fast, then it's a software thing or a really weird DSC problem. If it reads slow, then the problem is following the cable and you need a new cable. If you end up with two "slow" encoders back there at the beginning, then atleast you have two encoders that seem to be performing the same.
That's not exactly how it worked. We had 2 encoders that were never used or if they were very slightly. We put those on, and only one was getting a reading. We replaced the one that wasn't working with an encoder from 2010 that we knew worked from that year. That is the one getting the slower reading.
Reply With Quote
  #15   Spotlight this post!  
Unread 20-02-2012, 16:20
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Encoders getting different rates

ok so since they both work, but at different rates, the method i gave above will work.
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 11:23.

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