Go to Post Can I help it if I check Chief Delphi before I look at the Team Updates? - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 13-02-2016, 22:33
bowmanb bowmanb is offline
Registered User
AKA: Bruce Bowman
FRC #3991 (KnightVision)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Baton Rouge
Posts: 27
bowmanb is an unknown quantity at this point
programming for brownout avoidance

Our team is using a 6 cim drive for the first time and we are of course finding it quite easy to brown out when approaching full throttle from a stop and in turns in high gear.

I don't want to discuss the relative merits of 6 cim vs. 4 cim. The team wanted to do this and I lost the argument.

Ive looked in all my usual places for this and have come up empty.

The question is: In LabView how do we:
  1. access the PDB data on current and voltage
  2. implement a "governor" routine using this data to compute a scaler to limit our motor power to keep the current draw under the brownout threshold.
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2016, 08:19
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,213
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: programming for brownout avoidance

Does this help?

Quote:
In LabVIEW, you can read the current on a PDP channel using the PDP Channel Current VI found on the Power pallete.

https://wpilib.screenstepslive.com/s...24166/l/289498
Regarding implementing a governor, how about this:
1) Process that reads the voltage, and adjusts a "Power Factor" variable. For example, when voltage is > 9 volts, Power Factor = 1. When it drops below that, the value declines.

2) In your process that sets the speed of the motors (let's say the value is Speed), multiply that number by the Power Factor variable (Speed * Power Factor).

Last edited by rich2202 : 14-02-2016 at 08:25.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2016, 08:55
MrForbes's Avatar
MrForbes MrForbes is offline
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 6,010
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
Re: programming for brownout avoidance

Quote:
Originally Posted by bowmanb View Post
I don't want to discuss the relative merits of 6 cim vs. 4 cim. The team wanted to do this and I lost the argument.
...
how do we:
.....
implement a "governor" routine using this data to compute a scaler to limit our motor power to keep the current draw under the brownout threshold.
I guess you could tell the students that removing a CIM from each side will implement a governor to keep the current under the brownout threshold.

But then the programmers wouldn't get to have so much fun

Good luck!
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2016, 09:48
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: programming for brownout avoidance

We just finished putting joystick ramping on the drive to help with the rocking -- in case the drivers want it. It will also help with surge current and is perhaps simpler than the previously described algorithm. You could even decide to keep a running average of voltage or use the voltage faults to increase the ramp each time you get one. Of course this SW stuff is just doing the same thing as teaching the drivers to be a bit smoother on the stick. Also, SW can't fix loss due to long wires, weak crimps, or excessive loss due to friction, and those mods are of course way better than simply avoiding deep voltage dips.

If you want to do a ramp, the PID palette has an output limiter or you can build your own.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2016, 12:02
bowmanb bowmanb is offline
Registered User
AKA: Bruce Bowman
FRC #3991 (KnightVision)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Baton Rouge
Posts: 27
bowmanb is an unknown quantity at this point
Re: programming for brownout avoidance

Quote:
Originally Posted by rich2202 View Post
Does this help?



Regarding implementing a governor, how about this:
1) Process that reads the voltage, and adjusts a "Power Factor" variable. For example, when voltage is > 9 volts, Power Factor = 1. When it drops below that, the value declines.

2) In your process that sets the speed of the motors (let's say the value is Speed), multiply that number by the Power Factor variable (Speed * Power Factor).
Thanks! Can't believe I missed the Power Palette.

Do you think this process would work best in Periodic Tasks or Teleop?
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2016, 14:27
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,213
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: programming for brownout avoidance

Quote:
Originally Posted by bowmanb View Post
Do you think this process would work best in Periodic Tasks or Teleop?
I have no idea of the differences between Periodic Tasks and Teleop. Our team uses C++, and everything is done in TeleopPeriodic.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2016, 20:12
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: programming for brownout avoidance

If you want to check it each time you update the motors, then doing it in the same place might make sense.

If you are using Command and Control, that is likely in the Drive Controller Code. Otherwise it is likely in the TeleOp code. Unless you are doing it at a slower rate, I wouldn't Periodic Tasks.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 14-02-2016, 20:53
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is offline
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,058
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
Re: programming for brownout avoidance

Quote:
Originally Posted by Greg McKaskle View Post
We just finished putting joystick ramping on the drive to help with the rocking -- in case the drivers want it. It will also help with surge current and is perhaps simpler than the previously described algorithm.
I'll second this. Joystick ramping is a really simple way to avoid voltage dips that can cause brownout. We always use this code for each of our motors. If you make the rate large enough (we usually allow dead stop to full speed in .1 seconds) the drivers won't even notice.

Last edited by Caleb Sykes : 14-02-2016 at 21:43.
Reply With Quote
  #9   Spotlight this post!  
Unread 14-02-2016, 20:59
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,092
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: programming for brownout avoidance

Quote:
Originally Posted by Caleb Sykes View Post
If you make the rate small enough...
If you make the rate large enough...


Reply With Quote
  #10   Spotlight this post!  
Unread 14-02-2016, 21:28
HolyLandBrand HolyLandBrand is offline
Registered User
AKA: Texan
no team
Team Role: Alumni
 
Join Date: Apr 2015
Rookie Year: 2014
Location: Austin, Texas
Posts: 12
HolyLandBrand will become famous soon enough
Re: programming for brownout avoidance

How do you program this in java? Do you just use the getVoltage() method from the PDP class.. does that method give you the information you need use joystick rampinG?
Reply With Quote
  #11   Spotlight this post!  
Unread 14-02-2016, 21:35
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,092
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: programming for brownout avoidance

Quote:
Originally Posted by HolyLandBrand View Post
How do you program this in java? Do you just use the getVoltage() method from the PDP class.. does that method give you the information you need use joystick rampinG?
If you are using CAN TalonSRX they have built-in adjustable ramping.

If not, just use something like this:

http://www.chiefdelphi.com/forums/sh...19&postcount=5


Reply With Quote
  #12   Spotlight this post!  
Unread 14-02-2016, 21:40
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is offline
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,058
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
Re: programming for brownout avoidance

Quote:
Originally Posted by Ether View Post
If you make the rate large enough...


You are correct. I have edited my previous post. I got it backwards because in our code we don't refer to the rate itself, but rather the time it takes to go from 0 to full, like how I described above. So our full speed time (as we call it) must be made small enough so that the drivers do not notice.

Last edited by Caleb Sykes : 14-02-2016 at 21:44.
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 20:06.

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