Go to Post Well, it worked in inventor . . . - Chris Fultz [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 21-02-2005, 22:39
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
PI Like Control with Pots

I have run into a problem. Our main arm is powered by 2 fisher price motors, and is subject to backdrive when the arm is extended too much. I have a pot connected to it to drive to pre set positions, and I was wondering if anyone has had experience with coding a control loop that is driven by a potentiometer. Normally, I would research this topic, but with one night left to get this working, I need help.

Right now i am using a basic "check and correct" function. I have the code so when the joystick is neutral, it grabs the pots value. Then in the following program loops if that value deviates from the original, it will drive the motor accordingly. This is not working very well. Our only other alternative is a mechanical brake, but we do not have enough time to do this.

Please help me with this...

Thanks,
Tom
  #2   Spotlight this post!  
Unread 21-02-2005, 22:43
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: PI Like Control with Pots

A PID feedback loop is what you want. There are many, many threads on this including many with code posted. IM me if you want and I can give you my own code.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #3   Spotlight this post!  
Unread 22-02-2005, 02:07
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: PI Like Control with Pots

All I can suggest from my past years experience of working with pots is give it some slack. If you over power it, it will go nuts trying to correct itself.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #4   Spotlight this post!  
Unread 22-02-2005, 02:18
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
Re: PI Like Control with Pots

If the point of this feedback loop is to prevent backdriving, have you considered switching the jumper on your speed controllers to active breaking?

The double jointed arm I had the pleasure of working on, last year, had some trouble with inertia until we turned this option on. It worked like a charm.
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos
  #5   Spotlight this post!  
Unread 22-02-2005, 02:26
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,501
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: PI Like Control with Pots

Quote:
Originally Posted by FotoPlasma
have you considered switching the jumper on your speed controllers to active breaking?
LOL! A setting to break it! Anyhow, setting the braking jumper might not stop it, but it should noticably slow it's fall.
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004

Last edited by sanddrag : 22-02-2005 at 02:28.
  #6   Spotlight this post!  
Unread 22-02-2005, 02:31
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
Re: PI Like Control with Pots

*snap*
*crash*

*FotoPlasma walks away, whistling inconspicuously*
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos
  #7   Spotlight this post!  
Unread 26-02-2005, 17:38
jzampier's Avatar
jzampier jzampier is offline
Finger Lakes Regional Staff
AKA: Jeffrey Zampieron
no team (-)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Rochester
Posts: 74
jzampier is on a distinguished road
Send a message via AIM to jzampier
Re: PI Like Control with Pots

for an arm I'd avoid PID control. Usually you can get away with just P control and
you will avoid oscillatory problems that like to creep up with PI control.

The way P control works is very simple.
Take the actual postition of the arm (call it y) (from the pot) and subtract it from
the desired position of the arm. (call it r) (from your joystick/whatever).
This is your error signal value. e = r - y

Assuming your pots are calibrated so zero on the arm is in the appropriate location...
(if not add/subtract a fudge factor to y or r as needed)...

Multiple that error value by a constant... (called P
probably between 1 and 2) which is
determined experimentally...
and output that value + 127 to the motor.

output = 127 + ( P * e )

note that depending on directions of movement, e may be negative
and as such P may need to be negative if you are going the wrong direction.

Should work like a charm.
Matt Leese and I had a P controller working with 340's arm last sunday.
(Although I wanted a PD cause i thought it would be faster and more damped)

Man was it cool to push on the arm and watch it go back to where it was before.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour.
Sit with a pretty girl for an hour,
and it seems like a minute. THAT'S relativity." -Einstein

----
First Resume: (If I can remember)
2001 NJ Regional
2001 Championship
2002 NYC Regional
2003 OH Regional
2003 Championship
2004 OH Regional
2005 Finger Lakes Regional
2006 Finger Lakes Regional (yes!)

Last edited by jzampier : 26-02-2005 at 17:43.
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
2005 RadioShack® Innovation in Control Award! dez250 General Forum 10 10-03-2005 21:29
Invacare control system, UI? Jacob Morgan Control System 0 24-10-2004 16:54
What do you wish you knew about the new control system? Joe Ross Control System 2 09-01-2004 21:47
3-turn pots archiver 2001 2 24-06-2002 01:24
more control options smokescreen Technical Discussion 17 05-03-2002 15:41


All times are GMT -5. The time now is 10:55.

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