Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Velocity Control - Battery Compensation Term (http://www.chiefdelphi.com/forums/showthread.php?t=154063)

Tom Line 21-01-2017 18:48

Velocity Control - Battery Compensation Term
 
When doing velocity control with the talon srx's, the velocity you get from your feed-forward term is going to be affected by battery voltage. Has anyone experimented or used a battery offset term to correct for this? Is it worth it?

Paul Copioli 21-01-2017 21:20

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Tom Line (Post 1634585)
When doing velocity control with the talon srx's, the velocity you get from your feed-forward term is going to be affected by battery voltage. Has anyone experimented or used a battery offset term to correct for this? Is it worth it?

Tom,

The I gain is for things like that. We use I and P for velocity control and as long as you design your gearbox / motor combo with enough headroom then the I and P can compensate. We design our speed controlled devices to operate at 60% duty for the ideal situation. For example, if you want your shooter to go 2500 RPM, it better hit that speed at 60% - 70% duty. This way, the I and P gain can do their job. When testing without speed control, if you set your motor command at .6 or .7, then you should be able to score your game object from the desired shooting spot with a full battery and one ball at a time. At least, this is what we do.

Paul

Joey1939 21-01-2017 21:32

Re: Velocity Control - Battery Compensation Term
 
I'm currently working on something similar. It seems like when the Talon is in Velocity Control Mode the feed forward term is used to calculate an output voltage. This would make think that it wouldn't be affected by battery voltage unless it dropped bellow the requested output.
I'm not certain, but I'm sure CTRE will give an answer soon.

Brandon_L 21-01-2017 22:09

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Paul Copioli (Post 1634642)
Tom,

For example, if you want your shooter to go 2500 RPM, it better hit that speed at 60% - 70% duty. This way, the I and P gain can do their job. When testing without speed control, if you set your motor command at .6 or .7, then you should be able to score your game object from the desired shooting spot with a full battery and one ball at a time. At least, this is what we do.

Paul

Is there a way to calculate this? Such as if I'm using a motor say with a 10kRPM free speed but I want my shooter to go 2.5kRPM, what method or charts would I need to calculate the ratio that will get me to 2.5kRPM at 60-70% duty cycle? I assume it would be less aggressive gearing than if I did the usual calculation, which in this case would be 4:1

Ether 22-01-2017 00:00

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Brandon_L (Post 1634654)
Is there a way to calculate this? Such as if I'm using a motor say with a 10kRPM free speed but I want my shooter to go 2.5kRPM, what method or charts would I need to calculate the ratio that will get me to 2.5kRPM at 60-70% duty cycle? I assume it would be less aggressive gearing than if I did the usual calculation, which in this case would be 4:1

Here's a rough calculation:

10000 rpm motor free speed at 100% command
6500 rpm motor free speed at 65% command
2500 desired operating rpm of flywheel
2.6:1 speed reduction gear ratio = 6500/2500

YMMV depending on how much friction and windage you have in your gearing and flywheel



Brandon_L 22-01-2017 21:29

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Ether (Post 1634695)
Here's a rough calculation:

10000 rpm motor free speed at 100% command
6500 rpm motor free speed at 65% command
2500 desired operating rpm of flywheel
2.6:1 speed reduction gear ratio = 6500/2500

YMMV depending on how much friction and windage you have in your gearing and flywheel



Didn't think it would be just that simple, thanks

Brian Selle 23-01-2017 11:28

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Ether (Post 1634695)
Here's a rough calculation:

10000 rpm motor free speed at 100% command
6500 rpm motor free speed at 65% command
2500 desired operating rpm of flywheel
2.6:1 speed reduction gear ratio = 6500/2500

YMMV depending on how much friction and windage you have in your gearing and flywheel



This ^ with a 0.8-0.9 for gearbox efficiency will get you close. For this example, 65% command: 10,000 rpm * 0.65 * 0.8 = 5200 rpm free speed. 5200/2500 yields approx 2:1 gear ratio.

Ether 23-01-2017 19:15

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Brian Selle (Post 1635094)
This ^ with a 0.8-0.9 for gearbox efficiency will get you close. For this example, 65% command: 10,000 rpm * 0.65 * 0.8 = 5200 rpm free speed. 5200/2500 yields approx 2:1 gear ratio.

Consider the following thought experiment:

Take a CIM whose free speed is 5310 rpm at 12 volts and connect it to a good quality properly assembled and lubed 2:1 gearbox whose output shaft is connected to nothing (no load).

Using the same computation you did above, the CIM's speed would now be 5310*0.8 = 4248 rpm.

Now go to the motor curves for CIM and you'll see that CIM is drawing 29 amps.

Do you believe that? If not, where is the error?



Brian Selle 24-01-2017 12:53

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Ether (Post 1635307)
Consider the following thought experiment:

Take a CIM whose free speed is 5310 rpm at 12 volts and connect it to a good quality properly assembled and lubed 2:1 gearbox whose output shaft is connected to nothing (no load).

Using the same computation you did above, the CIM's speed would now be 5310*0.8 = 4248 rpm.

Now go to the motor curves for CIM and you'll see that CIM is drawing 29 amps.

Do you believe that? If not, where is the error?



An unloaded, well lubed, 2:1 gearbox has a much higher efficiency factor and thus I would expect a higher CIM speed and lower current. If you lube the gearbox with toothpaste you might create enough friction to draw 29 amps at 4248 RPM. :)

The 0.8-0.9 factor approximates typical losses seen in FRC for gearboxes + belt/chain + bearing friction + wheel/roller windage.

Ether 24-01-2017 13:42

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Brian Selle (Post 1635628)
The 0.8-0.9 factor approximates typical losses seen in FRC for gearboxes + belt/chain + bearing friction + wheel/roller windage.

I've seen the .8 number in various places for drivetrains, which include rolling friction, carpet deformation, multi-stage gearboxes, and gears/chains or belts/pulleys.

It would be very interesting to see test data for a quality 2:1 single-stage gearbox (properly assembled and lubed) connected directly to a properly balanced spokeless shooter flywheel, when the flywheel is spinning unloaded (i.e. not firing balls) at its operating speed. Volunteers?



amesmich 24-01-2017 17:04

Re: Velocity Control - Battery Compensation Term
 
I would guesstimate the torque speed relationship is not linear from free speed. So the small amount of load the gearbox presents reduces the speed more initially without necessarily loading the motor to the point of 29A. I would then expect additional load to be more linear in current and speed.

tr6scott 24-01-2017 17:36

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Tom Line (Post 1634585)
When doing velocity control with the talon srx's, the velocity you get from your feed-forward term is going to be affected by battery voltage. Has anyone experimented or used a battery offset term to correct for this? Is it worth it?

Our experience from last year, make sure you F term undershoots the desired speed, as opposed to overshoots the desired speed. When this is true, the srx is rock solid and smooth. I would not try to compensate the F term higher after the tune. I would tune with a full battery, make the F slightly under the target, and let the PID do the work. It was a beautiful thing last year on our shooters.

The other thing to watch for, is if you are going to let the shooter wheels run down, put them in %vbuss mode, or you will pid them to 0, which will make them stop fast and with a lot of heat for no good reason.

Ether 24-01-2017 18:00

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by tr6scott (Post 1635804)
if you are going to let the shooter wheels run down, put them in %vbuss mode, or you will pid them to 0, which will make them stop fast and with a lot of heat for no good reason.

SRX lets you clamp the PIDF output, no? Don't allow negative voltage. And make sure it's in coast mode.



Ether 24-01-2017 18:05

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by amesmich (Post 1635786)
I would guesstimate the torque speed relationship is not linear from free speed

Looks pretty linear down to about 0.03 Nm.




Tom Line 25-01-2017 19:17

Re: Velocity Control - Battery Compensation Term
 
Quote:

Originally Posted by Paul Copioli (Post 1634642)
Tom,

The I gain is for things like that. We use I and P for velocity control and as long as you design your gearbox / motor combo with enough headroom then the I and P can compensate. We design our speed controlled devices to operate at 60% duty for the ideal situation. For example, if you want your shooter to go 2500 RPM, it better hit that speed at 60% - 70% duty. This way, the I and P gain can do their job. When testing without speed control, if you set your motor command at .6 or .7, then you should be able to score your game object from the desired shooting spot with a full battery and one ball at a time. At least, this is what we do.

Paul

Thanks Paul. I usually design for my shooting speed to be at about 50% max velocity, because that's usually right around the peak power for the motor and I want to optimize spin-up time after a shot.

Good to know I don't have to mess around with battery compensation.


All times are GMT -5. The time now is 06:49.

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