View Single Post
  #6   Spotlight this post!  
Unread 25-02-2013, 21:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: PID vs Bang-Bang for Shooter Consistency

Quote:
Originally Posted by lori558 View Post
...
Quote:
Currently our team is having problems with shooter consistency. Both PID and Bang-Bang have yielded negative results for us.

We are using a photoswitch (provided in 2011 KoP) in place of an encoder...
It would be helpful if you could post a picture of what you are detecting with the photosensor. Is it a piece (or pieces) of tape? Is it reflective paint? Is it an LED shining thru a hole (or holes) in the wheel? You get the idea. (I see later in your post you mentioned a piece of tape. Please post a picture).

Quote:
With PID programming, we used the counter
When you say "the counter", what do you mean by that? How are you decoding the sensor signal? There are two very different ways to decode the signal, and it's important you do it the right way. The two ways are 1) read the counts from the sensor and divide the change in counts by the elapsed time, or 2) use the FPGA's high frequency sampling and 1 microsecond clock to measure the period (the elapsed time between counts).

With a low count-per-rev sensor, you want to use the 2nd method, not the first.

Post a screenshot of your code so we can see if you are using the correct method.


Quote:
With the Bang-Bang theory, we used the example provided by Billbo911 located at http://www.chiefdelphi.com/media/papers/2665.
I think that uses method1 (the "counts" method), which is the wrong method for a 1-count-per-rev sensor. I think Billbo911 and Mark McLeod both posted LabVIEW examples of the method you should use (method2, the "period" method) at this thread.


Quote:
We have 1 stripe on our wheel
Please post a picture of that stripe. Not all stripes are created equal; there may be a problem with the way you did it.


Quote:
Additionally, the idea has been brought up that I might as well ask here; is it reasonable to use battery voltage as a factor and create a wheel speed equation that consistently maintains the desired speed by taking battery power into the equation?
You do not need this once you have bang-bang working correctly. It will automatically compensate for any voltage changes to maintain the correct speed, as long as the speed you are trying to control at is sufficiently lower than full speed so you have some voltage headroom for the controller to work (the same would hold true for voltage compensation also). PID can be sensitive to voltages changes in some situations.

Quote:
Bottom line is how can we get a consistent shooter if neither PID nor Bang-Bang theory is working for us?
You can make it work, if you have the willingness to stick with it and provide the needed detail so we can help you.


Quote:
And if there is no other option, why is our code not working?
Please post screenshots of your code, and see explanation above.

Quote:
If anyone could help out on this that would be great!
You came to the right place. Now, work with us.

Additional information needed:

1) What motor(s) are you using, what is the total gear ration from each motor to each wheel, what motor controllers are you using.

2) What speed are you trying to control at?

3) The graphs Mark requested would be a good idea



Last edited by Ether : 25-02-2013 at 23:50.
Reply With Quote