Go to Post (pfft, kid... I sound like I'm Baker's age) - Amanda Morrison [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 16-02-2010, 00:43
Integral Integral is offline
Registered User
AKA: Ross
FRC #1130 (Robo Rebels)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2008
Location: Albany, Or
Posts: 22
Integral is an unknown quantity at this point
Re: Encoder trouble

Flameouts Mentor here,

Our wiring is correct and sound, as is the condition and installation of the encoders themselves.

We currently appear to have a good reading from the right encoder and for the left we get a flat 0. Perhaps more of an error condition? I have not been able to find any sign of an error thrown by any of the encoder vis.

I note in the first block (from the begin vi) of code flameout posted that neither of the encoders are set for reverse. Could this cause an error?

It really does not matter how we are viewing the output of the encoders, the posted code shows how we first initialise the encoders then how we read them. Can someone comment on the correctness of this code?
  #2   Spotlight this post!  
Unread 16-02-2010, 11:19
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Encoder trouble

I'm looking at how you calculated the scaling...
8*pi = circumference of wheel
divided by encoder counts (360)
divided by feet
multiplied by gear ratio (15/22)
The result of that calculation is 0.00379
My math says 0.05 inches - same as yours except yours is in feet.

Scaling is correct.

Which brings us back to - Where is this get code. It is in a while loop. Is it in Teleop.vi? Is it in Autonomous Independent.vi? You can call Encoder:Reset before you enter the while loop if you are doing this in Autonomous.


EDIT - after looking at that get code, I see a possible problem. You are feeding the difference from this get and the last get (speed) and using that to determine your position with the help of the gyro. It would be much simpler to just reset the encoders at each turn, and add the position change in each segment of your journey, assuming you never turn and drive straight at the same time.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

Last edited by apalrd : 16-02-2010 at 11:25.
  #3   Spotlight this post!  
Unread 16-02-2010, 14:24
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,113
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: Encoder trouble

Quote:
Originally Posted by Integral View Post
It really does not matter how we are viewing the output of the encoders, the posted code shows how we first initialise the encoders then how we read them. Can someone comment on the correctness of this code?
It might not much matter how, but it certainly makes a difference when and where you read them. The while loop worries me, but I can't comment on whether the code is correct without knowing the context. My earlier question remains: where is it?
  #4   Spotlight this post!  
Unread 16-02-2010, 17:58
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: Encoder trouble

This is in a VI that is in Periodic Tasks.vi (we use our own loops, not the built-in loops.) This is a timed loop, which I believe is set with a delay of 20 milliseconds.

We now have one working, and one not. The one that's not may or may not be plugged in (I don't recall for sure.)

Thank you.
  #5   Spotlight this post!  
Unread 16-02-2010, 18:43
Integral Integral is offline
Registered User
AKA: Ross
FRC #1130 (Robo Rebels)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2008
Location: Albany, Or
Posts: 22
Integral is an unknown quantity at this point
Re: Encoder trouble

Quote:
Originally Posted by Alan Anderson View Post
It might not much matter how, but it certainly makes a difference when and where you read them. The while loop worries me, but I can't comment on whether the code is correct without knowing the context. My earlier question remains: where is it?
Please note that the right encoder is functioning as we expect, the left is not. Again it really does not matter where the code is. If one is working the other should also be.

Once again, does one encoder NEED to be set for inverse operation?

I have operated the right encoder from the both sets of assigned DI/O,s and have installed a new left encoder. The encoder change made no difference.
  #6   Spotlight this post!  
Unread 16-02-2010, 21:35
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Encoder trouble

You don't NEED to set one inverse. If it runs inverse, then set it inverse. The software sees it as yet another encoder, one of many. If you swap the A and B channels it will have the same effect, so it is possible you might have to invert one, none, or both, not necessarily the right one. Yes it does matter where the code is; if that code were in Teleop then the while loop would cause problems. When the right encoder is set run on either set of IO, does it work? When you plug it into the ports for the left encoder, does the left show change? If so it is certainly a hardware problem. If not, then it is either a problem with software or the 37-pin cable.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #7   Spotlight this post!  
Unread 17-02-2010, 00:05
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,113
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: Encoder trouble

Quote:
Originally Posted by Integral View Post
Please note that the right encoder is functioning as we expect, the left is not. Again it really does not matter where the code is. If one is working the other should also be.
It really does matter where the code is. Context means a lot when trying to determine what might be going on in a real time system.

For example, if it's in a parallel task outside the Robot Main event loop, and if it is not in a sequence enforced by the "error out" connection from Begin.vi, the Refnum Get for your left encoder might be getting executed before the Refnum Set for the encoder has been done.
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
Encoder Trouble Kahn! NI LabVIEW 8 15-02-2010 17:02
Lab View Update 3.0 encoder trouble Funnyman2003 Programming 2 03-02-2009 08:52
Screwing Encoder into Encoder Mount? Adrien Electrical 3 25-01-2009 18:14
KOP Gear Tooth Encoder Trouble Sykan Programming 11 16-02-2008 20:53
Inventor software trouble/ FIRST Base trouble nasa-senpai General Forum 2 24-01-2007 09:15


All times are GMT -5. The time now is 12:25.

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