PIDs have nothing to do with it. That is affecting the amount of electrical energy supplied to the motor (voltage), not where it should be operating at.
It does depend on the application as well as your primary design objective.
When you look at a typical brushed motor curve you’ll see 4 lines, torque, power, current and efficiency.
Torque is a force, a twisting force and determines how much work can be done.
Power is the rate of application of force and determines how fast the work can be done.
Current is the amount of electrical energy the motor is consuming.
Efficiency is the ratio of mechanical energy obtained from the electrical energy that is supplied to the motor.
If for example your primary objective was for maximum run time you would gear your mechanism so that the motor operates at peak efficiency. At that point you’ll get the most work done per electrical energy consumed.
For typical FRC use however peak efficiency is not the primary objective.
For something like a flywheel shooter usually the concern is returning to the target RPM as quickly as possible. For this we want to look at the power curve in determining where we want the motor to operate. To minimize the time to get back up to the desired speed we need to maximize the area under the curve.
To maximize the area under the curve we want to operate it around its peak. So for example if you have that shooter that needs 5k rpm when the ball is introduced and you have a motor that makes peak power at 10k rpm you might think you would want a gear ratio of 2 to 1 (10k/5k) That would operate the motor at peak power when the ball was introduced. However what happens when that ball is introduced? The flywheel and thus the motor slows down. That means that the motor is now making less than peak power at the time you need it most. Say the flywheel rpm drops to 4,000 rpm by the time the ball exits the shooter. That means that it has dropped 1,000 rpm. So we want to set our gear ratio to 10k/4.5k or 2.22 to 1. Now as the rpm drops there is more power available and if it does drop all the way to 4K rpm the range that the motor operates in will be centered around the point of peak power and thus have the largest area under the curve.
Now if we want to use that motor to climb the calculations are different. Is minimizing the time to climb the top priority and the motor won’t be required to hold the load by stalling?. If that is the case you want to operate at peak power. You do that by gearing the motor so that the torque is sees at its shaft is equal to that produced at peak power.
If you wanted to lift the load with the least amount of electrical energy you would gear it so that the torque on the motor was equal to that produced at the rpm where peak efficiency occurs.
That leads us to what you want to do if you want that motor to hold a load by stalling. Earlier when we talked about efficiency we didn’t talk about that electrical energy that isn’t converted into mechanical energy. It had to go somewhere and that place is heat.
So if a motor is operating at 75% efficiency and we are giving it 100w of electrical energy we get 75w of mechanical energy and 25w of heat. If a motor is not spinning it is not doing any work and therefor its efficiency is 0%, in other words all of the energy is being turned into heat.
Once enough heat has built up in a motor the magic smoke is released.
So how do we limit the amount of heat? We limit the amount of power we supply the motor. Thankfully Vex spent the time and money to test various motors until failure. If you look at the bottom of this page you’ll find the locked rotor test until failure. https://motors.vex.com/vexpro-motors/775pro
If we were using a 775 pro and we wanted to be able to hold the load for say 100 seconds we would need a gear ratio that applied ~.2 nm of torque or less and we would need to apply ~4v to the motor. If you look at the blue line in that locked rotor graph you’ll see that at 100 sec the motor is still making more than .2nm of torque when supplied 4v. Now if we only want to hold it for say 25 sec we could gear it such that the motor sees .3nm torque and apply ~6v. However if you look at that grey line once you pass ~25 sec torque output falls below .3nm and the motor will no longer hold the load.
Now you need to decide what the priority is, speed or safety factor? If you gear it so that 6v is needed to hold the load you’ll get there ~50% faster than if you geared it so that you could hold the load with 4v. Setting it up for 4v however would mean that you would be putting less heat into the motor meaning that you could safely hold it longer than you needed to and you could get away with less “rest” time between uses.