Go to Post A charged battery beats a dead battery any day. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > Extra Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 24-04-2012, 22:06
Marvin Kraska Marvin Kraska is offline
Registered User
FRC #0440
 
Join Date: Dec 2011
Rookie Year: 2001
Location: United States
Posts: 6
Marvin Kraska is on a distinguished road
paper: Take-Back-Half Shooter Wheel Speed Control

Thread created automatically to discuss a document in CD-Media.

Take-Back-Half Shooter Wheel Speed Control by Marvin Kraska
Reply With Quote
  #2   Spotlight this post!  
Unread 24-04-2012, 22:09
Marvin Kraska Marvin Kraska is offline
Registered User
FRC #0440
 
Join Date: Dec 2011
Rookie Year: 2001
Location: United States
Posts: 6
Marvin Kraska is on a distinguished road
Re: paper: Take-Back-Half Shooter Wheel Speed Control

This is a simple and proven algorithm we have used to control shooter wheel RPM, it is a comprimise between simple bang-bang and a full dynamic PID controller. It only has one parameter to adjust, is very forgiving and easy to adjust. As long as the gain is small enough, the controler is stable and will converge to near zero error.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-03-2013, 18:47
tr6scott's Avatar
tr6scott tr6scott is online now
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 510
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: paper: Take-Back-Half Shooter Wheel Speed Control

The Bisect Ctl code shows a while loop, and you have that in the teleop code. Isn't having a while loop in the Teleop code a bad thing? Or am I missing something...

Also, does the controller need a fixed time base between iterations? It would seem that if the delta t's are not consistent, there would be issues similar to if they are not consistent in a PID loop?

We actually have the code running on our bot, but I am doing a software review, and had some questions. Not 100% FRC and Labview savvy.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #4   Spotlight this post!  
Unread 11-03-2013, 18:58
John Sabath's Avatar
John Sabath John Sabath is offline
LabVIEW Software Developer
FRC #3792 (The Army Ants)
Team Role: Alumni
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Columbia, MO
Posts: 53
John Sabath is a splendid one to beholdJohn Sabath is a splendid one to beholdJohn Sabath is a splendid one to beholdJohn Sabath is a splendid one to beholdJohn Sabath is a splendid one to beholdJohn Sabath is a splendid one to beholdJohn Sabath is a splendid one to beholdJohn Sabath is a splendid one to behold
Re: paper: Take-Back-Half Shooter Wheel Speed Control

Quote:
Originally Posted by tr6scott View Post
The Bisect Ctl code shows a while loop, and you have that in the teleop code. Isn't having a while loop in the Teleop code a bad thing? Or am I missing something...
They're using a while loop for glorified feedback nodes. The loop never executes more than once in a single iteration due to the True constant being wired to the Stop if True terminal.

That being said, I like the use of a while loop in this case since it makes the logic flow easier to follow.

Last edited by John Sabath : 11-03-2013 at 19:02.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-03-2013, 10:52
tr6scott's Avatar
tr6scott tr6scott is online now
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 510
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: paper: Take-Back-Half Shooter Wheel Speed Control

Thanks John, I see the stop button now, not used to seeing that done. I did just take out the while loop, and rewired it all with the "normal" feed back loops, and even after the "broom of death" the code was pretty much un-readable. I see the reason for the one iteration loop, it made the code pretty.

As to the other question, what happens to the control if there isn't a consistent time between teleop iterations.

Scott.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #6   Spotlight this post!  
Unread 12-03-2013, 11:47
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 146
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Re: paper: Take-Back-Half Shooter Wheel Speed Control

Wow this is a cool algorithm. I think we'll try it next chance we get. Thanks for sharing!
Reply With Quote
  #7   Spotlight this post!  
Unread 12-03-2013, 12:00
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: paper: Take-Back-Half Shooter Wheel Speed Control

For shooter speed control, what are the advantages of PID or take-back-half control over bang-bang control? It seems like bang-bang control provides the shortest spin-up time, as the motor is run at full power, and, if run with a fast enough update time, accurately holds shooter speed in a small tolerance.
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist
Reply With Quote
  #8   Spotlight this post!  
Unread 12-03-2013, 12:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,049
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: paper: Take-Back-Half Shooter Wheel Speed Control

Quote:
Originally Posted by z_beeblebrox View Post
For shooter speed control, what are the advantages of PID or take-back-half control over bang-bang control? It seems like bang-bang control provides the shortest spin-up time, as the motor is run at full power, and, if run with a fast enough update time, accurately holds shooter speed in a small tolerance.
If:
1) your motor is directly connected to the shooter wheel (so there is no gearbox free play and minimal "drivetrain" friction), and

2) your wheel is reasonably balanced (so excessive vibration does not cause rapid deceleration of the wheel when power is removed), and

3) your speed feedback has good resolution and minimal phase lag (as would a properly coded counter object using the getPeriod() method), and

4) your shooter has sufficient moment of inertia (most do), and

5) you run the algorithm fast enough (20ms or faster)

... then it's hard to beat bang-bang control.

Even if some of the above criteria are not met, bang-bang can be the best method, on a case-by-case basis depending on your design.
Reply With Quote
  #9   Spotlight this post!  
Unread 12-03-2013, 12:57
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: paper: Take-Back-Half Shooter Wheel Speed Control

"You must spread some reputation around before giving it to Ether again"
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist

Last edited by z_beeblebrox : 12-03-2013 at 13:06.
Reply With Quote
  #10   Spotlight this post!  
Unread 13-03-2013, 23:05
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,049
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: paper: Take-Back-Half Shooter Wheel Speed Control


I think the following is a correct C implementation of Take-Back-Half:

Code:
.

e = S-P;                            // calculate the error;
Y += G*e;                           // integrate the output;
if (Y>1) Y=1; else if (Y<0) Y=0;    // clamp the output to 0..+1;
if (signbit(e)!=signbit(d)){        // if zero crossing,
  Y = b = 0.5*(Y+b);                // then Take Back Half
  d = e;}                           // and save the previous error;
...where:

S is the setpoint (target RPM)
P is the process variable (measured RPM)
G is the integral gain (the tuning parameter)
Y is the output command to the motor controller
e is the error
d is the previous error
b is the TBH variable

Y, d, and b should be initialized.

Would someone be willing to test this and make any necessary corrections and re-post for the benefit of C language teams who might want to try TBH?

Reply With Quote
  #11   Spotlight this post!  
Unread 14-03-2013, 11:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,049
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: paper: Take-Back-Half Shooter Wheel Speed Control

Quote:
Originally Posted by Ether View Post
Y, d, and b should be initialized.
^Following up on the above^

You can improve the spinup response of TBH by clever selection of the initial values before you change the setpoint "S" from 0 to your desired speed.

Do a simple open-loop test to establish the approximate value of motor command (in the range 0 to +1) required to hold your wheel speed at the target value. Call this experimentally determined motor command value "M". It doesn't have to be exact.


To start your spinup do the following:

Set S to your desired wheel speed; initialize Y=1, d=1, and b=2*M-1; and turn your speed controller on.

Since Y=1, you will be applying full voltage to the motor to spin it up (just like bang-bang). Y will remain equal to 1 (applying full voltage) during the spinup, because there will be no zero crossings until you reach the target speed S.

When you reach the first zero crossing (at the target speed), the TBH algorithm will set Y (and b) equal to (Y+b)/2 = (1+(2*M-1))/2 = M, which is the experimentally-determined motor command value required to maintain the wheel at the target speed. You will immediately have the correct (or approximately correct) motor command for your target speed. This will reduce overshoot and oscillation.



Last edited by Ether : 14-03-2013 at 13:15.
Reply With Quote
  #12   Spotlight this post!  
Unread 24-03-2013, 16:04
Sam Crow's Avatar
Sam Crow Sam Crow is online now
Registered User
FRC #0751 (Barn 2 Robotics)
Team Role: Alumni
 
Join Date: May 2010
Rookie Year: 2010
Location: California
Posts: 169
Sam Crow is on a distinguished road
Re: paper: Take-Back-Half Shooter Wheel Speed Control

In case anyone is interested, we have implemented a Take-Back-Half speed controller in Java here.
It is working well for controlling the shooter wheels on our robot.
Reply With Quote
  #13   Spotlight this post!  
Unread 04-04-2013, 10:34
tr6scott's Avatar
tr6scott tr6scott is online now
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 510
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: paper: Take-Back-Half Shooter Wheel Speed Control



A little data on the TBH and wheel performance. Match 54, Livonia competition, TORC went 26 for 28 on 2-point full court shots. 1 for 3 on 3 pointers while hanging, but as you can see from video, the angle while hanging needs to be adjusted up.

Video of match on FB page at: http://www.facebook.com/photo.php?v=...type=2&theater

Excel data can be downloaded from here: http://www.mcbride4.org/wp-content/u...a-Match-54.xls

Data logger on the bot, is recording every 100ms to csv text file on cRio.

We think the two misses are from the driver shooting when there was no disk to shoot, and the disk probably landed on top of the arm instead of in front of the arm pushing a disk that is laying flat. From data you can see driver shot 57 times, yet the only 33 disks touched the wheel. 24 times the arm spun without a disk in the hopper.

Based on the data and time sequence, we can shoot a disk at with angle set and wheel at speed every 1.5 seconds.

This data logger is one of the reasons we won the innovation in control award.

We Love Data.

Scott.

=========================================
RPMCommand = RPM we were telling the wheel to spin.
RPMActual = RPM the actual from feedback photoeye.
MotorControl = Output of TBH to Motor Controller, 0 to 1 on right axis.
RPMControl = How driver was controlling wheel speed, 1 = preset for whole match.
DidShoot = Shooter arm advances when 1 and goes to 0 when it completes it's revolution.
CounterValue = number of disks in hopper, but we removed the photoeye that used to count, as it interfered with disks going to the hopper.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #14   Spotlight this post!  
Unread 06-04-2013, 23:05
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,049
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: paper: Take-Back-Half Shooter Wheel Speed Control

Quote:
Originally Posted by tr6scott View Post


A little data on the TBH and wheel performance.
Thanks for posting that.

What speed sensor are you using, and how are you decoding the signal?

What motor, and gear ratio from motor to wheel?

What language are you using?

How fast are you running your TBH algorithm?


Reply With Quote
  #15   Spotlight this post!  
Unread 07-04-2013, 13:27
tr6scott's Avatar
tr6scott tr6scott is online now
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 510
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: paper: Take-Back-Half Shooter Wheel Speed Control

Quote:
Originally Posted by Ether View Post
What speed sensor are you using, and how are you decoding the signal?

What motor, and gear ratio from motor to wheel?

What language are you using?

How fast are you running your TBH algorithm?


The speed sensor, is a Banner DS18VN6LP photoeye.

The 8" pneumatic wheel is direct mounted to a CIM with Hex shaft and hub.

There is a piece of reflector tape on every other face of the hex shaft, so 3 pulses per revolution.

The TBH algorithm runs is in a 10ms timed tasked loop, with metronome timer.

The code is labview, more info from this link. http://www.chiefdelphi.com/forums/sh...d.php?t=113954

We are not using gear tooth mode on the sensor, but now we are averaging over 3 pulses, because of the change to the hex shaft.
__________________
The sooner we get behind schedule, the more time we have to catch up.

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 19:35.

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


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