Go to Post A lack of knowledge is okay; a lack of initiative to learn more is not. - Madison [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
  #1   Spotlight this post!  
Unread 02-03-2006, 00:47
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,182
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Motor Ramp Up/Ramp Down Function

As many of you know, our robot runs on brecoflex belts. We have always been fine in the past, but this year we are experiencing some problems with stretching the steel fibers that hold the belts together. We have broken 2 belts already, and at $150 a pop, are trying to do everything possible to not break any more.

We have watched videos of the belts breaking and have traced the problem back to accelerating to full speed from a stop. We are running an open loop control system, so if the driver mashes the joystick to its maximum, the motor is going to go from a dead stop to full voltage in a very short amount of time. When this happens, we believe an excess amount of torque is being applied to the belt, and causing it to break.

We have also decided the easiest way to save our belts (and our battery too!) is to have our motor's PWM output ramp up and down when joystick input values are changing rapidly. So far, I have thought of 2 plausible ideas on how to solve this problem, and would like to see which one would work better, or if other teams have solved the problem in a different way.

Choice 1: Velocity based PI Control
Intuition tells me I can accomplish what I want by setting the proportional gain very small and setting the integral gain somewhat high. As the error between the input (joystick) and output (wheel speed) changes, the low p term will cause the output signal to change slowly. As time elapses, the Integral stage will pick up on the accumulated error due to the low P gain, and increase the output signal exponentially. I tried simulating in LabVIEW, but I didn't get the results I expected. Can someone tell me why?

Here is an image explaining what I want compared to what LabVIEW spit back at me.





Choice 2: Write a custom function
I would need to look at the difference in input values across program loops (delta input). If this value is small, leave motor outputs directly mapped to that input. If the change in input values over time is higher than a pre defined limit, keep the old output value and add or subtract a certain amount of values until the wanted output speed is achieved. It may look something like this...
Code:
static int capture_value, output, mode, oldInput;

//rate of change in joystick values.
delta = input - oldInput;

//is joystick being moved too fast?
if(delta >= DELTA_LIMIT) { 
	mode=RAMPING_UP; 
	capture_value = input;
}else if(delta <= -DELTA_LIMIT) { 
	mode=RAMPING_DOWN; 
	capture_value = input;
} 

//output integration
switch(mode){
	case RAMPING_UP: 
		output+= RAMP_UP_CONSTANT;
		if(output >= capture_value) { mode = NORMAL; }
		break;
		
	case RAMPING_DOWN:
		output-= RAMP_DOWN_CONSTANT;
		if(output <= capture_value) { mode = NORMAL; }
		break;
		
	case NORMAL:
		output = input;
		break;
	case default: break;
}

Motor = output;

//Keep values for next loop
oldInput = input;

What do you think? Which one of these solutions is better fit for my cause? Do you have something that will work better, or that you have used in the past?
 


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
Presence of function causes auton to fail??? Kyveck Programming 13 16-02-2006 14:48
Loop time for OperatorControl function? Debug blows... Chris_Elston Programming 10 13-02-2006 14:42
TTL port to a serial port on a demo board ImmortalAres Programming 16 09-07-2005 23:44
RoboEmu2(code simulator)--now with C! rbayer Programming 23 17-02-2005 09:17
heres the code. y this not working omega Programming 16 31-03-2004 15:18


All times are GMT -5. The time now is 01:48.

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