View Single Post
  #1   Spotlight this post!  
Unread 16-02-2013, 14:01
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,630
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Encoder Doesn't Reset to Zero

We have a strange programming bug that we're a bit stuck on. We have an encoder on a mechanism that we want to reset every time a limit switch is depressed. However, when we depress the limit switch, weird things happen. The printed value of the count from encoder.Get() either just adds a zero to the end of the number or replaces the first digit with zero. For example, numbers like 215 and 217 turn to 015 and 017. Once we break 1000, the number just changes from something like 1300 to 01300, and then begins counting much faster.

We have no idea why this happens or how to fix it. Got any ideas?

Update: We changed the code so that the limit switch reset a drivetrain encoder instead of the mechanism encoder and it worked perfectly. I'll see if we can get code up. I have no idea why this would work for one encoder but not the other.

Update 2: We ruled out a hardware problem by plugging the mechanism encoder into the DT encoder port, it resets in that port fine.
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)

Last edited by Chris is me : 16-02-2013 at 14:34.
Reply With Quote