Go to Post A link to BoardGameGeek in a FRC blog post... My worlds are colliding, and it's great! - rwodonnell [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2008, 21:59
Neurovirus Neurovirus is offline
Registered User
FRC #0224
 
Join Date: Jan 2008
Location: Piscataway
Posts: 13
Neurovirus is an unknown quantity at this point
Limiting acceleration in easyC

today we let someone besides the drivers/programmers drive and they almost flipped the bot by switching from full forward to full reverse

so i was thinking about limiting the acceleration, namely not allowing switching back and forth between forward and back.

the question is how?
and
is this even a good idea?
  #2   Spotlight this post!  
Unread 30-01-2008, 22:19
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,995
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Limiting acceleration in easyC

How?
Create 2 variables, "Out" and "Old_Out", default them to 127. Store the real final PWM output to Out, and subtract Old_Out, and if the difference is greater than some rate of change (say 50), reset the value to the rate of change (Out - 50). Then set Old_Out == Out, and repeat each loop. You'll have to manage the math a little bit, to prevent exceeding 255 or zero, and maybe elsewhere, but that basic idea is a simple PID loop with only D being used.

Good idea? Maybe not. Driver training is probably a better approach.

Don
__________________

I am N2IRZ - What's your callsign?
  #3   Spotlight this post!  
Unread 30-01-2008, 23:10
jskene jskene is offline
Registered User
None #0612
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Chantilly Virginia
Posts: 153
jskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to behold
Re: Limiting acceleration in easyC

We've been using code like that for several years. It not only helps the driver, but takes a big load off the drive train - chains, belts, gears, and reduces the chances of a tripped circuit breaker.
__________________
Jerry Skene, mentor OOO OOO 2010 - Chairman's Award- DC OOOOOOOOOOOOOOOOOOOOOOOOOOO
Chantilly Academy, Team 612 - 2009 - Engineering Inspiration Award; Finalist - New Jersey
-----------------------------------2008 - Chairman's Award; Kleiner Perkins Award -Buckeye ---| ---Team Spirit Award - NASA/VCU
-----------------------------------2007 - Chairman's Award - NASA/VCU ---| ---Finalist; Kleiner Perkins Award - Chesapeake
-----------------------------------2006 - Chairman's Award - Chesapeake ---| --- Engineering Inspiration Award - NASA/VCU --
  #4   Spotlight this post!  
Unread 31-01-2008, 21:39
Neurovirus Neurovirus is offline
Registered User
FRC #0224
 
Join Date: Jan 2008
Location: Piscataway
Posts: 13
Neurovirus is an unknown quantity at this point
Re: Limiting acceleration in easyC

@jskene

how did u do it? like how Don R. described it?

Thanks, Don

Neuro
  #5   Spotlight this post!  
Unread 31-01-2008, 22:40
jskene jskene is offline
Registered User
None #0612
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Chantilly Virginia
Posts: 153
jskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to behold
Re: Limiting acceleration in easyC

Yes, in a similar fashion.
__________________
Jerry Skene, mentor OOO OOO 2010 - Chairman's Award- DC OOOOOOOOOOOOOOOOOOOOOOOOOOO
Chantilly Academy, Team 612 - 2009 - Engineering Inspiration Award; Finalist - New Jersey
-----------------------------------2008 - Chairman's Award; Kleiner Perkins Award -Buckeye ---| ---Team Spirit Award - NASA/VCU
-----------------------------------2007 - Chairman's Award - NASA/VCU ---| ---Finalist; Kleiner Perkins Award - Chesapeake
-----------------------------------2006 - Chairman's Award - Chesapeake ---| --- Engineering Inspiration Award - NASA/VCU --
  #6   Spotlight this post!  
Unread 31-01-2008, 22:45
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,355
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Limiting acceleration in easyC

Quote:
Originally Posted by jskene View Post
We've been using code like that for several years. It not only helps the driver, but takes a big load off the drive train - chains, belts, gears, and reduces the chances of a tripped circuit breaker.
We've written a "Torque_Limit" function for this year. We can set the max delta for each loop to any value. Out of curiosity, what range have you found to be reasonable? 50, 75, 100 per loop?
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #7   Spotlight this post!  
Unread 01-02-2008, 08:47
jskene jskene is offline
Registered User
None #0612
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Chantilly Virginia
Posts: 153
jskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to behold
Re: Limiting acceleration in easyC

We used different values for forward and reverse. We want to be able to stop faster than we can accelerate.

Our acceleration rate was limited to 3, deceleration to 8.
__________________
Jerry Skene, mentor OOO OOO 2010 - Chairman's Award- DC OOOOOOOOOOOOOOOOOOOOOOOOOOO
Chantilly Academy, Team 612 - 2009 - Engineering Inspiration Award; Finalist - New Jersey
-----------------------------------2008 - Chairman's Award; Kleiner Perkins Award -Buckeye ---| ---Team Spirit Award - NASA/VCU
-----------------------------------2007 - Chairman's Award - NASA/VCU ---| ---Finalist; Kleiner Perkins Award - Chesapeake
-----------------------------------2006 - Chairman's Award - Chesapeake ---| --- Engineering Inspiration Award - NASA/VCU --
  #8   Spotlight this post!  
Unread 01-02-2008, 10:10
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,355
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Limiting acceleration in easyC

Quote:
Originally Posted by jskene View Post
We used different values for forward and reverse. We want to be able to stop faster than we can accelerate.

Our acceleration rate was limited to 3, deceleration to 8.
Ah, excellent. Thank you.
One more question. Our code works on a change in pwm value per loop. The values you gave seem lower than I would expect. Are your values for change in pwm/loop or loops for a full direction change?
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #9   Spotlight this post!  
Unread 01-02-2008, 12:38
jskene jskene is offline
Registered User
None #0612
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Chantilly Virginia
Posts: 153
jskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to behold
Re: Limiting acceleration in easyC

Quote:
Originally Posted by billbo911 View Post
Ah, excellent. Thank you.
One more question. Our code works on a change in pwm value per loop. The values you gave seem lower than I would expect. Are your values for change in pwm/loop or loops for a full direction change?
Change/Loop.

It also applies to directional change - forward<--->reverse
__________________
Jerry Skene, mentor OOO OOO 2010 - Chairman's Award- DC OOOOOOOOOOOOOOOOOOOOOOOOOOO
Chantilly Academy, Team 612 - 2009 - Engineering Inspiration Award; Finalist - New Jersey
-----------------------------------2008 - Chairman's Award; Kleiner Perkins Award -Buckeye ---| ---Team Spirit Award - NASA/VCU
-----------------------------------2007 - Chairman's Award - NASA/VCU ---| ---Finalist; Kleiner Perkins Award - Chesapeake
-----------------------------------2006 - Chairman's Award - Chesapeake ---| --- Engineering Inspiration Award - NASA/VCU --
  #10   Spotlight this post!  
Unread 01-02-2008, 12:48
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,355
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Limiting acceleration in easyC

Quote:
Originally Posted by jskene View Post
Change/Loop.

It also applies to directional change - forward<--->reverse
Those numbers are tighter than I assumed they would need to be, but the math agrees.
You can go from STOP to FULL in 1.1 sec. and FULL to STOP in .4 seconds.
Very nice!
How do the drivers like the response?
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #11   Spotlight this post!  
Unread 01-02-2008, 12:51
scottanderson's Avatar
scottanderson scottanderson is offline
Software Architect
AKA: Scott Anderson
FRC #2608 (MiGHT)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Shelby Township
Posts: 20
scottanderson is an unknown quantity at this point
Re: Limiting acceleration in easyC

We wrote some code for that this year, but then were given advice by a very experienced team that we shouldn't worry about the drive train and that putting a full reverse on the motors is a good way to brake.

The problem with the limiting code is that the robot really doesn't stop very quickly at all when the outputs are just set to 0.

Regards,
-scott
  #12   Spotlight this post!  
Unread 01-02-2008, 13:48
jskene jskene is offline
Registered User
None #0612
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Chantilly Virginia
Posts: 153
jskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to behold
Re: Limiting acceleration in easyC

"How do the drivers like the response?"

They don't notice a big difference.


Quote:
Originally Posted by scottanderson View Post

The problem with the limiting code is that the robot really doesn't stop very quickly at all when the outputs are just set to 0.

Regards,
-scott
You probably have the "BRAKE" jumper on the Victor set to "COAST".
__________________
Jerry Skene, mentor OOO OOO 2010 - Chairman's Award- DC OOOOOOOOOOOOOOOOOOOOOOOOOOO
Chantilly Academy, Team 612 - 2009 - Engineering Inspiration Award; Finalist - New Jersey
-----------------------------------2008 - Chairman's Award; Kleiner Perkins Award -Buckeye ---| ---Team Spirit Award - NASA/VCU
-----------------------------------2007 - Chairman's Award - NASA/VCU ---| ---Finalist; Kleiner Perkins Award - Chesapeake
-----------------------------------2006 - Chairman's Award - Chesapeake ---| --- Engineering Inspiration Award - NASA/VCU --
  #13   Spotlight this post!  
Unread 02-02-2008, 12:41
scottanderson's Avatar
scottanderson scottanderson is offline
Software Architect
AKA: Scott Anderson
FRC #2608 (MiGHT)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Shelby Township
Posts: 20
scottanderson is an unknown quantity at this point
Re: Limiting acceleration in easyC

Quote:
You probably have the "BRAKE" jumper on the Victor set to "COAST".
You are correct. Thanks for the tip.

What do folks think about the advice we were given about thrashing the gearboxes, though? Was that sound advice, or do we need to worry about adding some sort of intelligent damping to avoid it?

Regards,
-scott
  #14   Spotlight this post!  
Unread 02-02-2008, 12:50
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Limiting acceleration in easyC

one method we are attempting this year is to use the accelerometer, can actually limit the acceleration itself, instead of just pwm values
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moderating Acceleration / Deceleration Tom Line Programming 7 15-02-2007 13:39
Acceleration Curve EricWilliams Programming 5 01-02-2006 16:27
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12
Acceleration Sensor Connected, but values are odd.... Leav Electrical 7 04-02-2005 15:28


All times are GMT -5. The time now is 10:58.

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