Hey Vex forums! I currently have a single flywheel setup using 4 motors, 2 on each side of the flywheel going into a 84:36 compounded to a 60:12 with the 12 on the same axle as the flywheel. I’m using turbo internal gearing and an IME on one of the motors. My question is within robotc how would I calculate the current actual velocity from the IME? I’m trying to use this in a PID Loop to make my flywheel more accurate. Also would it be beneficial to have one IME on both sides of my single flywheel and run a PID Loop for both? Also which have you seen produce the most accurate results TBH, Written PID, or RobotC’s Internal PID Calculator? This is my schools first year competing in vex and any help is much appreciated! Im going to attach my current .c file for it but keep in mind I’m very new to coding for robots.
If you really want flywheel velocity then the total external gear ratio will be
(60:12) 5 x (84:36) 2.33 = 11.66 (I think that’s what you are trying to describe anyway)
That would calculate velocity. There is also an in depth analysis of different ways to calculate velocity in this thread.
You need to decide what your units are, all the code I post uses revs/minute, ie. angular velocity. If you use these then the “target” for the PID calculations needs to be in the same units. It looks like your existing code is trying to use something else.