Currently the way that the motion profile arc simple example works is that if you are driving at your robots absolute max speed your robot won’t be able to turn to the right due to the fact that the left talon controls the turning however you will be able to turn to the left because the left side can slow down. I’m wondering if anyone has had this problem and worked through it or if there is a way to have both sides correct for the angle.
You can not “control” at full speed, you can only hope that the friction forces equal at that point. Your max target speed, should be a little less than what the robot can do at the end of the match. ie, battery drained, somewhat. You need to give the controller the opportunity to do it’s job, ie, control. So if you target 100% on a full battery, the controller has no opportunity to control, if it needs to speed up to reduce error. Target something less, and give the controller the opportunity to make up the error if it needs to.
Unless I am missing something (forgive me, as I haven’t worked with Motion Profile Arc for a while now), the output of one side would be pidf[0] + pidf[1]
, while the other side would be pidf[0] - pidf[1]
, where pidf[0]
is the output of your encoder SensorSum, and pidf[1]
is the output of your gyro angle.
The main issue I see is that if you’re traveling at full speed, pidf[1]
may not have a large enough value to overcome the output from pidf[0]
. The two things you could try is increase kP
for pidf[1]
, which may help when going at higher velocities, but will cause overshoot when going at lower-than-full speed. Alternatively, you should simply generate a profile that leaves enough room for pidf[1]
to do its work effectively.
I understand the fact that you can do pidf[0]+pidf[1] but I don’t understand how to configure the talon this way @ozrien
If I understand your question correctly, set configAuxPIDPolarity to true or false decides pidf[0]+pidf[1] or pidf[0]-pidf[1] . This line is not included in Java MP Arc example, but in MotionMagic_AuxStraightPigeon example.
I have also taken a look at that configuration line, however, that only changes the fact if it is addition or subtraction of pidf[1]. That would then lead me to believe that the right talon is already doing this but it is not stated so i can’t believe that it does. We haven’t had time or a place to test this yet but we should be able to soon when our practice field is done.