I’ve heard that for pid control, it’s generally more wise to use voltage control than velocity because velocity control has its own pid running simultaneously. I was just curious about how much more accurate voltage control is when used in conjunction with a pid versus velocity control for applications like turning. Especially when differences in speed from sides just changes the center of rotation. Obviously voltage control is preferred in conjunction with a control algorithm for straight pids, but does it matter in a control algorithm for turning?
I don’t believe that voltage control is necessarily preferred even for driving. Using velocity instead creates a feedback loop within a feedback loop, which can make your code more accurate.
Try one, try both, see what happens.
I think voltage control is preferred because you can squeeze a bit more power out of your motors using voltage (running your drive at 12 volts actually makes it go slightly faster than 100% velocity). it’s also more responsive because you don’t have to put it through vex’s built-in pid.
Recently I outlined the pros and cons of velocity vs voltage control in this. I think it will give you a good idea when it’s beneficial to use velocity control or voltage control. Here is the relevant portion:
With V5, when you tell a motor to move a certain velocity the motor does specific internal calculations to alter the power sent to the motor so the output matches your requested velocity. Too fast?
Less power is sent Too slow? More power is sent. It knows if it is too fast or too slow by taking measurements from the internal encoder and comparing it to the target value. The process of taking measurements and applying appropriate changes is called a feedback loop . This is the term for the logic that you were looking for. From what I have seen, the feedback control that v5 motors have is very accurate, however it is not suited for all applications. If you want two intakes to move at the same velocity, using the built in velocity control is perfectly fine. If you are programming a flywheel, I would 100% advise you against the built in velocity controller since it accelerates as fast as possible and can apply backwards power if it overshoots the target velocity. Both of these can easily destroy the motor. That is why, if you are trying to design your own feedback controller for the motors, I would recommend using voltage control . As @theol0403 suggested, using voltage control lets you control the motor exactly how you want – without the built-in v5 firmware overriding it. What this means is that if two identical motors receive the same voltage but work against different loads, then the motor with the lighter load will spin faster. You can use a feedback loop to fix this issue.
(If you are interested in learning more about feedback loops I suggest you read through that thread because it has very good discussion)
I would also echo what @Xenon27 said – I completely agree that voltage is better for drive control. A while back I wrote a detailed explanation about my joystick control code. Here, I explain the benefit from the driver’s perspective. Then, I explain the math behind the code. Finally, a clarification about my units/range.
Hope this was helpful!