Using wpilib PID loops on XRP in simulation mode w/ command based code

I would like to use the XRPs as a test platform for my FRC programmers. Our team already uses them for outreach activities and to teach basic robotics programming concepts to new members.

I have a command based program running in the simulator & it correctly drives my xrp around with an Xbox controller. I also have a USB camera mounted to the XRP with a custom camera holder. The USB camera is mounted to a raspberry pi running photon vision & the XRP via the simulator and pi are on the same network & all correctly updating network tables.

I have photon vision tuned to recognize April tags and correctly reporting the yaw from target, I’d like to program a button “turn to target” that would use a PID loop to turn to the target - like we would do on our competition robot. So instead of just calculating the distance to turn based on the degrees (like I would do if I was directly programming the XRP), I’d like to figure out the PID loop.

I’m having trouble because I cannot get the XRP to start moving unless the motors are at like 55-60% power. At that point they are moving so fast that they blow past the 0 angle & the tag goes out of view, so I cannot even get an oscillation going. I’m not great at turning PID loops, but I’m wondering if anyone might have an idea to help point me in the right direction? Or am I asking this system to do something that isn’t going to be possible because the delays are too long & there isn’t enough granularity in the speed of the motors like we would have on our larger robots?

I’d like to get an approach to let my programmers write & test a lot of their command based code on the XRP and then tune it on our competition bot when it’s ready. Our new programmers love the XRP because they are small and non-intimidating. We are working on shrinking the field to XRP size & using them to work on autonomous routines because we have photonvision working with them.

Hi

I’m wondering if the weight of the XRP with the rPi and everything else is requiring the 55-60% power. If you took of that stuff temporarily, would turn better?

Also, are you using to use the PID to search for the tag or just to navigate to it once it has been detected?

Brad