|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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.
|
|
#3
|
|||||
|
|||||
|
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.
|
|
#4
|
||||
|
||||
|
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. |
|
#5
|
|||
|
|||
|
Re: PI Like Control with Pots
Quote:
Last edited by sanddrag : 22-02-2005 at 02:28. |
|
#6
|
||||
|
||||
|
Re: PI Like Control with Pots
*snap*
*crash* *FotoPlasma walks away, whistling inconspicuously* |
|
#7
|
||||
|
||||
|
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. ![]() Last edited by jzampier : 26-02-2005 at 17:43. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |