Go to Post you, sirs, are most definately gracious proffesionals. - Leav [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 27-02-2016, 17:12
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Encoder instability

We're using the PG71 motor from Andymark which has an hall-effect encoder to hold the shooter at an angle, and it works marvellously, but only when it does. However, sometimes, despite the shaft moving, we won't get any signals for a few seconds. This usually causes the whole shooter system to mess up, and we had to add an encoder reset function for the operator to press when we see that we've lost control. I'd still like to fix it altogether instead of a hack that makes us lose time. We've tried so far:
  • Trying different encoders(the whole assembly really)
  • Changing cables
  • Even trying a new roboRIO!

Is anyone else having these problems with the PG71 gearmotor, or the hall-effect sensor from Andymark? Thanks!
  #2   Spotlight this post!  
Unread 28-02-2016, 10:47
c0d3rman's Avatar
c0d3rman c0d3rman is offline
Programming Captain
AKA: Yoni Lerner
FRC #4904 (Bot Provoking)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: US
Posts: 8
c0d3rman is an unknown quantity at this point
Re: Encoder instability

As it seems you've replaced a lot of your hardware already, have you considered it may be code?
  #3   Spotlight this post!  
Unread 28-02-2016, 15:02
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,510
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Encoder instability

How much do you lose the angle? Is it small enough just to be backlash, or is this really a significant amount?

Under what conditions does this happen/not happen? E.g. only when being backdriven, only in reverse, only when the last joystick command was x. Any patterns as to when it does/does not happen can help point to a cause.

Mechanically, if larger than a backlash value, i do not see how the problem could be inside the gearbox unless some teeth are practically missing or there's a similarly large failure. The coupling of the encoder to the backshaft is a possibility. Losing transitions electrically is certainly possible, especially if it happens in conjunction with collisions (including crossing defenses quickly) or another motor/actuator being operated.

Just for completeness, is the sensor connected to a pair of DIO ports on the RIO, or going to an SRX or Jaguar's encoder inputs? Especially if it's not coming from the DIO, are you sure you're using a 5V supply?
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
  #4   Spotlight this post!  
Unread 28-02-2016, 16:17
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Re: Encoder instability

Quote:
Originally Posted by c0d3rman View Post
As it seems you've replaced a lot of your hardware already, have you considered it may be code?
I have considered that, but I have code backups from when it didn't happen, and the problem happens even with old code.

Quote:
Originally Posted by GeeTwo View Post
How much do you lose the angle? Is it small enough just to be backlash, or is this really a significant amount?

Under what conditions does this happen/not happen? E.g. only when being backdriven, only in reverse, only when the last joystick command was x. Any patterns as to when it does/does not happen can help point to a cause.

Mechanically, if larger than a backlash value, i do not see how the problem could be inside the gearbox unless some teeth are practically missing or there's a similarly large failure. The coupling of the encoder to the backshaft is a possibility. Losing transitions electrically is certainly possible, especially if it happens in conjunction with collisions (including crossing defenses quickly) or another motor/actuator being operated.

Just for completeness, is the sensor connected to a pair of DIO ports on the RIO, or going to an SRX or Jaguar's encoder inputs? Especially if it's not coming from the DIO, are you sure you're using a 5V supply?
We usually lose a significant amount, in the 90-100 degrees range, and that's enough to completely render our shooter useless. It also tends to hit a few things on its way up, sometimes damaging parts.

The conditions happen to be random, but it's mostly immediately after the robot is enabled or while the robot is sitting still. I can't remember an instance where it "jumped" while the robot was in motion.

The outputs are connected to DIO ports, and I've tried switching between different ports. We use the 6V(?) supply from the DIO ports. Might that be a problem?
  #5   Spotlight this post!  
Unread 28-02-2016, 16:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,994
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder instability

Quote:
Originally Posted by cantdecide View Post
We're using the PG71 motor from Andymark which has an hall-effect encoder
What part number motor are you referring to?

What's the part number of the encoder?

Quote:
sometimes, despite the shaft moving, we won't get any signals for a few seconds.
How do you know you're not getting a signal from the encoder? Is that a direct1 observation, or a conclusion based on indirect2 evidence?


1 e.g. measuring the encoder signal with an oscilloscope
2 e.g. the arm went crazy, so it must mean the encoder isn't providing a signal.
  #6   Spotlight this post!  
Unread 29-02-2016, 00:16
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Re: Encoder instability

Quote:
Originally Posted by Ether View Post
What part number motor are you referring to?

What's the part number of the encoder?



How do you know you're not getting a signal from the encoder? Is that a direct1 observation, or a conclusion based on indirect2 evidence?


1 e.g. measuring the encoder signal with an oscilloscope
2 e.g. the arm went crazy, so it must mean the encoder isn't providing a signal.
The part number is am-2816a.

The code prints encoder values to SmartDashboard, and during the periods where the arm goes crazy, Rate goes down to 0 and Distance stays the same for a few seconds. So I guess you could say ~indirect.
  #7   Spotlight this post!  
Unread 29-02-2016, 08:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,994
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder instability


What programming language are you using? To rule out a coding problem, try loading and running a standalone example program.


  #8   Spotlight this post!  
Unread 29-02-2016, 10:29
snekiam snekiam is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2010
Location: SE Michigan
Posts: 83
snekiam has a spectacular aura aboutsnekiam has a spectacular aura aboutsnekiam has a spectacular aura about
We are having a similar problem with position control with the same encoder on our gatherer. Sometimes it works fine, and goes to the setpoint perfectly both physically and digitally. But seemingly randomly, the setpoint is correct digitally, but the gatherer is in the completely wrong position physically, making it seem like the arm is moving without updating encoder values. The encoders are plugged directly into the DIO ports on the roborio. We have also tried swapping cables, encoders, and motors. It seems to make no difference.
  #9   Spotlight this post!  
Unread 29-02-2016, 10:39
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 instability

Grasping at straws...

It's a Hall Effect sensor, right? Perhaps there's magnetic interference. Might you have a high-current conductor running too close, or the side of a really powerful motor jammed up against it?

Do you have anything in the program that resets the encoder value? Maybe it's being told to do it at an inappropriate time.
  #10   Spotlight this post!  
Unread 29-02-2016, 12:40
snekiam snekiam is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2010
Location: SE Michigan
Posts: 83
snekiam has a spectacular aura aboutsnekiam has a spectacular aura aboutsnekiam has a spectacular aura about
It came for us mounted to our http://www.andymark.com/Gearmotor-p/am-2971.htmmotor
  #11   Spotlight this post!  
Unread 29-02-2016, 16:15
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Re: Encoder instability

Quote:
Originally Posted by Ether View Post

What programming language are you using? To rule out a coding problem, try loading and running a standalone example program.


I'll try to check tomorrow.

Quote:
Originally Posted by Alan Anderson View Post
Grasping at straws...

It's a Hall Effect sensor, right? Perhaps there's magnetic interference. Might you have a high-current conductor running too close, or the side of a really powerful motor jammed up against it?

Do you have anything in the program that resets the encoder value? Maybe it's being told to do it at an inappropriate time.
The closest motor to it, obviously other than the gearmotor itself, is our drive motors, and it seems to happen even while we're not driving. In fact, it can happen without any of the other motors moving. However, the PID loop does often drive the gearmotor at ~20-30% to keep the arm in place. Maybe that creates some interference?
There is a command to reset the encoder(which I added because of this problem), but the actual accumulated value doesn't go to zero when the problem happens. It just stops accumulating(and the encoder rate goes down to 0) for a period of time.
  #12   Spotlight this post!  
Unread 29-02-2016, 16:32
ahartnet's Avatar
ahartnet ahartnet is offline
Registered User
AKA: Andrew Hartnett
FRC #5414 (Pearadox)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2005
Location: Houston, Texas
Posts: 194
ahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant future
Re: Encoder instability

We had an encoder problem where we weren't putting pull up resistors - but that doesn't seem to be needed by this encoder. I've also seen where there's a bad solder joint or a bad crimp that could cause similar problems. Buying a motor that already has the encoder installed and premade cables would seemingly eliminate those problems.

So like others in this thread - it seems to me that the code might be getting hung up. I think in Labview it's probably easier to accidentally do that than in some other languages. Are you able to command other things during this time?

In particular the teleop function in labview (I think, my memory is fuzzy) must complete within a certain amount of time and it could be relatively easy to accidentally take more time than you're allowed (especially if you're doing vision). When you put old code back in - was it all the old code? Or just the old code for controlling your arm.

I'd second Ether's recommendation of a standalone program that does nothing except reading the encoder and move the arm. My suspicion would be that you have something that is holding your processors attention longer than it should.
__________________
Team 451 The Cat Attack, Student Alumni (2005)
Team 1646 Precision Guessworks, Mentor (2006-2008)
Team 2936 Gatorzillas, Mentor (2011-2014)
Team 5414 Pearadox, Mentor (2015-Present)
  #13   Spotlight this post!  
Unread 29-02-2016, 16:49
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Re: Encoder instability

Quote:
Originally Posted by ahartnet View Post
We had an encoder problem where we weren't putting pull up resistors - but that doesn't seem to be needed by this encoder. I've also seen where there's a bad solder joint or a bad crimp that could cause similar problems. Buying a motor that already has the encoder installed and premade cables would seemingly eliminate those problems.

So like others in this thread - it seems to me that the code might be getting hung up. I think in Labview it's probably easier to accidentally do that than in some other languages. Are you able to command other things during this time?

In particular the teleop function in labview (I think, my memory is fuzzy) must complete within a certain amount of time and it could be relatively easy to accidentally take more time than you're allowed (especially if you're doing vision). When you put old code back in - was it all the old code? Or just the old code for controlling your arm.

I'd second Ether's recommendation of a standalone program that does nothing except reading the encoder and move the arm. My suspicion would be that you have something that is holding your processors attention longer than it should.
We're using C++, and the odd thing is, all of the other values(that are set in the same loop as the encoder function) in SmartDashboard are updating while the encoder stalls, so it's probably not software hanging. We also do vision on a co-processor.

Also, when I said "old code", I meant "old complete code that worked". I unfortunately don't have the option of testing an arm at this moment since our robot is bagged, but I'll try to test a standalone encoder + motor assembly's stability tomorrow.
  #14   Spotlight this post!  
Unread 29-02-2016, 16:55
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,994
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder instability

Quote:
Originally Posted by cantdecide View Post
We're using C++, and the odd thing is, all of the other values(that are set in the same loop as the encoder function) in SmartDashboard are updating while the encoder stalls, so it's probably not software hanging.
But it could be some other software problem, other than "hanging".

Quote:
Also, when I said "old code", I meant "old complete code that worked".
The old code worked with an old hardware configuration. That could have been serendipity. It could still be a software problem.


  #15   Spotlight this post!  
Unread 29-02-2016, 18:53
snekiam snekiam is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2010
Location: SE Michigan
Posts: 83
snekiam has a spectacular aura aboutsnekiam has a spectacular aura aboutsnekiam has a spectacular aura about
Re: Encoder instability

Ours never seemed to work completely, but with a seemingly random error it is hard to tell. Weirdly we are also using C++, adding to the idea that software may be to blame here.
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


All times are GMT -5. The time now is 06:29.

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