Go to Post I think the "F" in FIRST really stands for "friendly." - Rick TYler [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 06-02-2016, 15:03
Sky Captain's Avatar
Sky Captain Sky Captain is offline
Lead Software Mentor
AKA: Will
FRC #0386 (Voltage)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2006
Location: Virginia
Posts: 18
Sky Captain is an unknown quantity at this point
Send a message via AIM to Sky Captain
Automatic Differential/Motor Speed Compensation

Hey All,

We're encountering a problem, we are currently using Rhino drive, with 2 motors per side. Sometimes one set of motors runs faster than the other. When that happens we use a differential modifier on the RobotDrive class.
Example:
Code:
Robot Drive(0.8*DIFFERENTIAL, 0.8)
and that makes the robot drive straight. The problem is that the hardware changes slightly between different sessions, so that means the DIFFERENTIAL modifier needs to change. Has anyone experimented with doing this automatically using encoders or anything else? Sorry, if the post isn't too clear, if you have questions I'm willing to supply answers.

Edit: We are using tank drive style, not arcade style.
__________________
When in doubt, check the documentation.

Last edited by Sky Captain : 06-02-2016 at 15:41. Reason: Drive Style
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2016, 15:23
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Automatic Differential/Motor Speed Compensation

Encoders could work, using a PID to compensate the turn. This is complicated but it does work. Using a gyroscope works as well.

I always recommend fixing the problem mechanically though. If it's such a problem that a driver can't compensate themselves, you have an issue on your hands that should be physically fixed.
__________________
All opinions are my own.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2016, 15:25
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
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: Automatic Differential/Motor Speed Compensation


http://www.chiefdelphi.com/forums/sh...48&postcount=7

http://www.chiefdelphi.com/forums/sh...33&postcount=2


Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2016, 16:05
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
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: Automatic Differential/Motor Speed Compensation

Quote:
Originally Posted by Sky Captain View Post
if you have questions I'm willing to supply answers

OK:

- skidsteer drivetrain

- tank drive user interface


Questions:

Are you just trying to solve the problem of driving straight a given distance in autonomous?

Or are you getting pushback from the drivers that the bot is annoyingly asymmetric and you're trying to correct that?

Are you using SRX motor controllers in CAN mode?

Do you plan to use encoders only, or are you open to the idea of adding a gyro as well?

EDIT (adding Joel's question): Have you tried to identify possible mechanical issues? How?


The set of optimal solutions depends on how you answer the questions.

Last edited by Ether : 06-02-2016 at 16:37.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2016, 12:27
Sky Captain's Avatar
Sky Captain Sky Captain is offline
Lead Software Mentor
AKA: Will
FRC #0386 (Voltage)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2006
Location: Virginia
Posts: 18
Sky Captain is an unknown quantity at this point
Send a message via AIM to Sky Captain
Re: Automatic Differential/Motor Speed Compensation

Mostly the first two problems you posted. When we drive in autonomous, sometimes it doesn't drive straight. Also with the motors being off, the drivers are having to attempt to manually compensate for differing speeds on the left and right set of motors. On the robot we are testing, we are using Jaguars set up in PWM (standard) mode. We have encoders and a gyro. We've checked out the gearboxes, and made sure that all the treads are tight. We think it might be an inherent differences in the motors themselves.
__________________
When in doubt, check the documentation.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2016, 12:53
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
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: Automatic Differential/Motor Speed Compensation

Quote:
Originally Posted by Sky Captain View Post
We think it might be an inherent differences in the motors themselves.
How difficult would it be to pull the right and left motors out and swap them?

That would definitively tell you whether it's the motors, or friction in the drivetrain.



Reply With Quote
  #7   Spotlight this post!  
Unread 07-02-2016, 13:11
Sky Captain's Avatar
Sky Captain Sky Captain is offline
Lead Software Mentor
AKA: Will
FRC #0386 (Voltage)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2006
Location: Virginia
Posts: 18
Sky Captain is an unknown quantity at this point
Send a message via AIM to Sky Captain
Re: Automatic Differential/Motor Speed Compensation

Not that difficult actually, I'll get mechanical on it and report what the results are. Thanks.
__________________
When in doubt, check the documentation.
Reply With Quote
  #8   Spotlight this post!  
Unread 12-02-2016, 11:58
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
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: Automatic Differential/Motor Speed Compensation

Quote:
Originally Posted by Sky Captain @ 02-07-2016, 01:11 PM View Post
Not that difficult actually, I'll get mechanical on it and report what the results are. Thanks.
any news ??


Reply With Quote
  #9   Spotlight this post!  
Unread 12-02-2016, 19:41
Sky Captain's Avatar
Sky Captain Sky Captain is offline
Lead Software Mentor
AKA: Will
FRC #0386 (Voltage)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2006
Location: Virginia
Posts: 18
Sky Captain is an unknown quantity at this point
Send a message via AIM to Sky Captain
Re: Automatic Differential/Motor Speed Compensation

We just got our frame assembled, and we were going to disassemble the tracks when we migrated them from the test bot to the real bot. I'll report back sometime during the weekend when this happens.
__________________
When in doubt, check the documentation.
Reply With Quote
  #10   Spotlight this post!  
Unread 21-02-2016, 21:47
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
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: Automatic Differential/Motor Speed Compensation

Quote:
Originally Posted by Sky Captain 02-12-2016 07:41 PM View Post
I'll report back sometime during the weekend when this happens.
Any news??


Reply With Quote
  #11   Spotlight this post!  
Unread 12-03-2016, 09:16
RSNovi RSNovi is offline
Registered User
FRC #6081
 
Join Date: Jan 2016
Location: Grass Lake
Posts: 12
RSNovi is an unknown quantity at this point
Re: Automatic Differential/Motor Speed Compensation

We have a similar problem with our robot. One of the gear boxes on one side is tighter. It doesn't seem to cause problems when manually driving, but long distances in autonomous mode would cause it to veer slightly.

We corrected by designing an algorithm using the gyro which we can set an angle and the PI controller will correct. Unfortunately it isn't perfect because the gyros drift so bad.

We were having good luck scoring a goal autonomously and we made it to the finals. After turning the robot on the announcers would talk so long that the gyro would start drifting like crazy before the robots started. The reference library takes 5 seconds to calibrate the gyro. I wonder if that could be reduced.
Reply With Quote
  #12   Spotlight this post!  
Unread 12-03-2016, 09:23
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
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: Automatic Differential/Motor Speed Compensation

Quote:
Originally Posted by RSNovi View Post
After turning the robot on the announcers would talk so long that the gyro would start drifting like crazy before the robots started. The reference library takes 5 seconds to calibrate the gyro. I wonder if that could be reduced.
It doesn't take 5 seconds to read the gyro and use that reading as a zero offset.


Reply With Quote
  #13   Spotlight this post!  
Unread 12-03-2016, 11:38
RSNovi RSNovi is offline
Registered User
FRC #6081
 
Join Date: Jan 2016
Location: Grass Lake
Posts: 12
RSNovi is an unknown quantity at this point
Re: Automatic Differential/Motor Speed Compensation

I know reading the gyro doesn't take that long, the calibration routine takes 5 seconds on the 450 gyro. That is when using the WPI class.

When it drifts it really takes off. I reset the gyro at the very beginning, but if it is already drifting it will be off a few degrees in a matter of a few seconds. Ideally I would like to calibrate the gyro in my autonomous init.
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 09:33.

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