I remember as a kid thinking how high a team number like 834 was. - Dancin103 [more]
 Chief Delphi Swerve Drive Encoder Calculations
 portal register members calendar search Today's Posts Mark Forums Read FAQ rules

#1
12-05-2018, 06:54 PM
 Vigin1 Registered User FRC #5507 Join Date: Oct 2017 Location: San Francisco Posts: 11
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?
#2
12-05-2018, 07:28 PM
 Kaboomboom3 Registered User FRC #2910 (Jack in the Bot) Team Role: Programmer Join Date: Apr 2017 Rookie Year: 2016 Location: Washington Posts: 3
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.
#3
12-06-2018, 09:42 AM
 Cyberphil 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
Re: Swerve Drive Encoder Calculations

Quote:
 Originally Posted by Kaboomboom3 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.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     User Announcements FIRST     General Forum     Rumor Mill     Career     Robot Showcase Technical     Technical Discussion     Robotics Education and Curriculum     Motors     Electrical         CAN     Programming         NI LabVIEW         C/C++         Java         Python     Sensors     Control System     Pneumatics     Kit & Additional Hardware     CAD         Inventor         SolidWorks         Creo     IT / Communications         3D Animation and Competition         Website Design/Showcase         Videography and Photography         Computer Graphics Competition     Awards         Chairman's Award     Rules/Strategy         Scouting     Team Organization         Fundraising         Starting New Teams         Finding A Team         College Teams     Championship Event     Regional Competitions     District Events     Off-Season Events     Thanks and/or Congrats     FRC Game Design     OCCRA         OCCRA Q&A Other     Chit-Chat         Games/Trivia         Fantasy FIRST     Car Nack's Corner     College & University Education     Dean Kamen's Inventions     FIRST-related Organizations         The Blue Alliance     FIRST In the News...     FIRST Lego League     FIRST Tech Challenge     VEX     Televised Robotics     Math and Science     Robot in 3 Days (RI3D)     NASA Discussion ChiefDelphi.com Website     CD Forum Support     Extra Discussion

All times are GMT -5. The time now is 01:15 AM.

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

 -- English (12 hour) -- English (24 hour) Contact Us - Chief Delphi - Rules - Archive - Top