Slave Motors For Flywheel PID

Hey guys,
I’m a new programmer in need of some assistance. I’ve been working on setting up a PID (from the internal RobotC code) for the flywheels on my teams robot. We are using four motors to power two flywheels in a combined gear train. One motor is an IME and the others are set as slave motors so they should follow the power the IME is getting from the PID. I am trying to get the flywheels to spin at a velocity equal to 80 power. For some reason, when I send a power of 80 to the IME, the resulting encoder velocity is much lower than it should be. Here is a photo of the debugger window when the flywheels are spinning at a steady speed.

That looks OK, all motors are getting a PWM value of about 45, that’s the power actually going to the motors. The “80” means 80% of the maximum IME counts/seconds (which ROBOTC default to 1000 IIRC) so about 800 counts per second. See my original post on this topic for more details. You can also see that this runs the motor at about 60rpm according to the debugger.

OK thanks! I need the motor to be running at 65-67 RPM so I should just be able to change the “80” to 90 or 100, but when I increase it, the motor stays at 60 RPM. When I start up the flywheels, the IME speeds up to 65 pretty quickly, but then gradually slows down to 60 where it settles.