Go to Post Please don't confuse energetic enthusaism with acting obnoxious. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Old Forum Archives > 2000
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
  #13   Spotlight this post!  
Unread 23-06-2002, 22:23
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: Scaling Values in the Control Program

Posted by Dung Cao.

Engineer on team #397 from Flint Southwestern Academy and Delphi Automotive - E&C.

Posted on 3/16/2000 9:46 AM MST


In Reply to: Scaling Values in the Control Program posted by Nate Smith on 3/15/2000 10:06 AM MST:



Here are some formulas that I've been using to scale down the speed of the pwm. These should help you. I also have an excel spreadsheet with graphics to show the speed control. It really helps out to figure these scaling. If you need this spreadsheet, just email me at Dung.Cao@delphiauto.com

Speed limit algorithm
100% speed >>>>>> pwm = p_y
75% >>>>>> pwm = 31.75 + ((3/4) * p_y)
50% >>>>>> pwm = 63.50 + (p_y / 2)
33% >>>>>> pwm = 84.66 + (p_y / 3)
25% >>>>>> pwm = 95.25 + (p_y / 4)

Also here is the one-joystick control for x-y control.

'================== DRIVE for joytick 2 ====================================
'
' This section modified the output of PWM1, and PWM 2 for control from one
' joystick (Port 2).
' Basic Stamp does not recognize negative numbers. Therefore, have to add 2000
' to algorithm, then delete 2000 for the result
' p2_y = Y-axis controls speed.
' p2_x = X-axis turns.
' pwm1 - Left motor.
' pwm2 - Right motor.
'-----------------------------------------------------------------------------

If p2_sw_trig 1 then notturbo:
pwm1 = (((2000 + p2_y - p2_x + 127) Min 2000 Max 2254) - 2000)
pwm2 = (((2000 + p2_y + p2_x - 127) Min 2000 Max 2254) - 2000)
Goto NoChange:

notturbo:
If p2_sw_top 1 then regularspeed:
pwm1 = ((2000 + (p2_y/4) - (p2_x/4) + 127) Min 2095 Max 2159) - 2000
pwm2 = ((2000 + (p2_y/4) + (p2_x/4) + 63) Min 2095 Max 2159) - 2000
Goto NoChange:

regularspeed:
pwm1 = ((2000 + (p2_y/2) - (p2_x/2) + 127) Min 2064 Max 2190) - 2000
pwm2 = ((2000 + (p2_y/2) + (p2_x/2)) Min 2064 Max 2190) - 2000


: Does anybody out there have a foolproof way to scale down values in the control program? Whenever i try it, using different scaling constants for forward and reverse(scaling joystick inputs), I always seem to lose part of the range completely. Help!

: Nate


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
 


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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Battlebots I.Q.- A serious threat to FIRST or a half thought up cheep copy? Joe Matt General Forum 75 17-10-2005 20:43
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
Anyone looking for more program space? archiver 2001 13 24-06-2002 02:20
robot control emulator for default or other program CharlieWilken Programming 26 24-02-2002 02:36
control program looping??? ctartist236 Programming 1 08-02-2002 10:09


All times are GMT -5. The time now is 18:59.

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