Go to Post "If two kids from every school who would otherwise have been uninterested in technology watched this special tonight and was inspired to learn more, then the world just changed because of it." - Barry Bonzack [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-24-2009, 04:33 PM
darkorbit's Avatar
darkorbit darkorbit is offline
Electrical?!
AKA: Jin Lem
FRC #0069 (HYPER ROBOTICS)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Quincy, MA
Posts: 57
darkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to all
Encoder reset on power up

Currently our encoders resets their values during power up. Has anyone figured out a way to not lose those encoder values?
__________________


2007 BOSTON REGIONAL WINNERS (NU-HYPER-FORCE)
2008 Florida Regional 2nd Place
Reply With Quote
  #2   Spotlight this post!  
Unread 01-24-2009, 06:42 PM
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 688
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Encoder reset on power up

What's your usage case? This would mean that the encoder values from previous matches would be restored when you switched on the robot. Perhaps this could be beneficial for debugging, but I don't know why you'd want to start off the actual encoder readings with the old values. I'm not debating so much as I'm just curious.

If you do want to do something like this, I'd recommend periodically writing the current encoder value to a file on the cRIO, then add code to read from that file when the cRIO boots up. Make sure to not write to the file every time through your main code loop as it will slow down your robot's responsiveness. You might want to start a different task if using WindRiver, or create a parallel while loop if using LabVIEW.

As far as I know, there's no other way to retain data through a power cycle.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #3   Spotlight this post!  
Unread 01-24-2009, 07:53 PM
darkorbit's Avatar
darkorbit darkorbit is offline
Electrical?!
AKA: Jin Lem
FRC #0069 (HYPER ROBOTICS)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Quincy, MA
Posts: 57
darkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to alldarkorbit is a name known to all
Re: Encoder reset on power up

We want the encoder to retain it's values because it's going to be use for something with our drive system. So say at the end of the match the wheels are at one position but since you shut the robot off the values of the encoder are gone so then we would therefore have to recalibrate the encoder to read 0 when the wheels are straight...

Sorry i'm a nub programmer xD so how would I go about making the the robot "write the current encoder value to a file on the cRIO, then add code to read from that file when the cRIO boots up"?
__________________


2007 BOSTON REGIONAL WINNERS (NU-HYPER-FORCE)
2008 Florida Regional 2nd Place

Last edited by darkorbit : 01-24-2009 at 07:57 PM.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-24-2009, 10:29 PM
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: Encoder reset on power up

If you need to measure the absolute position of something, a quadrature encoder is not a good choice. Is there any way you can substitute a potentiometer (perhaps a multiple-turn one) or a magnetic shaft encoder?
Reply With Quote
  #5   Spotlight this post!  
Unread 01-25-2009, 10:06 AM
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 688
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Encoder reset on power up

Quote:
Originally Posted by Alan Anderson View Post
If you need to measure the absolute position of something, a quadrature encoder is not a good choice. Is there any way you can substitute a potentiometer (perhaps a multiple-turn one) or a magnetic shaft encoder?
As Alan says, an absolute sensor is a much better way to go. Consider, even if you saved the state of your drive system (for example the position of crab/swerve drive modules), there's nothing that prevents that state from changing between matches because i.e. someone accidentally bumps the robot while it's being transported.

While I have not used them myself, I highly respect US Digital as a brand, and it appears as if they have a couple of good choices. Depending on your budget, there's both an optical version and a magnetic version of absolute encoder. (You may or may not have to shield the magnetic version if using it in close proximity to a motor. Someone want to comment on this?) I'd recommend getting one with an analog output for ease of use, then just wire it to an Analog Input module on the cRIO.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
Reply


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
Camera won't initialize when reset from RC - reset from OI and Power-up works, krunal Programming 7 01-15-2007 12:13 AM
Robot reset in competition DanDon Control System 4 02-10-2006 11:09 PM
Complete Reset Windex Control System 3 02-20-2005 02:02 PM
pic: Field Reset CD47-Bot Extra Discussion 13 03-12-2003 11:56 PM
Robot reset on OI doesn't work Carl Owenby General Forum 1 02-07-2003 07:23 AM


All times are GMT -5. The time now is 09:18 AM.

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