View Single Post
  #2   Spotlight this post!  
Unread 08-01-2007, 21:41
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: What is the Limit_Mix function

The limit mix function is a bit of software that takes the two axes from one joystick, and calculates the corresponding PWM outputs. In order to adjust a PWM value by a constant factor, try something like this:

Code:
pwm01 = (pwm01-127)*0.75+127
There may be a typecasting issue there, so you'll need to play around with it. However, the idea is that you need to recenter the value around 0 (by subtracting 127), lessen the magnitude (by multiplying by less than 1), and then shift back to the normal range (by adding the 127 back). In this case, this code would reduce a motor to 75% of its original speed. If that doesn't make sense, feel free to ask for more clarification.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_

Last edited by jgannon : 08-01-2007 at 21:43.