Go to Post :( The Internet just ate my post. - Greg Marra [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
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 19-01-2016, 20:44
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Unhappy amt10 odd behavior

we're trying to use the amt10 quadrature encoder on our drivetrain in distance mode. specifically we attach it to the gear box. the problem i'm having is that when the gearbox starts to rotate, the distance jumps a large value and then seems to track correctly. for example, we have the dip switches set to 200 and the encoder type to kx1. when i turn the encoder just slightly to a positive distance, the distance out of the FPGA jumps to 90, then tracks. if i turn the encoder in the negative direction, the distance instantly jumps to positive ~60, then tracks down eventually going negative. i've tried 2 different encoders on two different roborio's with nearly identical behavior. we're programming in java. this happens in both the 2015 and 2016 libraries.
has anyone had this behavior? is there a fix?
obviously this makes the encoders useless for autonomous mode....

any help would be appreciated.

bill
Reply With Quote
  #2   Spotlight this post!  
Unread 20-01-2016, 09:41
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Unhappy Re: amt10 odd behavior

here's the code from RobotMap that instantiates the encoder:

driveTrainRightQuadrature = new Encoder(0, 1, false, EncodingType.k1X);
LiveWindow.addSensor("DriveTrain", "RightQuadrature", driveTrainRightQuadrature);
driveTrainRightQuadrature.setDistancePerPulse(1.0) ;
driveTrainRightQuadrature.setPIDSourceParameter(PI DSourceParameter.kDistance);
driveTrainLeftQuadrature = new Encoder(2, 3, false, EncodingType.k1X);

also note that the behavior we are seeing is through the smartdashboard. we want to use this encoder via a PID controller and with the unusual output, we cannot get the PID controller to work properly.

has anyone been able to use the amt10 quadrature encoders to work with a PID controller using java as the language?

thanks....
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2016, 13:56
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Smile Re: amt10 odd behavior

figured out what's going on.
first, there appears to be a bug (or feature depending upon how you view it) in the smartdashboard wrt the "zero distance" button on the encoder widget. in test mode, if you click on the "zero distance" button for the encoder, it sets the displayed value to zero. it DOES NOT set the the distance accumulator to zero. basically if the smartdashboard is showing 90 as the current distance from the encoder, clicking the zero distance button will set the displayed value to 0. but the value in the acculator is still 90. as soon as i moved the encoder, the displayed value will jump from zero to 90 and start tracking.
this is not the case for the reset method on the encoder class. that appears to function properly, setting the accumulated value to zero.
in addition (and this is our fault) the connectors we used to connect the encoder wire to the roborio port were not very secure and as such i believe were causing either spikes or missed edges which in turn made using the distance in a PID controller unstable. we have since purchased connectors from digikey that are much more secure and show a clean edge on an o-scope.
so, is there a way to log a bug against smartdashboard? or get the source code so i can propose a patch?
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2016, 16:28
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,560
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: amt10 odd behavior

Bug reporting: http://wpilib.screenstepslive.com/s/...port-resources
Getting the source: http://wpilib.screenstepslive.com/s/...ing-the-source
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


All times are GMT -5. The time now is 02:31.

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