Nothing in the KOP can prepare me for you.
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
  #16   Spotlight this post!  
Unread 15-05-2009, 14:26
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,082
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Misbehaving encoders

Quote:
Originally Posted by nathanww View Post
"PWM" here is referring to the cable we've spliced to, not the output on the digital sidecar

I sketched out a diagram of eaxctly how it's set up and attached it.

We know the robot isn't reading the encoder because the value from Get() never changes, and the robot always reports that it is stopped, even when moving


Yep--we saw this, and when we checked it with a multimeter(we don't have an o-scope), we saw fluctuation in values--it just seems that the robot isn't interpreting it correctly.
That is a sweet MS Paint sketch

Everything looks correct to me. So the problem is either really obscure, or right under our noses.

More ideas:

1. Are you sure you are using the correct port on the cRIO for the sidecar? Are you sure the sidecar is fully powered (12V power from the main breaker is necessary)?

2. Try commenting out the encoder code and instead creating DigitalInputs on the same two DIO lines. Call Get() on that and turn the encoder to make sure that you can at least see the two lines fluctuating.

3. Since you have a multimeter, verify that you are getting (close to) 0V and 5V on the Ch A and Ch B outputs as you rotate the powered encoder.
  #17   Spotlight this post!  
Unread 15-05-2009, 14:29
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Misbehaving encoders

Quote:
Originally Posted by nathanww View Post
"PWM" here is referring to the cable we've spliced to, not the output on the digital sidecar

I sketched out a diagram of eaxctly how it's set up and attached it.

We know the robot isn't reading the encoder because the value from Get() never changes, and the robot always reports that it is stopped, even when moving


Yep--we saw this, and when we checked it with a multimeter(we don't have an o-scope), we saw fluctuation in values--it just seems that the robot isn't interpreting it correctly.

Sounds right. Are you doing this in Autonomous mode? We couldn't read our sensors in autonomous. They act like they never change. I wasn't involved with the software but The sensors worked in teleop mode so we proved they were working. Not sure what the problem was. They may not have been set up as global variables ... something like that.

Steve
  #18   Spotlight this post!  
Unread 15-05-2009, 15:11
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: Misbehaving encoders

Quote:
Originally Posted by nathanww View Post
I sketched out a diagram of eaxctly how it's set up and attached it.
You've shown three wires going to one thing, and one wire going to another. The sketch doesn't show which pins on those "things" the wires go to. If your labeling of the wires on the left matches the order they're connected to the GPIO pins, I think you have +5 and ground reversed.
  #19   Spotlight this post!  
Unread 15-05-2009, 15:27
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Misbehaving encoders

Quote:
You've shown three wires going to one thing, and one wire going to another. The sketch doesn't show which pins on those "things" the wires go to. If your labeling of the wires on the left matches the order they're connected to the GPIO pins, I think you have +5 and ground reversed.
I don't have the robot to look at, so I accidentally reversed them on the diagram. We know that the orientation is correct on the robot because the encoder LEDs are lighting, which wouldn't happen if they were getting reversed current, and we can get some variation as we turn the wheel, so it's not something weird like getting the ground and signal wires mixed up.


And yeah, we're running it in the teleop mode,and we have other sensors on the GPIO that work fine
__________________
Get yer robot source code here!
  #20   Spotlight this post!  
Unread 15-05-2009, 15:52
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: Misbehaving encoders

Quote:
Originally Posted by nathanww View Post
I don't have the robot to look at, so I accidentally reversed them on the diagram.
Without accurate details, I can't help further. Sorry.

An actual photograph of your wiring would help a lot at this point. So would a good closeup of how you have the encoder disk attached. Your code looks fine to me (except for a nagging worry about using the %d format specifier with a long integer).
  #21   Spotlight this post!  
Unread 15-05-2009, 16:00
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Misbehaving encoders

Just as a wild spitball...in your program, do you have to do anything to enable the interrupt for the encoders ?

Steve
  #22   Spotlight this post!  
Unread 15-05-2009, 16:47
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Misbehaving encoders

Code:
encoder1->Start();
As I understand it, this is what should tell the encoder system in the FPGA to actually start counting pulses.

And with the long-int %d--even if this was printing incorrectly, the encoder stopped flag should be changing, right?
__________________
Get yer robot source code here!
  #23   Spotlight this post!  
Unread 15-05-2009, 17:04
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 805
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Misbehaving encoders

Quote:
Originally Posted by nathanww View Post
And with the long-int %d--even if this was printing incorrectly, the encoder stopped flag should be changing, right?
The long-int printing question is easily fixed. I don't know if it is incorrect as previously written, but typecasting will get rid of all doubt and make sure it works as you think it should.

Code:
printf("encoder1=%d", (int)(encoder1->Get()));
  #24   Spotlight this post!  
Unread 15-05-2009, 17:25
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,609
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: Misbehaving encoders

Quote:
Originally Posted by nathanww View Post
Code:
encoder1->Start();
And with the long-int %d--even if this was printing incorrectly, the encoder stopped flag should be changing, right?
The stopped flag may be affected by this bug: http://forums.usfirst.org/showpost.p...5&postcount=34 (but I can't remember if that affected labview only, or C++ also).
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
Encoders..... manderson5192 Programming 4 07-02-2008 10:10
encoders benjamin1748 Programming 6 07-02-2007 22:37
Encoders Ctx32 Programming 8 13-05-2006 23:54
3 Encoders stephenthe1 Programming 5 17-11-2005 19:21
encoders stephenthe1 Programming 61 09-02-2005 15:05


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

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