Controlling the Keyang motors


This our first year participating in the competiton. We are planning to use the Keyang motors to control our arm and are looking for some help specifically:

  1. Can we use the Victor’s to control the keyang motors?

  2. Can more than one motor be hooked up to a single speed controller?

  3. can the motors be hooked up to any pwm ports 1-12? (we are using 13-16 for our drive motors)

  4. How do you use a potentiometer to control the Keyangs position?

Any help would be appreciated

Team 2002

1 yes
2 no
3 yes
4 not sure - check whitepapers for PID

#4) determine what kind of pot you will be using (1 turn or 10 turn) - this is dependent on a couple of important factors.
a) a 1 turn pot really has only about 270 degrees of motion - not a full 360 degrees
b) ten turn pots are available and will be easier to adapt to smaller sizes of gears and sprockets (depending on the interface that you are really measuring the movement of)
c) the pot output can be correlated to the device angle/or motor rotation by tuning and locking it into the desired range

So, what I am saying is the you that you have more flexibility in correlating motor rotation to pot position, that a one to one relationship.

Not knowing how the device actually works, I will assume you are using the Keyang to rotate some appendage through some angular motion - less than 270 degrees.

I will assume that the keyang motor is rotating a sprocket attached to whatever it is driving. (direct drive - not via a chain although that a million other ways are possible).

If you mount the pot in such a way to measure the angular rotation of the sprocket (via chain, or gear, or whatever) - you will be able to correlate that angular movement back to the motor position.

  1. determine the size of the gear or sprocket that will be attached to the pot

  2. determine the best location for mounting the pot - make sure you can get to it for adjusting and tuning it in after it is mounted

  3. make the mounting bracket - remember to keep the pot from freely rotating in the bracket (the pot has flats on the mounting post and some have anti rotation stubs)

  4. attach the gear or sprocket to the pot - we use a tran torque to interface between the pot shaft and the gear or sprocket (they come in various sizes so, you will need to determine wihch size has the correct id to fit the shaft of the pot you are using, then modify the gear/sprocket to fit the outside of the tran torque)

  5. leave the tran torque loose enough to still be able to spin the pot shaft inside it, when you hard mount it into position. You will tighten the tran torque after locating it and rotating the appendage it is hooked to, and if you tighten the tran torque AND it happens to be in the wrong location - you will break it. (This is one good reason to use a pot with more degrees of rotation that your device travels through - its got more of a safety margin to the ends of travel)

  6. Once it is mounted and wired, and you are sure you have more travel on the pot than there is travel of the device, read the pot position via the dashboard - the pot numbers will go up and down depending what resistive value associated with the position it is rotated to. Move to full travel in both direction of rotation and write down the numbers - make sure you are not at zero in either direction - in fact try to tune the pot position by holding the tran torque nut, and simultaneously rotating the pot shaft.

  7. once you have the pot position tuned to include safety margin on both ends of travel - tighten the tran torque (that will lock the pot shaft into the desired position)

  8. the program needs to be updated to include the pot positions for up and down to limit the motor travel

Sorry about the length of the post -
I hope it is clear enough to understand.

Mike Aubry
Team 47 Chief Delphi

Hi Mike,

Thank you for this information, it was very helpful. I have some questions / clarifications:

  1. So we still use a joystick / victor to control the motor speed and the pot to only lock it into a certain position?

  2. is it possible to control the speed entirely using a pot (just exploring some configurations)

  3. I am not familiar with a Tran Torque that you mention. Is this available at the hardware store (radioshack)?


Team 2002

You are welcome.

  1. correct, the joystick / victor controls motor speed and the pot is like a position switch, in that it limits the range the motor is able to work in. If you want the motor to work with a window of x degrees rotation, that can be controlled by setting the limits. The other method is to build in hard stops to mechanically stop the rotation- thus stalling the motors and potentially destroying parts - pot limits work great, once you get them tuned in.

  2. here is a hyperlink to small parts inc. - the tran torques can be purchased there -
    or from fenner -

Best of luck,

How does the pot actually connect to the Analog I/O ? What kind of wiring is used?

Yes, connect pot to an analog input. Wiring examples in the IFI Robot controller manual, but you basically use a PWM cable, and connect the white lead to the center (wiper) connection of the pot, black & red to the outer connections.

So as not to confuse others reading this thread…
You can use a pot at the OI for input to your control system for modifying the speed and direction of the motor in much the same way as a joystick (which contains pots on two axis). See the OI Ref Guide on the IFI site for info.
Many teams also use a pot connected to the motor or shaft of the actuated attachment driven by the motor. This pot is used for feedback to allow the software to know where the actuator is or how far it has to move to get where you want it. The info for connecting this pot is contained in the RC Ref Guide. You may also use this pot as a sensor input to a custom circuit mounted on the robot.