How does one change the speed on the variable speed Fisher Price Motors included in the KOP?
Are we looking for a method to do so without a motor controller? Generally the speed is changed via programming and some sort of manipulator, usually a joy stick.
No. We have a Victor on it, but we want to be able to change the speed in the programming. Is there like an open-source Fisher Price puts out for these motors?
(These are the motors you see on those toy-car things you see kids driving around these days…)
What are you using as a control system? Is it something fancy like a cRIO? Something simpler like a VEX Cortex? Something even simpler like an Arduino? Something super-simple like a PIC? How are you programming it?
No, we have a cRIO to control it, and are programming it in C++
Are you using the correct variable types in your code? It sounds like you are using an int or char, which would only allow you to use three speeds.
You should be using a float, which can contain nearly any* decimal value. The speed controller classes, such as Victor, require a value between -1.0 and 1.0. To run at any speed other than full, simply send values like -0.62 or 0.48 or 0.11 or -0.88.
- Within a reasonable magnitude. See this for more info: Floating-point arithmetic - Wikipedia
You know…
In terms of coding, FPs aren’t all that different from CIMs if they’re controlled by a Victor (or, for that matter, a Jaguar). I’m willing to bet that you’ve got some variable-speed CIM code somewhere around (probably in the drive code). Take a look at that and see if you can’t figure out how to copy and adjust it to get the FP working.
You’re using C++, a cRIO, a Victor, and a Fisher-Price motor. You want to control the speed of the motor using software? What you’re asking is such a basic part of programming an FRC robot that I have to wonder if I don’t understand the question.
Pretend that the software is already done and working, and describe how you want to control the speed. Try to be as specific as you can, like “pulling back a little on a joystick will make the motor run slowly forward, pushing forward a lot will make the motor run quickly backward,” that sort of thing. That’ll help explain more clearly what you want the software to do.