Go to Post My teams robots have been good, bad and ugly BUT they were all beautiful because they were there. - JohnBoucher [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 12-02-2011, 13:12
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
running 2 encoders - problems

We are using 4 encoders on 4 nanoboxes. All 4 are wired the same and wired correctly (triple checked). We can see the A and B pulses (with a scope) on all 4 channels. But only 2 servos (using PID controller) are working.

We commented out the enable call for the PIDcontroller classes, ran the motors at a constant speed (manually with the motor classes) and are printing out the encoder values using the GetRate method. Two of the values are NaN which explains the problems with the servos.

Anyone have any clues? I guess we can start replacing encoders but the outputs looks good.

TIA
  #2   Spotlight this post!  
Unread 12-02-2011, 13:23
Mtg Ruler Mtg Ruler is offline
Registered User
FRC #1986 (Team Titanium)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Lee's Summit, MO
Posts: 21
Mtg Ruler is an unknown quantity at this point
Re: running 2 encoders - problems

I remember reading awhile back that there is a bug that only allows one encoder rate to be read (at least in LabVIEW, I don't about C++).

I would try getting the values as a distance, then making your own rate functions to determine velocity.
  #3   Spotlight this post!  
Unread 12-02-2011, 13:25
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: running 2 encoders - problems

When I change the Encoder constructor and ask for k2X the channels that did not work (with 4X default) are now working!! And the channels that were working (with k4X default) now display NaN.

Something is wrong inside the encoder libraries? I am pretty sure we have the latest greatest robot image because we are using the new Encoder class that can act as a PIDsource.

We are using DIO channels 1-8 if that matters (hope not). But we moved them around a little to see what is wrong and the errors did not change or move to another channel.

Last edited by wireties : 12-02-2011 at 13:27.
  #4   Spotlight this post!  
Unread 12-02-2011, 13:31
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: running 2 encoders - problems

Quote:
Originally Posted by Mtg Ruler View Post
I remember reading awhile back that there is a bug that only allows one encoder rate to be read (at least in LabVIEW, I don't about C++).

I would try getting the values as a distance, then making your own rate functions to determine velocity.
Hmmm - that could be it. If the problem exists in LabView, it also will exist in C++. I'm sure they both use the same FPGA image. I missed the threads about the bug in an earlier search.

Last edited by wireties : 12-02-2011 at 13:42.
  #5   Spotlight this post!  
Unread 12-02-2011, 14:30
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,513
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: running 2 encoders - problems

If you do a search you will find several lengthy discussions on this. I believe it's a known problem with the wpilib and exists in all langauges if you are using the get rate.

Your best bet is to use the count and construct your own getrate using a ms timer.
  #6   Spotlight this post!  
Unread 13-02-2011, 06:52
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: running 2 encoders - problems

No combination or order of instantiation gave us a working solution - switched to a software rate calculation and moved on.
  #7   Spotlight this post!  
Unread 13-02-2011, 14:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: running 2 encoders - problems

The unreliable built-in rate calculation is most likely a bug in the FPGA code. It's going to be left as it is until after competition season, to keep from introducing other problems accidentally.
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 11:02.

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