Log in

View Full Version : VEX motors question


JasonQ
06-12-2005, 17:49
Hi,

Why do the VEX motors have 3 wires? There are the positive and common leads, but what is the third for?

Thanks,

Jason

billbo911
06-12-2005, 18:26
Hi,

Why do the VEX motors have 3 wires? There are the positive and common leads, but what is the third for?

Thanks,

Jason
The third wire, I believe it is white, is the control signal wire. It carries a PWM signal. It is a pulse train at about 50-60 Hz. Each pulse will vary from 1ms to 2ms with neutral being 1.5ms. 1ms pulses drive the motor at full speed reverse, 2ms drives the motor at full speed forward. The positive wire caries the battery voltage at a constant dc voltage approximately equal to the 7.2v battery.

JasonQ
06-12-2005, 18:54
Hmm...that sounds like how a servo works. For a motor, isn't the PWM signal sent down the positive lead and returned via the common lead?

-Jason

sanddrag
06-12-2005, 19:05
Normally yes but the Vex motor has its speed control built into it, not built into the robot controller or external like an RC car or FRC robot. The robot controller generates some PWMs, and then some electronics within the Vex motor housing pulse the power on a larger scale, to drive the motor.

JasonQ
06-12-2005, 20:05
Ok, that makes sense. Thanks for the info guys.

-Jason

Elgin Clock
06-12-2005, 20:16
Hi,

Why do the VEX motors have 3 wires? There are the positive and common leads, but what is the third for?

Thanks,

Jason

Hey all.. If I were to read that statement yet take the word VEX out of the sentence, I would at first say 1 for positive, 1 for negative, and 1 for a ground.

Why would a VEX motor be any different?

Matt Krass
06-12-2005, 20:51
Hey all.. If I were to read that statement yet take the word VEX out of the sentence, I would at first say 1 for positive, 1 for negative, and 1 for a ground.

Why would a VEX motor be any different?

Because it's postive, ground and signal? :)

As far as I can tell the Vex controller can control motors or servos in either port, so its a small leap to say it uses PWM to control motor speed using wire 3 as signal, otherwise you'd have to indicate motor or servo somehow.

Did that make any sense? I'm tired...

Alex.Norton
06-12-2005, 22:27
it doesn't make any sense to me to use a separate cable for PWM when the power goes through the controller. I would simply mean needing extra circuitry in the motor that the controller already has.

Since in the code for the vex you specify whether you are using a servo or a motor I could see the third wire being nothing (if the motor doesn't have a feed back loop) for a motor and a feedback loop for the servo because a servo needs 3 wires. They simply used a third wire on the motor so it had the same connector and port.

Just a thought, I don't know a lot about the subject but that makes more sense than have a separate PWM signal.

Matt Krass
06-12-2005, 22:35
it doesn't make any sense to me to use a separate cable for PWM when the power goes through the controller. I would simply mean needing extra circuitry in the motor that the controller already has.

Since in the code for the vex you specify whether you are using a servo or a motor I could see the third wire being nothing (if the motor doesn't have a feed back loop) for a motor and a feedback loop for the servo because a servo needs 3 wires. They simply used a third wire on the motor so it had the same connector and port.

Just a thought, I don't know a lot about the subject but that makes more sense than have a separate PWM signal.

Your logic makes sense, but when you are poor like me and only have the bare radio kit.... I never saw any way to discern between motor and servo, and variable power to a servo would be...well...odd...I stand by it being PWM and that being used for speed control, but I admit I can't explain why the code allows to select, any ideas on this?

foobert
06-12-2005, 23:55
if you tried to control a motor directly with the vex controller it would suck enough amps through the poor dear to release all of its magic smoke.

if you take the back off of a vex motor, you'll find a little 8 pin pic on a circuit board that is impossible to pry out of the housing because the motor is soldered to the other side. also on the other side, (if you pry a lot, like i did), is a larger chip with many legs. i'm guessing this is a monolithic h-bridge. if the little 8 legged pic tried to drive the motor directly, it, too, would lose all its magic smoke.

so, we've got an eight legged pic. that's certainly enough for power, (bet there's a regulator on that little circuit board, too), ground, three pins to control the h-bridge, and something left over for feedback from the motor so the little pic can say, "ok, if you give me a 1ms pulse i'm going to spin this thing at 100 rpm in reverse, if you give me a 1.5ms pulse i'm not going to spin it at all and if you give me 2ms i'll spin it 100 rpm forward."

reckon i ruined that motor, too.

Matt Krass
07-12-2005, 15:04
Here's the proof I believe the Vex Motors use PWM for speed/direction control as well.

Yes you can reverse the direction of a motor in your User code. This is how the default code makes one motor spin CW and another motor spin CCW for the same joystick movement. See the line in our default code that has the comment “ // reverse direction of left side (CCW) ”.

You can not send the same value “255” to 2 different motors and have them spin in different directions. The value of 255 is converted into a PWM pulse of a certain width. This pulse width is sent from the Vex Micro Controller to the Vex Motor, where it is decoded by the Vex Motor into a direction and speed. Therefore; the pulse created from a value of “255” will always be decoded into the same direction and speed by ever Vex Motor.

I found this at http://www.vexlabs.com/forum/viewtopic.php?t=18