OCCRA
Go to Post Do whatever you must to survive within the rules, but please stay within the rules. - Kevin Sevcik [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media  
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 12-05-2018, 06:54 PM
Vigin1 Vigin1 is offline
Registered User
FRC #5507
 
Join Date: Oct 2017
Location: San Francisco
Posts: 11
Vigin1 is on a distinguished road
Swerve Drive Encoder Calculations

We are currently using swerve drive wheels from Swerve Drive Specialties made by team 2910. How do we calculate the number of ticks per revolution for a wheel?
Reply With Quote
  #2   Spotlight this post!  
Unread 12-05-2018, 07:28 PM
Kaboomboom3 Kaboomboom3 is offline
Registered User
FRC #2910 (Jack in the Bot)
Team Role: Programmer
 
Join Date: Apr 2017
Rookie Year: 2016
Location: Washington
Posts: 3
Kaboomboom3 is a splendid one to beholdKaboomboom3 is a splendid one to beholdKaboomboom3 is a splendid one to beholdKaboomboom3 is a splendid one to beholdKaboomboom3 is a splendid one to beholdKaboomboom3 is a splendid one to beholdKaboomboom3 is a splendid one to beholdKaboomboom3 is a splendid one to behold
Re: Swerve Drive Encoder Calculations

One way you could do it is to first divide encoder ticks by the per encoder rotation and then multiplying that by your gear ratio. This will result in wheel rotations which you can then juat multiply my the circumference of the wheel to get distance.

In our code last year we had a constant that was equal to the amount of ticks equal to one inch of travel. While the formula I said above works really well, it is often hard to determine the circumference of the wheel without taking the wheel off. To overcome this we drove a predetermined distance forward manually (in our case usually 10 feet), averaged the encoder readings, and then divided by the distance we drove.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-06-2018, 09:42 AM
Cyberphil's Avatar
Cyberphil Cyberphil is offline
That Guy
FRC #0103 (Cybersonics), FRC 272 (Cyber Crusaders), FRC 6808 (WTR)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Doylestown, PA
Posts: 1,034
Cyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond reputeCyberphil has a reputation beyond repute
Re: Swerve Drive Encoder Calculations

Quote:
Originally Posted by Kaboomboom3 View Post
In our code last year we had a constant that was equal to the amount of ticks equal to one inch of travel. While the formula I said above works really well, it is often hard to determine the circumference of the wheel without taking the wheel off. To overcome this we drove a predetermined distance forward manually (in our case usually 10 feet), averaged the encoder readings, and then divided by the distance we drove.
Second this. Empirical data definitely supersedes pure math in these cases, especially because wheels wear, and some at different rates than others if your wheels are not all on the same plane.

While doing this make sure the backlash in the system is removed. There are a number of ways to accomplish that, but the easiest is to move the bot in the same direction you will be measuring distance before you begin.

I am not a programmer by any stretch of the imagination, but it may be reasonable if you have uneven wear on swerve module wheels to do what Kaboomboom3 recommended, but instead create individual ratios for each wheel. Programmers, feel free to slap my wrists if this is frowned upon.
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 01:12 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi