Go to Post The problem with anecdotal evidence is that you never seem to get the whole anecdote. - Lea DeFoote [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 04-24-2007, 07:08 AM
CyberWolf_22's Avatar
CyberWolf_22 CyberWolf_22 is offline
Programming and Electrical Mentor
AKA: Allen Gregory
FRC #2587 (Afrobots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Houston, Texas
Posts: 227
CyberWolf_22 is just really niceCyberWolf_22 is just really niceCyberWolf_22 is just really niceCyberWolf_22 is just really nice
Re: Default code question

The basic idea is that it takes the p1_x value and adds it to p1_y for one side of the robots motors and subtracts it from p1_y for the other set of motors.
This makes it so that a single joystick can provide control of a tank steered robot.
The limit_mix function stops the values from going out of range of an ordinary PWM value of 0-254.

Take for example if the y axis is 0 and you move the x axis.
You will be adding and subtracting from zero so each set of motors PWM value will have the same magnitude away from neutral, 127, but in opposite directions so the robot will spin in place.
If you move the y axis while the x axis is non zero the robot will begin to arc because the y axis is added directly to both sides of the robot evenly.

I hope that helps.
__________________
 


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
2007 IFI default code question Japper Programming 4 01-22-2007 11:23 PM
problems using gyro/adc code with camera default code tanstaafl Programming 7 01-22-2006 11:09 PM
Question about Solenoid and default code waialua359 Control System 4 01-21-2006 06:21 PM
navigate and default code newbie question alan koch Programming 2 02-17-2004 10:25 PM
Rookie Programmer has question about the default code DanL Programming 3 01-26-2002 07:59 PM


All times are GMT -5. The time now is 04:03 PM.

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