View Single Post
  #2   Spotlight this post!  
Unread 14-01-2008, 10:42
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Mech Wheel Programing

Quote:
Originally Posted by whlspacedude View Post
This year we would like to try mech drive with 1 joystick. this joystick has x,y and z(twist) on the stick and t for speed.
i have no clue how to do mech programing and would really like some help with it .
we would like strafe with the x axis and turn with the z axis.
also we would like speed control with the t axis
how would we go about doing this in easyc?
While it's not easyC, check here: http://www.chiefdelphi.com/forums/sh...m+drive+co de

The basic idea for either an omnidirection or mechanum drive train, each wheel will have a certain speed that it needs to be driven to contribute to the desired combination of f/b motion, strafing, and turning. You calculate these for each wheel, and sum them up.

Code:
fr_pwm = speed-turn+strafe;
fl_pwm = speed+turn-strafe;
br_pwm = speed-turn-strafe;
bl_pwm = speed+turn+strafe;
You may have to reverse some of these due to how your motors are installed, and you would be best to do a lot of bounds checking and be careful with variable types to make sure you don't have wraparound errrors.