![]() |
PID + Battery Voltage + Talon=??????
So my team needs a PID Controller code for our shooter. All the example code shows this:
Code:
Joystick turretStick(1);Code:
float volt |
Re: PID + Battery Voltage + Talon=??????
I think that example shows how to set a motor's position based on the feedback from a potentiometer connected to a mechanism that turns with the motor (perhaps with some gear or sprocket reduction in the mix).
If you instead want to do velocity control, you'll need some sort of counter or encoder connected to the motor shaft so you can read its speed. Why do you care about battery voltage? |
Re: PID + Battery Voltage + Talon=??????
My teams problem is that when we fire our shooter its accurate but when the compressor activates and the voltage drop so does the speed of the shooter. That is why we wanted to create a PID Loop with the battery voltage if possible
|
Re: PID + Battery Voltage + Talon=??????
Quote:
1) Measure the battery voltage and compensate for that by adjusting your motor command. This does not require PID. Adjusting the motor command based on voltage will help, but may not be as accurate as the 2nd solution: 2) Put a speed sensor on your shooter wheel, and use that as the process variable in a feedback controller. You can use PID control for this, or you can use bang-bang. |
Re: PID + Battery Voltage + Talon=??????
Quote:
|
Re: PID + Battery Voltage + Talon=??????
Quote:
This only works, of course, if you have some headroom in your motor command, i.e. you are not already commanding 100%. |
Re: PID + Battery Voltage + Talon=??????
but that is assuming your battery starts at 12.5 V what if you get a batter that starts at 12.8V or is that something we would have to test
|
Re: PID + Battery Voltage + Talon=??????
Quote:
If you need accurate control of shooter speed, I suggest you use speed feedback, as most teams who want accurate speed control are doing. |
Re: PID + Battery Voltage + Talon=??????
speed feedback?
|
Re: PID + Battery Voltage + Talon=??????
Attach an encoder to the wheel and read the rate out of it. It's what the example you posted does.
|
| All times are GMT -5. The time now is 14:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi