Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Arm Position Control (http://www.chiefdelphi.com/forums/showthread.php?t=125981)

DjScribbles 07-02-2014 08:27

Arm Position Control
 
Our team has a motor driven arm mechanism that rotates around an axis and has a potentiometer for feedback.

The arm is fairly heavy and unbalanced, and it's range of motion is significant (180deg, give or take a bit). Since the torque required to counteract gravity varies with the angle of the arm, it seems like the simplest form of PID control is not appropriate (ie: directly driving the motor from the PID constants and potentiometer input).

I've kicked around a few different ideas, but I'm not experienced enough with controls to know a good solution when I see one. All of my ideas hinge on the idea that the torque needed to counter-act gravity at a given angle is the cosine of the angle multiplied by the torque required at 0deg (please correct me if this is wrong :] )

So here are the different approaches I have considered:

1) Multiplying the output of a PID loop tuned for the 0deg position before it is sent to the motor. Either
motor_output = PID_output * cos(theta) //working against gravity
motor_output = PID_output - (PID_output * cos(theta)) //when assisted by gravity
(We will likely have special cases to handle angles close to 90deg when the setpoint is not 90deg, these can be ignored)

2) Using the feed-forward (F) term of the PID loop, where the reference F(0deg) is the force required to maintain a position of 0deg, and constantly updating the F term based on the current position (or possibly target position):
F = F(0deg) * cos(theta) //Different PID values would remain unchanged with angle

3) Use discrete sets of PID constants at different angles, each tuned for operating within a particular range of the full swing of the arm, for each direction, and each load requirement.

Which of these approaches makes the most sense? Is there a better method that I haven't thought of?

I've implemented case 1 (but cannot test yet), although I'm beginning to consider case 2 after learning how the F term is used.

I'm also a little curious what the best method for minimizing I-term wind-up, my plan is to simply disable the I term until we've approached the set-point, but I'm curious how others typically handle this.

Bpk9p4 07-02-2014 08:58

Re: Arm Position Control
 
Have you considered using a velocity control PID. This will attempt to keep a constant velocity of your arms

notmattlythgoe 07-02-2014 09:01

Re: Arm Position Control
 
Is there a way that you could counter balance your arm? If it is possible that will make the tuning of the PID that much easier since the motor will only need to move the arm and not the weight of it. We've used surgical tubing to counter balance arms in previous years, including this year.

JamesCH95 07-02-2014 09:22

Re: Arm Position Control
 
I would strongly encourage you to count-balance your arm with springs of some sort.

I'll bet there's an easy way to have the spring force vary with angle such that it almost always directly counter-acts gravity.

apalrd 07-02-2014 09:28

Re: Arm Position Control
 
There are a couple ways you could do this:

-First off, look at how much friction there is in the arm. For a low-range-of-motion thing like a 180deg arm, I actually recommend a bit of friction. Our 2013 arm had an aluminum shaft pressed into a delrin block as the final bearing. We could have done ball bearings or needle bearings, but the added friction helped the control loops stabilize (and they had more than enough torque to do it, since we also hung with it).

-Second, look at your counterforce. Always counterforce. There are a lot of ways to do it.

-Third, look at your software. A basic PID control will probably work but not be optimal at all positions (As you said). There are a few ways to get around this:

-Gain Scheduling. You would have a no-gravity and peak-gravity gainset (kP,kI,kD) and blend them with the angle. This should work fairly well

-Feed Forward Gravity - You find the motor power to hold the arm at peak gravity (and assume it's 0 at no-gravity) and multiply it by sin or cos of theta, then add it in.

-In general, if you know exactly what you want from a control-loop steady state, you should add it in as a feed forward term. Then the PID only has to handle the slop.


-In the context of an arm, velocity PID is useless. It would not provide the desired response at all.

Alchemy99 07-02-2014 10:04

Re: Arm Position Control
 
My team is having this same issue, i think.

I am trying to tune a PID loop to control angular position of the arms. It should have been simple.

We are using an Encoder on the shaft for Angular measurement.

It should have been simple feed the input of the PID loop the encoder, set max and min outputs to 1, -1. and it should have worked. but the gains are extreamly low, 0.015 for P. for it not to overshoot. than when any load is applied it slows way down.

My experience with pid loops is limited. but no mater the load it will do its best to get to the setpoint repeatedly, same speed, time etc. within the capabilities of the motor.

JamesCH95 07-02-2014 10:08

Re: Arm Position Control
 
I'll add (how did I forget this!?) that the last time we used PID control for an arm we counter-balanced it with a pneumatic cylinder using flow control to dampen the arm's motion and a secondary regulator to fine-tune the cylinders force and easily bleed off pressure when the arm was compressing the cylinder. The PID loop then became a P-only loop with very good control, no I or D to tune or deal with at all, and thus no wind-up issues.

Ether 07-02-2014 10:20

Re: Arm Position Control
 


Use a torsion spring around the arm's pivot point to provide counter-balance. Set it up so that there's no force at 90 degrees.



Joe Ross 07-02-2014 13:39

Re: Arm Position Control
 
Quote:

Originally Posted by apalrd (Post 1339058)
-Third, look at your software. A basic PID control will probably work but not be optimal at all positions (As you said).

We've done a lot of single jointed arms that are not counter-balanced, and have always been happy with simple PID control. This does depend significantly on the mechanical design of your arm. Always start with the easiest solution and then decide if it needs more work rather then jumping to a more complicated solution based on theory.

Mr B 07-02-2014 14:44

Re: Arm Position Control
 
We've used trigonometry in the past (essentially sin of the angle - with zero degrees being vertical) with some success, but that was mainly for steady state offset.

In this case a torsion spring would work, but so would latex tubing (which we've also used with success... way more often than I'd admit). The nice thing about bungee is that you can always add more if it isnt pulling enough.

Ether 07-02-2014 14:55

Re: Arm Position Control
 
Quote:

Originally Posted by Mr B (Post 1339224)
In this case a torsion spring would work, but so would latex tubing...

The arm swings from 0 to 180 degrees. How would you mount the latex tubing?



notmattlythgoe 07-02-2014 15:00

Re: Arm Position Control
 
Quote:

Originally Posted by Ether (Post 1339230)
The arm swings from 0 to 180 degrees. How would you mount the latex tubing?



I'd have to see the layout of the arm, but there are ways it could be done.

Ether 07-02-2014 15:11

Re: Arm Position Control
 
Quote:

Originally Posted by notmattlythgoe (Post 1339235)
I'd have to see the layout of the arm, but there are ways it could be done.

If there were a stationary attachment point located vertically above the pivot, and of sufficient height, one could secure the tubing to that point and to the arm. That would provide minimum torque at noon and maximum torque (of opposite signs) at 3 and 9 o'clock.

Barring such an arrangement, what other options do you have in mind?



arizonafoxx 07-02-2014 15:13

Re: Arm Position Control
 
How are you driving the arm? Have you thought about using a Worm Gear so that once the arm is at the set point motor power can be removed and the Worm will maintain the angle.

Ether 07-02-2014 15:15

Re: Arm Position Control
 
Quote:

Originally Posted by arizonafoxx (Post 1339242)
How are you driving the arm? Have you thought about using a Worm Gear so that once the arm is at the set point motor power can be removed and the Worm will maintain the angle.

I guess the problem of getting to the setpoint without overshooting/oscillating still remains... unless accuracy and/or dynamic response are not important, in which case just gear the speed way down.




All times are GMT -5. The time now is 02:41.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi