VEX 393 with Arduino

Hi
I had started a conversation earlier here
https://vexforum.com/t/newbie-questions-about-vex-motor-393/38292/1

There were multiple questions I. That post and now I am searching for a specific answer hence starting this new thread.

I am trying to run VEX 393 using arduino and motor controller 29

I just got my packages delivered today with the motor and controller.

I connected the motor as per this schematic.

Now when I run my code, the motor does not seem to be moving. What could I be doing wrong here?

This is my code:


#include <Servo.h>
Servo myServo;

void setup(){
myServo.attach(10);
}
void loop(){
myServo.write(120);
}


Sorry solved it :slight_smile:
I had to connect ground from controller to arduino ground.

Now one question though.
If I run the motor at a slow speed I get very less torque.

myServo.write(88);

Is is possible to increase torque at slow speed?

Not via software, you are effectively running the motor at a lower voltage (via the motor pwm), lower voltage means lower current means less torque. You would need to use different gearing between the motor and whatever it is driving to increase torque.

You are effectively giving the motor 2% power here so you can’t expect all that much from it, I’m surprised it even turns. I would suggest gearing so that about 2/3 power goes the speed you want. That way you can raise and lower speed accordingly without too much effort.

ok, I understand that gear system would be the only possible way to achieve torque.
So any suggestion on how much gear ratio I need to be able to move 270 degrees in about 4 seconds while I keep the current at “myServo.write(120);” ?

Or if not, how can I find out how many rotations the motor makes per second when i keep the code at 120 or for that matter any correlation between motor speed and current?

Thanks

NOTE: I am assuming that Servo.write goes from 0 to 180.

So, you want to be able to do 3/4 revolution in 1/15 minute. Calculation: you want to be able to do (3/4)/(1/15) = 11.3 rpm

VEX 393 motors have 3 speeds - Normal (100rpm), Fast (160rpm), Turbo (240rpm). If you did not open up your motor it is at standard gearing.

For going from 100 rpm to ~11 rpm, I would recommend a gear ratio of 1:7. This gives you a max speed of ~14 rpm, and your desired speed of ~11 rpm at a duty cycle of 80% (servo.write(160)), roughly in line with what @tabor473 suggested. Also, this is really easy to do with VEX: take your smallest gear (12 tooth) and attach it to your motor shaft, then take your largest gear (84 tooth, lots of holes for VEX screws) and attach it to your output shaft.

Here’s how to calculate motor speed from the code. What happens when you write a speed is that you are switching the motor on and off really fast. Speed is (mostly) directly proportional to time on, so the graph of speed is lines connecting full backward at 0 to no rotation at 90 to full forward at 180. Torque does mostly the same thing.

Hi @Iwilsonp
That’s really informative. Thanks a lot.

Yes, the motor goes 0 to 180 and 90 is stop.

So when you say VEX 393 has three speeds, how are the speeds defined? If I have not modified the motor then will my speed be 100rpm?

I am going to try some gears this week and post the results :slight_smile:

The 393 is a DC gearhead motor, that comes from the factory set for a maximum speed of 100 RPM. The motor also comes with a different set of internal gears that give you 160 RPM (the kids usually call these “high speed” gears). You can order (for extra cost) another set of internal gears that offer 240 RPM, which are called “turbo gears.” You use a small screwdriver to open the motor case on the side with the output shaft to change the gears. The gears themselves are press fit (you can use your fingers) and do not have any kind of fasteners.

Since you do not need anything like even 100 RPM, I would suggest that you don’t need to open your motors or change internal gearing.

Hi @Rick TYler
Thanks for the explanation. Really helps.

Since I do not need the speed, I will go with default 100RPM.

Will post the results soon.
First I need to build the gear mechanism :slight_smile: