Go to Post After this trip, a person might want to change their underpants. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-01-2007, 21:33
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
What is the Limit_Mix function

Can someone describe this function to me?

Im trying to reduce the speed of the motors; how would I edit this:

pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);
  #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.
  #3   Spotlight this post!  
Unread 08-01-2007, 21:44
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
Re: What is the Limit_Mix function

Thats perfect; THank you so much!

Also one problem; when I try to edit the MPLab code and build it it says no source files in teh project.

How do I get around this?
  #4   Spotlight this post!  
Unread 08-01-2007, 22:10
Eclipse's Avatar
Eclipse Eclipse is offline
Registered User
AKA: Sensei Hanzo
FRC #1250 (Gatro-Bots)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Dearborn, MI
Posts: 18
Eclipse is an unknown quantity at this point
Re: What is the Limit_Mix function

I believe that means you set up MPLab wrong when you were installing it. However, I'm not sure exactly what the problem is. Did you install the compiler first and then MPLab or the other way around?
__________________
xXx.S3nS31-h4nz0.xXx
  #5   Spotlight this post!  
Unread 08-01-2007, 22:14
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
Re: What is the Limit_Mix function

the other way around. I set up MP lab then the compiler
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic. Using a loop to solve the cosine function. sanddrag Programming 2 10-03-2006 11:45
Arcade Function gabrielse Programming 1 08-02-2006 00:49
Limit_Mix() Function EricWilliams Programming 2 27-07-2005 23:19
Autocalibrate function Validius Programming 2 29-03-2005 21:59
FreeLibrary() Function Raven_Writer Programming 0 09-08-2003 15:39


All times are GMT -5. The time now is 02:09.

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