"Drink Mountain Dew. Eat Pizza. Make Robot. This is life." - onecoolc [more]
 Chief Delphi Acceleration Curve
 CD-Media CD-Spy
 portal register members calendar search Today's Posts Mark Forums Read FAQ rules

#1
01-30-2006, 06:39 PM
 EricWilliams Registered User FRC #2039 (Rockford Robotics) Team Role: Mentor Join Date: Mar 2005 Rookie Year: 2001 Location: Rockford, IL Posts: 104
Acceleration Curve

We used an acceleration curve to overcome the sensitivity of the low range of the joystick. The code looks exactly like this:

Code:
```tempRight = pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
tempLeft = pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);

if(p1_y >= 127){
tempRight = (tempRight - 127)(tempRight - 127)/127 + 127;
tempLeft = (tempLeft - 127)(tempLeft - 127)/127 + 127;
}
if(p1_y < 127){
tempRight = (tempRight - 127)(tempRight - 127)/-127 + 127;
tempLeft = (tempLeft - 127)(tempLeft - 127)/-127 + 127;
}

pwm13 = pwm14 = tempRight;
pwm15 = pwm16 = tempLeft;```
When building, the compiler gives error 1202: Call of non-function, on the 4 lines inside the if statements.

I'm completely stumped, any help would be greatly appreciated.
#2
01-30-2006, 06:44 PM
 Cuog Registered Linux User: 390661 AKA: Alex FRC #0422 Team Role: Mentor Join Date: Nov 2005 Rookie Year: 2004 Location: Richmond, Virginia Posts: 854
Re: Acceleration Curve

I'm not entirely sure what the error is in your code i will take a look at it again but if u want here is the method i used for doind the same thing u are doing:

try adding brackets for order of operations:
tempRight = (((tempRight - 127) * (tempRight - 127))/127) + 127;

Quote:
 Originally Posted by code #include "ifi_aliases.h" #include "ifi_default.h" #include "ifi_utilities.h" #include "user_routines.h" #include "cuog_cam.h" #include "cuog_util.h" #include "math.h" void Exp_Joy_Mapping() { char raw = 0; switch(MAP_NUMBER) { //maps joystick and PWM #8 case 8: raw = (MAP_JOYSTICK08 - 128) / 11.3; if(MAP_JOYSTICK08 < 127) { MAP_PWM08 = (raw * raw) - 128; } else { MAP_PWM08 = (raw * raw) + 128; } //maps joystick and PWM #7 case 7: raw = (MAP_JOYSTICK07 - 128) / 11.3; if(MAP_JOYSTICK07 < 127) { MAP_PWM07 = (raw * raw) - 128; } else { MAP_PWM07 = (raw * raw) + 128; } //maps joystick and PWM #6 case 6: raw = (MAP_JOYSTICK06 - 128) / 11.3; if(MAP_JOYSTICK06 < 127) { MAP_PWM06 = (raw * raw) - 128; } else { MAP_PWM06 = (raw * raw) + 128; } //maps joystick and PWM #5 case 5: raw = (MAP_JOYSTICK05 - 128) / 11.3; if(MAP_JOYSTICK05 < 127) { MAP_PWM05 = (raw * raw) - 128; } else { MAP_PWM05 = (raw * raw) + 128; } //maps joystick and PWM #4 case 4: raw = (MAP_JOYSTICK04 - 128) / 11.3; if(MAP_JOYSTICK04 < 127) { MAP_PWM04 = (raw * raw) - 128; } else { MAP_PWM04 = (raw * raw) + 128; } //maps joystick and PWM #3 case 3: raw = (MAP_JOYSTICK03 - 128) / 11.3; if(MAP_JOYSTICK03 < 127) { MAP_PWM03 = (raw * raw) - 128; } else { MAP_PWM03 = (raw * raw) + 128; } //maps joystick and PWM #2 case 2: raw = (MAP_JOYSTICK02 - 128) / 11.3; if(MAP_JOYSTICK02 < 127) { MAP_PWM02 = (raw * raw) - 128; } else { MAP_PWM02 = (raw * raw) + 128; } //maps joystick and PWM #1 case 1: raw = (MAP_JOYSTICK01 - 128) / 11.3; if(MAP_JOYSTICK01 < 127) { MAP_PWM01 = (raw * raw) - 128; } else { MAP_PWM01 = (raw * raw) + 128; } break; } }
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.

Last edited by Cuog : 01-30-2006 at 06:50 PM.
#3
01-30-2006, 06:46 PM
 Astronouth7303 Why did I come back? AKA: Jamie Bliss FRC #4967 (That ONE Team) Team Role: Mentor Join Date: Jan 2004 Rookie Year: 2004 Location: Grand Rapids, MI Posts: 2,071
Re: Acceleration Curve

You need an asterisk (*) to multiply.
#4
01-30-2006, 06:51 PM
 Andrew Blair SAE Formula is FIRST with Gasoline. FRC #0306 (CRT) Team Role: Alumni Join Date: Feb 2005 Rookie Year: 2004 Location: Corry Posts: 1,193
Re: Acceleration Curve

Quote:
 Originally Posted by Astronouth7303 You need an asterisk (*) to multiply.
Thats the one!
__________________
Reading makes a full man, conference a ready man, and writing an exact man.
-Sir Francis Bacon

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
-Albert Einstein
#5
01-30-2006, 06:52 PM
 EricWilliams Registered User FRC #2039 (Rockford Robotics) Team Role: Mentor Join Date: Mar 2005 Rookie Year: 2001 Location: Rockford, IL Posts: 104
Re: Acceleration Curve

Quote:
 Originally Posted by Astronouth7303 You need an asterisk (*) to multiply.

'Doh! Man, 3 years programming C and I still make these stupid mistakes. Yesterday I forgot to end a quotation on a string and the compiler decided to give a syntax error on a comment 20 lines down

Thanks alot for the help guys, it's always nice to have the outside party take a look at your code because one of two things can happen:

1. They write it better.
2. They find your stupid mistake.
#6
02-01-2006, 03:27 PM
 Matt Krass "Old" and Cranky. Get off my lawn! AKA: Dark Ages FRC #0263 (Sachem Aftershock) Team Role: Mentor Join Date: Oct 2002 Rookie Year: 2002 Location: Long Island, NY Posts: 1,186
Re: Acceleration Curve

Quote:
 Originally Posted by Ewilliams2006 'Doh! Man, 3 years programming C and I still make these stupid mistakes. Yesterday I forgot to end a quotation on a string and the compiler decided to give a syntax error on a comment 20 lines down Thanks alot for the help guys, it's always nice to have the outside party take a look at your code because one of two things can happen: 1. They write it better. 2. They find your stupid mistake.
3. You can help them find their stupid mistakes. Stupid if statements ;-)
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     User Announcements FIRST     General Forum         FIRST E-Mail Blast Archive     Rumor Mill     Career     Robot Showcase Technical     Technical Discussion     Robotics Education and Curriculum     Motors     Electrical         CAN     Programming         NI LabVIEW         C/C++         Java         Python     Control System         FRC Control System         Sensors     Pneumatics     Kit & Additional Hardware     CAD         Inventor         SolidWorks         Creo     IT / Communications         3D Animation and Competition         Website Design/Showcase         Videography and Photography         Computer Graphics     National Instruments LabVIEW and Data Acquisition         LabView and Data Acquisition Competition     Unsung FIRST Heroes     Awards         Chairman's Award     Rules/Strategy         Scouting         You Make The Call     Team Organization         Fundraising         Starting New Teams         Finding A Team         College Teams     Championship Event     Regional Competitions     District Events     Off-Season Events     Thanks and/or Congrats     FRC Game Design     OCCRA         OCCRA Q&A         OCCRA Programming Other     Chit-Chat         Games/Trivia             Fantasy FIRST     Car Nack's Corner     College & University Education     Dean Kamen's Inventions     FIRST-related Organizations         Western Region Robotics Forum         Southern California Regional Robotics Forum         The Blue Alliance             Video Archives     FIRST In the News...     FIRST Lego League         Lego Mindstorm Discussion     FIRST Tech Challenge     VEX         VEX Robotics Competition         VEX IQ     Televised Robotics     Math and Science         NASA Discussion ChiefDelphi.com Website     CD Forum Support     Extra Discussion

 Similar Threads Thread Thread Starter Forum Replies Last Post (SolidWorks) Create Sketch Points Around Curve Yan Wang Inventor 6 08-04-2005 08:20 PM Acceleration Sensor Connected, but values are odd.... Leav Electrical 7 02-04-2005 02:28 PM van door torque curve DLyons Motors 1 01-13-2003 08:54 PM Drill motor torque curve thedillybar Motors 1 03-10-2002 04:19 AM The Learning Curve Was Steep! Mike McIntyre OCCRA 0 11-11-2001 11:23 PM

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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.

 -- English (12 hour) -- English (24 hour) Contact Us - Chief Delphi - Rules - Archive - Top