Go to Post Even at Mc Donalds, dinner with Dean would be really cool! - Josh Hambright [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > Extra Discussion
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 09-05-2015, 13:33
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,051
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: pic: Small CIM in wheel swerve

Quote:
Originally Posted by sanddrag View Post
... there was a good bit of math and code involved...
If your sample time is fast and stable enough that the encoder could never turn 180 degrees from one sample to the next, then "all ya gotta do" at each sample is assume the encoder turned through the shortest angle, and keep track of zero crossings.


Reply With Quote
  #2   Spotlight this post!  
Unread 09-05-2015, 13:53
AlexanderTheOK AlexanderTheOK is offline
Guy
no team
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Los Angeles
Posts: 146
AlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really nice
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Ether View Post
If your sample time is fast and stable enough that the encoder could never turn 180 degrees from one sample to the next, then "all ya gotta do" at each sample is assume the encoder turned through the shortest angle, and keep track of zero crossings.


Funny you say that. That was the original plan, but Java's timer tasks (as mentioned by 254) are slightly broken on the roborio. We had latencies in code of up to 200ms. We ended up using the FPGA's analogTriggers to keep track.

Since there's really never a need for analogTriggers save for this one strange case, that was broken too. Thank god for the fantastic people at WPI that got it fixed so quickly.

I know sanddrag said that it worked well enough at competition, I have to say the headache caused by this is greater than he may have noted, and took a lot of time out of the season. It's generally just not a good idea to do incremental sensing of anything if it is at all possible to have absolute sensing. Zeroing sensors are a must.
Reply With Quote
  #3   Spotlight this post!  
Unread 09-05-2015, 13:57
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,499
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by AlexanderTheOK View Post
I know sanddrag said that it worked well enough at competition, I have to say the headache caused by this is greater than he may have noted, and took a lot of time out of the season. It's generally just not a good idea to do incremental sensing of anything if it is at all possible to have absolute sensing. Zeroing sensors are a must.
If you embrace incremental, then it can be a huge time savings.

We never have to manually zero sensors, there are no magic numbers in code, and we know we can replace a sensor/system at any time with no new work required.

Every position system 973 has ran all the way back to 2012 has been on an incremental sensor that assumes a zero at start (plus sometimes a manual or automated routine to hardstop zero). We always mean to add the zeroing sensors, but never do as the functionality isn't needed.
Reply With Quote
  #4   Spotlight this post!  
Unread 09-05-2015, 15:10
Bryce2471's Avatar
Bryce2471 Bryce2471 is offline
Alumnus
AKA: Bryce Croucher
FRC #2471 (Team Mean Machine)
Team Role: Mechanical
 
Join Date: Feb 2013
Rookie Year: 2007
Location: Camas, WA
Posts: 424
Bryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud of
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by AdamHeard View Post
If you embrace incremental, then it can be a huge time savings.

We never have to manually zero sensors, there are no magic numbers in code, and we know we can replace a sensor/system at any time with no new work required.

Every position system 973 has ran all the way back to 2012 has been on an incremental sensor that assumes a zero at start (plus sometimes a manual or automated routine to hardstop zero). We always mean to add the zeroing sensors, but never do as the functionality isn't needed.
I have found that with swerves, the small amount of accumulated drift from an incremental encoder is unexceptable. This is because it causes the wheels to fight each other, and makes the responce to driver input less predictable. I know you guys have run swerves in the past. Did you use incremental encoders? If so, how did you keep the drift down and zero them?
__________________
FLL Team Future imagineers
2010 Oregon State Championships: Winners
2011 International Invite: First place Robot design, Second Place Robot Performance
FRC Team Mean Machine
2012 Seattle: Winning alliance
2013 Portland: Winning alliance
2013 Spokane: Winning alliance
2014 Wilsonville: Winning alliance
2014 Worlds: Deans List Winner
Reply With Quote
  #5   Spotlight this post!  
Unread 09-05-2015, 15:49
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,499
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Bryce2471 View Post
I have found that with swerves, the small amount of accumulated drift from an incremental encoder is unexceptable. This is because it causes the wheels to fight each other, and makes the responce to driver input less predictable. I know you guys have run swerves in the past. Did you use incremental encoders? If so, how did you keep the drift down and zero them?
You shouldn't be losing counts (which is why we love using them).

However, if you are there are two likely causes.

1) Mechanical slip. Somehow the encoder is slipping, easy to fix w/ better design.

2) Voltage brownout causing the supply voltage to the encoders to drop out. We use a regulated supply for all of our encoders for this reason.
Reply With Quote
  #6   Spotlight this post!  
Unread 09-05-2015, 15:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,051
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: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Bryce2471 View Post
I have found that with swerves, the small amount of accumulated drift from an incremental encoder is unexceptable.
If you are getting "drift" with an incremental encoder then you are probably doing something wrong.

Adam listed two likely causes. A third, fourth, fifth, and sixth might be 3) using an encoder outside its operating range (edges per second), 4) a damaged encoder (dirty / scratched optical disk), 5) improperly assembled / mounted (optical disk alignment / concentricity), and 6) incorrect programming (resetting the counts rather than letting the FPGA accumulator run freely).



Last edited by Ether : 09-05-2015 at 16:18.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-05-2015, 16:31
Bryce2471's Avatar
Bryce2471 Bryce2471 is offline
Alumnus
AKA: Bryce Croucher
FRC #2471 (Team Mean Machine)
Team Role: Mechanical
 
Join Date: Feb 2013
Rookie Year: 2007
Location: Camas, WA
Posts: 424
Bryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud of
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by AdamHeard View Post
You shouldn't be losing counts (which is why we love using them).
2) Voltage brownout causing the supply voltage to the encoders to drop out. We use a regulated supply for all of our encoders for this reason.
I'm going to guess that #2 was our problem. I am surprised I've never heard of this issue before.
__________________
FLL Team Future imagineers
2010 Oregon State Championships: Winners
2011 International Invite: First place Robot design, Second Place Robot Performance
FRC Team Mean Machine
2012 Seattle: Winning alliance
2013 Portland: Winning alliance
2013 Spokane: Winning alliance
2014 Wilsonville: Winning alliance
2014 Worlds: Deans List Winner
Reply With Quote
  #8   Spotlight this post!  
Unread 10-05-2015, 08:16
InFlight's Avatar
InFlight InFlight is online now
3574 - The King's of Bling
AKA: Jim
FRC #3574 (High Tekerz)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Seattle Area
Posts: 164
InFlight is an unknown quantity at this point
Re: pic: Small CIM in wheel swerve

If you could work out the incremental encoder setup, it would free you up to put a slip ring module at the top. That trade off would solve the motor wiring issue, and not restrict you to partial rotations.
__________________

Thank you 2016 Alliance Partners - 948, 1510, 2046, 2521, 2980, 2990, 4911, 4683
Reply With Quote
  #9   Spotlight this post!  
Unread 10-05-2015, 13:59
Bryce2471's Avatar
Bryce2471 Bryce2471 is offline
Alumnus
AKA: Bryce Croucher
FRC #2471 (Team Mean Machine)
Team Role: Mechanical
 
Join Date: Feb 2013
Rookie Year: 2007
Location: Camas, WA
Posts: 424
Bryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud of
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Ether View Post
It's still unclear what problem you are trying to solve and what your suggested solution ("putting the swerve slightly to one side of "Straight" before every match, so that it's "zero" would be the real zero of the swerve, to begin with") is.

With absolute encoders for steering, there are at least two common ways to deal with steering alignment:

hardware mounting calibration

Mount, adjust, and lock down each steering encoder so that each encoder reads zero when its associated wheel is properly aligned. With this approach, there is no need to align the wheels perfectly at the start of a match.

startup zero offset

During setup for each match, carefully align the wheels to their zero steering position. At startup, read and store a zero offset reading for each steering encoder, and apply that offset to the encoder reading.
Sorry my post didn't do it for you; I haven't had a lot of time this weekend to think out my explanation, but I'll give it another shot. I don't like the idea of using a startup zero offset for several reasons. I don't like the weight or complexity of adding a homing switch/sensor. When using an absolute encoder I like to use hardware mounting calibration. So I was trying to explain a way to use hardware mounting calibration with an absolute encoder when the gear ratio between the swerve and the encoder is not 1:1.

You begin by choosing an integer gear ratio for the encoder, because that will make things much easier. Then you mount the encoder or slip the gears so that when the full circle of the swerve is cut into slices of pie, one of the edges of a pie slice ends up facing true zero. Then you write software that takes that edge to be the zero for the match. So now, before each match you don't have to get the wheels perfectly aligned, you just have to aim it in the sector that is to one side of the zero position.
It's just an idea, and maybe that was already blatantly obvious, or maybe its not useful, but I figured I would try to explain my idea so that I could at least find out if people though it was useful or not. Let me know If I need to try to explain it one more time.
Quote:
Originally Posted by Ether View Post
If you are getting "drift" with an incremental encoder then you are probably doing something wrong.

Adam listed two likely causes. A third, fourth, fifth, and sixth might be 3) using an encoder outside its operating range (edges per second), 4) a damaged encoder (dirty / scratched optical disk), 5) improperly assembled / mounted (optical disk alignment / concentricity), and 6) incorrect programming (resetting the counts rather than letting the FPGA accumulator run freely).
Because we had the problem on all four wheels, and we never disassembled the encoders, I'll rule out #4 and #5. We used the WPI lib encoder software, so I'll hope it wasn't #6. We originally thought that it was #3 because we could theoretically exceed the max angular velocity of the encoder, but we later decided it wasn't likely, because we would have to run the motor at very near free speed to do that.

(P.S. Thanks. Your post is much more constructive and helpful with the edit.)
__________________
FLL Team Future imagineers
2010 Oregon State Championships: Winners
2011 International Invite: First place Robot design, Second Place Robot Performance
FRC Team Mean Machine
2012 Seattle: Winning alliance
2013 Portland: Winning alliance
2013 Spokane: Winning alliance
2014 Wilsonville: Winning alliance
2014 Worlds: Deans List Winner

Last edited by Bryce2471 : 10-05-2015 at 14:17.
Reply With Quote
  #10   Spotlight this post!  
Unread 10-05-2015, 14:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,051
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: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Ether View Post
6) incorrect programming (resetting the counts rather than letting the FPGA accumulator run freely).
Quote:
Originally Posted by Bryce2471 View Post
We used the WPI lib encoder software, so I'll hope it wasn't #6.
Using the WPILib doesn't rule out #6. #6 refers to using the reset() function repeatedly in your software in the roboRIO.

Code:
/**
 * Reset the Encoder distance to zero. Resets the current count to zero on
 * the encoder.
 */
public void reset() {
	if (m_counter != null) {
		m_counter.reset();
	} else {
		ByteBuffer status = ByteBuffer.allocateDirect(4);
		// set the byte order
		status.order(ByteOrder.LITTLE_ENDIAN);
		EncoderJNI.resetEncoder(m_encoder, status.asIntBuffer());
		HALUtil.checkStatus(status.asIntBuffer());
	}
}
I've seen code where the counts are read and then reset() every cycle. You can miss counts that way. I'm not saying that's what your code is doing... but if it is, that might explain your "drift".


Reply With Quote
  #11   Spotlight this post!  
Unread 10-05-2015, 15:28
bobcroucher's Avatar
bobcroucher bobcroucher is offline
Registered User
FRC #2471 (Team Mean Machine)
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2008
Location: United States
Posts: 33
bobcroucher has a spectacular aura aboutbobcroucher has a spectacular aura about
Re: pic: Small CIM in wheel swerve

Deleted

Last edited by bobcroucher : 10-05-2015 at 15:32. Reason: Posted in wrong account.
Reply With Quote
  #12   Spotlight this post!  
Unread 10-05-2015, 15:35
Bryce2471's Avatar
Bryce2471 Bryce2471 is offline
Alumnus
AKA: Bryce Croucher
FRC #2471 (Team Mean Machine)
Team Role: Mechanical
 
Join Date: Feb 2013
Rookie Year: 2007
Location: Camas, WA
Posts: 424
Bryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud ofBryce2471 has much to be proud of
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Ether View Post
I've seen code where the counts are read and then reset() every cycle. You can miss counts that way. I'm not saying that's what your code is doing... but if it is, that might explain your "drift".
Oh, I see what you mean now. Although I have never heard of that issue before, we were not reseting the counts each cycle. We only reset them when necessary.
__________________
FLL Team Future imagineers
2010 Oregon State Championships: Winners
2011 International Invite: First place Robot design, Second Place Robot Performance
FRC Team Mean Machine
2012 Seattle: Winning alliance
2013 Portland: Winning alliance
2013 Spokane: Winning alliance
2014 Wilsonville: Winning alliance
2014 Worlds: Deans List Winner
Reply With Quote
  #13   Spotlight this post!  
Unread 11-05-2015, 00:11
Dunngeon Dunngeon is offline
Pumped
AKA: Ryan
FRC #0973 (Greybots)
Team Role: College Student
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Cal Poly San Luis Obispo
Posts: 299
Dunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond reputeDunngeon has a reputation beyond repute
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by InFlight View Post
If you could work out the incremental encoder setup, it would free you up to put a slip ring module at the top. That trade off would solve the motor wiring issue, and not restrict you to partial rotations.
Which slip ring would you use? Mercotac's are banned.
__________________
(2015-?): 973
(2012-2015): 955

Last edited by Dunngeon : 11-05-2015 at 00:19.
Reply With Quote
  #14   Spotlight this post!  
Unread 11-05-2015, 00:30
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,589
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: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Dunngeon View Post
Which slip ring would you use? Mercotac's are banned.
I was thinking of a custom solution when I suggested a module no taller than the wheel diameter. A quadrature encoder or a CAN controller wired in the traditional method would require 6 wires. Is it possible to make a CAN talon work with only two control wires that branch a bit away from the talon? If so, you could reduce the connection to four wires, if you could figure out a place to park the talon on the far side of the sliprings with the motor, gearbox, encoder, and wheel.
__________________

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.
Reply With Quote
  #15   Spotlight this post!  
Unread 11-05-2015, 01:24
InFlight's Avatar
InFlight InFlight is online now
3574 - The King's of Bling
AKA: Jim
FRC #3574 (High Tekerz)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Seattle Area
Posts: 164
InFlight is an unknown quantity at this point
Re: pic: Small CIM in wheel swerve

Quote:
Originally Posted by Dunngeon View Post
Which slip ring would you use? Mercotac's are banned.
There are quite a few Gold on Gold, or Silver on Silver contact designs that don't contain Mercury. The Wind turbine industry has lots of low cost high current options.

http://www.amazon.com/Sunwin-Wires-2...ords=Slip+ring

Company Specs
http://www.moflon.com/mw.php?a=1

Just one option, lots of other low cost (no-mercury) models. Moog would be nice, but really expensive.
__________________

Thank you 2016 Alliance Partners - 948, 1510, 2046, 2521, 2980, 2990, 4911, 4683
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 10:55.

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