Go to Post It's funny how many things learnt in Physics class at school I am able to apply to FRC. - pilleya [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 03-02-2012, 11:01
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
E4P Encoder Scaling

This is the comment for the Encoder::SetDistancePerPulse() method:
Quote:
* Set the distance per pulse for this encoder.
* This sets the multiplier used to determine the distance driven based on the count value
* from the encoder.
* Do not include the decoding type in this scale. The library already compensates for the decoding type.
* Set this value based on the encoder's rated Pulses per Revolution and
* factor in gearing reductions following the encoder shaft.
* This distance can be in any units you like, linear or angular.
From this link:
Quote:
The encoders provided are 360 CPR. With 4X quadrature decoding, you get 1440 positions per revolution.
I have 8" direct driven wheels on my robot. Because the comment says the library already compenstates for the decoding type I used the 360 number. I wanted my speeds in feet/sec so I set my distance per pulse accordingly:

Code:
pLeftEncoder->SetDistancePerPulse((3.14*(8.0/12.0))/360.0);
pRightEncoder->SetDistancePerPulse((3.14*(8.0/12.0))/360.0);
The problem is I don't believe the values I am getting from Encoder::GetRate(). I used a tach to measure the max speed of the wheels and it read 517 rpm which is 18fps which is what we design the drive to be capable of. However my encoders are reading 12fps. The only thing I can think to change would be to use 1440 instead of 360 but that would just lower the speed I am reading. Help?
  #2   Spotlight this post!  
Unread 03-02-2012, 11:54
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 992
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: E4P Encoder Scaling

The 4x decoding mode can have trouble when the phases of the encoder are not perfectly 90 degrees apart (most encoders aren't) and the encoder is spinning fairly fast. I recommend 1x decoding for the drivetrain. It should still give you more than enough accuracy. See if that clears things up at all.

Also, the stupid question, your encoders are attached directly to your wheels/wheel shafts right? Or a shaft attached to the wheels/wheel shafts by a 1:1 ratio?
  #3   Spotlight this post!  
Unread 03-02-2012, 12:31
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
Are you sure your encoders aren't actually 250 counts instead of 360? That would account for your discrepancy.
  #4   Spotlight this post!  
Unread 03-02-2012, 13:13
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: E4P Encoder Scaling

Quote:
Originally Posted by Joe Ross View Post
Are you sure your encoders aren't actually 250 counts instead of 360? That would account for your discrepancy.

P/N E4P-250-250-D-D-D-B from 2009 KoP (see attachment)

Attached Thumbnails
Click image for larger version

Name:	2009_KoP_250_count_encoder.png
Views:	74
Size:	40.1 KB
ID:	11690  
  #5   Spotlight this post!  
Unread 03-02-2012, 15:48
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: E4P Encoder Scaling

Thanks!! That must be it. If I plug in the 250 value it gets me the speeds I expected. I will confirm the P/N's on the encoders but I am confident that will be the solution. Thanks again.
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 01:33.

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