Motor 393 + Arduino (Arm not able to take load)

I am helping my kids build a robot and it has two arms that extend out and retract.
Each arm is controlled by two VEX 393 motors. The motors have 12 tooth gears. These gears are then connected to 84 tooth gears and the arm is fixed on this 84 tooth gear. Each arm extends about 2 feet using 1/2 inch flat aluminum strips. The end of the arm has two wheels that have another VEX motor connected to move them.

When I lift the main robot body with these arms, the body starts to move down with its own weight and the motors move on their own with the weight.

I have tried to explain the schematic structure of the robot in the attachment.

I am using Arduino to control the motors.
Each time I stop running the motor, I “detach” them and “attach” them again when I want to run.

Can someone tell me how can I retain the body in the “lifted” position and prevent the motors from spinning backward on their own?
Is there a way to keep the torque of the motors without moving them?

Things I have tried:

Apply a small control value to the motors. Eg Servo.write(92) or something like that. I’m not exactly sure what you are using now or what are reasonable values. I’m assuming you are using the servo library

Thanks for the hint Highwayman.
Yes I am using servo library.

So If I apply something like 92, it should give me the torque but not move the motor, is that correct?

That’s the idea. I’m assuming that 90 would be stationary and 180 would be full forward but I don’t know for sure. Based on what I read it can depend a little.

Do you have an h bridge and something more powerful to move the motors?

You can implement some PID loop but I don’t see a potentiometer to help show the position. So some hold strength is what you will want, but without a feedback loop it will be difficult to tune in.

Often the devil is in the details, so perhaps a number of photos would help us understand the problem. In using rubber bands, you should try to physically disconnect the motors and apply rubber bands until the structure can almost lift itself, therefore the motors are providing only minimal force. If rubber bands are placed incorrectly, they can actually make your problem worse.

The Vexmen have a good point: your Arduino board might not be configured to provide enough direct power to these motors, so if you don’t have some sort of power switching Arduino “shield” or something, your motors might be under-powered. When loaded down, Vex motors can draw a lot of amps.

Highwayman also has a good suggestion: provide a holding torque value when the motors get the system into position. But be aware that the 393 motors can not sustain too much holding torque for very long: they will over heat. So the holding torque value must be kept below a certain value. In Vex RobotC, that value is only about 10 to 20 out of a max of about 127.

Hi @Team80_Giraffes
I am using Arduino101 with BLE and connecting my Android smartphone to send control signals to the board.

I am not using any H-Bridge, I have Controller29 which directly plugs into Arduino. Do I still need to use any Shield?

I will upload some pictures shortly.

Oh, you should definitely be using some kind of external power supply (eg a battery). Running motors off the arduino power is not good.

Sure I am using a external battery :slight_smile:

7.2V Tenergy 3000mAh Flat NiMH High Power Battery Packs with Tamiya Connectors

I am supplying this power directly to the motors and using the Arduino to send the signal.
My typical schematic of a wiring a motor looks like the attached image (the sketch shows Arduino MEGA, but I have now changed to Arduino101).

Ground from battery to arduino?

Arduino has its own power supply.

I hope jpearman will correct me if I’m wrong, but I think what he’s asking about is: do you have the negative wire of the external battery connected to ground on the Arduino? I’m not sure how the M29 does its switching, but if it works like I think it does, it might need to have a common ground with the battery. I think the M29 uses mosfets, so it might need that for the Arduino to drive it, but I’m not 100% sure.

Oh yes, I have the Ground from M29 going to Arduino GND.
Sorry, the diagram didn’t show this.

Any chance you can get a potentiometer on the arm so you can control the hold strength using a feedback loop? (PID or P or PI control loop). The Vex one is a variable resistor. Not sure what the values look like but it should be OK at 5 volts of the arduino, you will just get a different value range.

Just for some arduino backround. You really shouldn’t attach and dettach the motors every time. That is going to lag your program noticably

Thanks for the tip.
I will try putting the motors on 92 speed instead of detaching them as I was doing currently.

Will report how that goes.

While we are at this. I would be also interested to know if there is a way to control the speed of the VEX motor using Arduino code? Right now my motors turn at 100RPM (i guess) and I have to use a 12 tooth gear with an 84 tooth gear to reduce the speed. I know i can reduce speed by sending lowe number to servo.write() but then I will loose the torque, right?

Any suggestions on this would be great :slight_smile:

I’m a bit sketchy when it comes to understanding how the Arduino works (no pun intended), but as far as I know, there is no way to reduce speed on a 393 motor via only software without also losing torque. I think you would need to use gears, or some kind of mechanical transmission system if you wanted to keep torque high while reducing speed on the fly.

See the 393 torque-speed curve here, and note that the overall power of a motor is roughly related to its rotational speed multiplied by its torque:

It’s from a post done by the venerable jpearman, here:

Hi All.
I was able to run the arms and keeping them in 92 kept the arm strong.

But I ran into another strange problem.
Suddenly the wire from the 7.2v battery started burning.

It started burning from the battery end and continued towards my PCB and. I disconnected the power before it reached the PCB.

Any idea in what situation does the battery wire burns? High current draw or faulty connection or something else…

Attaching the burned wire picture

Seems like the battery shorted somewhere. I’ve made the mistake of accidently shorting batteries while measuring them, and they get hot fast. If the fire started near the batteryitself, it might’ve shorted near where the wires meet the battery pack.

Ok that makes me a litttle comfortable to know it’s most likely shorting issue rather than my circuit.

Because nothing fried on the PCB.

I will replace thee battery connector and try again tomorrow.

Btw the wire that comes out from battery pack is not damaged. It’s the one from connector to PCB. So should I also investigate the battery pack connector?