Go to Post If all you are is a nail, every hammer looks like a problem. - Alan Anderson [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 08-02-2015, 22:42
GeeTwo's Avatar
GeeTwo GeeTwo is online now
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,609
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: How to Code Gyro to Help with Straight Strafing?

The gyroscope does not have to be at the COG of the robot, but it is helpful if it is somewhere near the COG.

How you do this depends greatly on your drive system. The two most likely drive chassis to use "strafing" are mecanum and h-drive. I do not have any experience with lobster, crab, or swerve.

Mecanum: The easiest way to do this is to use the Holonomic Drive class, in "field coordinates". We got one of these working in December using the cRIO, and the code is posted at https://github.com/frc3946/MecanumDrivetrain.

H-drive: While strafing, use the "tank drive" wheels to maintain your bearing (that is, azimuth) while you strafe. This can be done using a PID, or probably just with a very simple "P" loop - if you're too far left, rotate a bit to the right, if you're too far left rotate a bit to the left. The amount of rotation would be proportional (that's the P) to the error in your current bearing. If the proportionality constant is too large, you'll oscillate around the correct angle; if too low, you'll keep drifting away. We're using H-drive this year, but haven't written this yet - we have an adjustable strafe wheel mount, so we are hoping that we don't rotate very much. In any case, our rotation will be controlled primarily by a pair of range finders rather than the gyro.
__________________

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
 


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 22:27.

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