Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Alternative to PID speed control (http://www.chiefdelphi.com/forums/showthread.php?t=104757)

baronep 18-03-2012 11:46

Alternative to PID speed control
 
Does anyone know of any way to control shooter wheel speed other than using PID? We are currently using PID and we are getting an oscillating error of about 5%. Any ideas how to minimize this error. (we are currently only using P. And D at all starts an oscillation.)

Ether 18-03-2012 11:55

Re: Alternative to PID speed control
 
Quote:

Originally Posted by baronep (Post 1145563)
Does anyone know of any way to control shooter wheel speed other than using PID?

Use a flywheel, and use Jag CAN Voltage mode or do voltage compensation in the cRIO

Quote:

We are currently using PID and we are getting an oscillating error of about 5%.
First, look at the signal you are getting from your speed sensor (open loop) to make sure you are actually getting a clean signal.

Quote:

Any ideas how to minimize this error
Read the several threads here on CD that discussed PID speed control of 2012 shooter wheels.

Quote:

we are currently only using P
You might want to re-read this thread:

http://www.chiefdelphi.com/forum/sho...21#post1114721



DonRotolo 18-03-2012 17:34

Re: Alternative to PID speed control
 
An oscillation can be changed by changing your P factor. I would think that reducing the multiplier will help, but not knowing your mechanical setup this is just a guess. Experiment by cutting it in half and doubling it, that should tell you which direction to go.

Jay1986 18-03-2012 21:04

Re: Alternative to PID speed control
 
You can write an equation that uses the same set motor speed voltage at a set distance using the same amount of voltage no matter how charged your battery is. See if this helps:
http://www.chiefdelphi.com/forums/sh...9&postcount=17

mommazzboy 19-03-2012 11:00

Re: Alternative to PID speed control
 
This is untested, but we decided to use the PID VI coupled with a feed forward term to control output velocity.

Ether 19-03-2012 12:03

Re: Alternative to PID speed control
 
Quote:

Originally Posted by mommazzboy (Post 1146071)
This is untested, but we decided to use the PID VI coupled with a feed forward term to control output velocity.

Make sure you scale the feedforward appropriately and then clamp the result after you add it to the PID output.



baronep 19-03-2012 18:38

Re: Alternative to PID speed control
 
1. I have heard a lot about a "feedforward loop". Is that just an accumulator? A feedback loop? A picture is worth a thousand words

2. How does the sampling rate affect this. I am currently running the loop at 50ms using a Timed Loop. Does anyone know if adjusting this up or down would help at all?

3. Is a 5% error significant or is the inconsistency more likely rooted in a mechanical problem?

Ether 19-03-2012 18:53

Re: Alternative to PID speed control
 
Quote:

Originally Posted by baronep (Post 1146298)
1. I have heard a lot about a "feedforward loop". Is that just an accumulator?

No.

Quote:

A feedback loop?
No.

Quote:

A picture is worth a thousand words
http://ether.comeze.com/FRC/11822/Speed_PID_dia.pdf



Kevin Sevcik 19-03-2012 19:04

Re: Alternative to PID speed control
 
A feedforward term in a control loop is a term that adds to the control output based directly off of the command input or some feature thereof. It doesn't depend on any feedback, it purely feeds the command signal forward through the control loop.

For instance, in the case of controlling a shooter wheel, there's a theoretical minimum voltage necessary to run the wheel at the correct speed. Based off this, you could create a feedforward term in your control loop. Take a CIM with no reduction. 12V free speed is 5400RPM. So, if you want to run it at 2700RPM, you know you need atleast 6V output. You create a feed forward term with a gain of (12V/5400RPM). Then, your output is PID output + RPMs * (12V/5400RPM). That way, when you command 2700 RPM, you're already outputting the necessary 6V to run at that speed. Your PID loop now only has to compensate for the difference between free speed and your loaded speed. Plus, you're instantly outputting 6V without waiting for an I term to build up enough error to put out 6V for you. Basically, feedforward terms improve the response of your control loop based off features you already know about your system.

Ether 19-03-2012 19:24

Re: Alternative to PID speed control
 
Quote:

Originally Posted by Kevin Sevcik (Post 1146312)
Then, your output is PID output + RPMs * (12V/5400RPM).

warning: If PID output is +/-1 this may not work as expected.



martin417 19-03-2012 19:51

Re: Alternative to PID speed control
 
We used a very simple closed loop control that worked flawlessly. We had a jag on CAN bus with an encoder attached to the jag. We used voltage control with a voltage ramp of ~115 V/S. We queried the jag for speed, and if the speed was less than the set speed, we set max voltage. If the speed was greater than or equal to set speed, we set zero voltage. The inertia of the system kept the shooter speed within ~15 RPM of set speed at all times, and when we shot, the voltage immediately went to full for rapid spin-up.

the simplest solution that works is usually best.

Ether 19-03-2012 19:58

Re: Alternative to PID speed control
 
Quote:

Originally Posted by martin417 (Post 1146353)
We used a very simple closed loop control that worked flawlessly. We had a jag on CAN bus with an encoder attached to the jag. We used voltage control with a voltage ramp of ~115 V/S. We queried the jag for speed, and if the speed was less than the set speed, we set max voltage. If the speed was greater than or equal to set speed, we set zero voltage. The inertia of the system kept the shooter speed within ~15 RPM of set speed at all times, and when we shot, the voltage immediately went to full for rapid spin-up.

the simplest solution that works is usually best.

I've been wondering if that would work for this application. I did something very similar for an automotive actuator I worked on several years ago.

Thanks for posting that.

PS - I assume you had the Jag jumper set for coast?



martin417 19-03-2012 21:17

Re: Alternative to PID speed control
 
Quote:

Originally Posted by Ether (Post 1146360)
...PS - I assume you had the Jag jumper set for coast?



Yes, coast.

Cal578 20-03-2012 09:11

Re: Alternative to PID speed control
 
This feed-forward idea sounds helpful. If I understand correctly, PID alone can be done in the Jaguar via CAN, but PID with feed-forward would need to be implemented entirely in the cRIO. The Jag PID doesn't have any way to add a feed-forward value. Did I get this right?

Ether 20-03-2012 09:19

Re: Alternative to PID speed control
 
Quote:

Originally Posted by Cal578 (Post 1146606)
The Jag PID doesn't have any way to add a feed-forward value. Did I get this right?

Yes. See this post:

http://www.chiefdelphi.com/forums/sh....php?p=1108556




All times are GMT -5. The time now is 03:44.

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