Go to Post Oh geez your using math. I never touched the stuff myself.:o - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-13-2018, 11:12 PM
klhutchi klhutchi is offline
Registered User
FRC #5736
 
Join Date: Feb 2016
Location: New York
Posts: 9
klhutchi is an unknown quantity at this point
First Time PID user

Our team is using a rotating arm to grab cubes off the floor and lift them for switch height. In order to hold position we are trying out a PID controller, We have a 30in arm ~10lbs(+4 with cube) that rotates from 0-120 degrees.

A Mini Cim geared down to 140:1 and chain driven sprockets at 12:28 to slow it down to manageable levels attached to a Analog Pot.

I've read a few forums about tuning a PID loop and was hoping for some experienced advice for this application. We added torsion springs to try and assist the arm, but the speed difference between rising and falling are not quite what we want. Currently the motors run a 75% with P at 2.25, I at .008, and D at 0. It holds position but doesn't find it very nicely (Sudden stops not much oscillation).

I was thinking of trying the AutoTuning function in Labview but not to sure of its effectiveness. Any ideas?

Additionally the Motor controller is set to brake, does that work with or against the PID control?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-14-2018, 12:00 AM
Classified*'s Avatar
Classified* Classified* is offline
Drive it like you stole it
AKA: Julia Cecchetti
FRC #0291 (CIA: Creativity in Action)
Team Role: Leadership
 
Join Date: Nov 2015
Rookie Year: 2015
Location: Erie PA
Posts: 221
Classified* has much to be proud ofClassified* has much to be proud ofClassified* has much to be proud ofClassified* has much to be proud ofClassified* has much to be proud ofClassified* has much to be proud ofClassified* has much to be proud ofClassified* has much to be proud ofClassified* has much to be proud of
Re: First Time PID user

We have an arm this year as well. It all comes down to telling your PID controller everything you can about the dynamics of your system. The simple answer is to do the math. Calculate the torque due to gravity at a given angle of the arm (this will be the weight of your arm times the distance from the pivot to the center of mass of your arm). Remember gravity always points down, so you need to factor in the angle of your arm and only take the component that points down. So this means if you define theta (the angle) with zero degrees being your arm straight up and down and 90 degrees being parallel to the floor, the torque due to gravity on your arm is:

Torque = ArmWeight*sin(theta)*DistanceOfCoM

So in your case this is (14 lbs)*sin(theta)*(20 in). I made a guess on where your center of mass would be, as it most likely isn't all the way out on the end of the arm.

Then you calculate the power you need to send to the motors to hold the arm stationary using your gear ratio and the type of motor you have. Then simply add this to your PID output! What this does is it removes the difference in the apparent weight of the system to your PID loop. So in your code, you would calculate the PID output, add the "hold Position" power you calculated, and send that to the motors.

This is exactly what we did and you can see the results in this video! Our math was a bit more complicated because we had a gas spring to help the arm up (think 4 nested trig functions) , but it works super well!

Break mode won't really affect anything, It only applies when you send zero power to the motors.

If you have further questions, just ask! I hope that helps!
__________________

2017 NEOFRA MVRC Winner with 2399 and 2252
2017 Steel City Showdown Winner with 2614 and 3260
2017 WOW Championship Finalist with 4145, 3138, and 3511
2016 Rachacha Ruckus Finalist with 5406 and 639
2015 Rachacha Ruckus Finalist with 1126 and 5406
2015 NEOFRA MVRC Finalist with 48 and 379
2015 Buckeye Regional Finalist with 48 and 5413
Team291.com
Reply With Quote
  #3   Spotlight this post!  
Unread 02-14-2018, 10:20 AM
klhutchi klhutchi is offline
Registered User
FRC #5736
 
Join Date: Feb 2016
Location: New York
Posts: 9
klhutchi is an unknown quantity at this point
Re: First Time PID user

Thank you I figured it was some scaling factor didn't quite see how to apply it. I'll try it out today
Reply With Quote
Reply


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


All times are GMT -5. The time now is 11:53 PM.

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


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