Turn motors off, using code for cooling? (Itead Dual Stepper Motor Shield )

I want to buy a Itead Dual Stepper Motor Driver Shield like this one:
http://www.robotshop.com/dual-stepper-motor-driver-shield-arduino.html
Can I turn the motors off, using the code, when they are not in use so that they can cool off?

What code would I use to power down the motor when everything is at rest? The sample code that they give is this:

int dirPin1 = 3;
int stepperPin1 = 2;
int dirPin2 = 7;
int stepperPin2 = 6;

void setup()
{
pinMode(dirPin1, OUTPUT);
pinMode(stepperPin1, OUTPUT);
pinMode(dirPin2, OUTPUT);
pinMode(stepperPin2, OUTPUT);
}

void step(boolean dir,int steps)
{
digitalWrite(dirPin1,dir);
digitalWrite(dirPin2,dir);
delay(50);

for(int i=0;i<steps;i++)
{
digitalWrite(stepperPin1, HIGH);
digitalWrite(stepperPin2, HIGH);
delayMicroseconds(100);
digitalWrite(stepperPin1, LOW);
digitalWrite(stepperPin2, LOW);
delayMicroseconds(100);
}
}

void loop()
{
step(true,16005);
delay(500);
step(false,1600
5);
delay(500);
}

You can power it down, but note that if you do that the motor won't be held in position and will be free to turn.

I'm not sure if that is possible with that particular shield w/o hacking it. I gave a quick look at the support documentation for that shield, and saw that there are 3 pins on the translator/driver chips that the shield uses that could possibly allow disabling the motor outputs, /RESET, /ENABLE, & /SLEEP. Unfortunately I couldn't find where any of these three pins are connected to an Arduino pin.

Remember, if you find a stepper driver board that does allow you to 'turn off' the motors, unless the turn off technique shorts all the motor coils you will not have significant holding power and external forces may spin your stepper motors. (Try this with an unconnected stepper. Turn the shaft and feel the resistance to turning. Then hold the bare ends of all the wires together and try turning the shaft again. I dare you to turn the shaft. I can't on my stepper motors...)

Yes I have designed the 2 axis robot in such a way that it will stay in plays when at rest. I just don't want the motor to get hot when it is just sitting there for 95% of the time on a 24/7 basis.

Could I run a wire to a diferent free pin on the arduino? I have an Arduino Mega 2560.

According to the documentation, pulling Enable High will switch off the output mosfets.

Thank you
and
Sorry but how would I do that? Hmmm termanal 15? A1?

I see an A 0 1 2 3
G
+
S

But what would I do with it?

[quote author=Asa Herring link=topic=171313.msg1273479#msg1273479 date=1370894096] Yes I have designed the 2 axis robot in such a way that it will stay in plays when at rest. I just don't want the motor to get hot when it is just sitting there for 95% of the time on a 24/7 basis.

Could I run a wire to a diferent free pin on the arduino? I have an Arduino Mega 2560. [/quote]

How good are you at SMT soldering? (Honest question.) Would you want to shut both motors off at the same time, or be able to individually control each? (I hope you want to shut off both at the same time. Individually controlling each would probably require cutting traces on the board...) According to the schematic both /RESET signals are pulled high by R24, both /SLEEP signals are pulled high by R25, and both /ENABLE signals are pulled low by R26. I don't have this board and both the picture of the board and the layout drawing in their documentation don't give the resistor REF'Ds, so I can't tell you physically which resistors they are. My guess is R25 through R26 are the group of 3 resistors between the Drive Mode Setting jumper block and the gap between the two ICs. If you have a continuity tester or a resistance meter, try to find an end of three resistors where (from either of the ICs) pin 3 (/SLEEP), pin 15 (/ENABLE), and pin 22 (/RESET) show continuity. Mark and document them for your own sanity. That point of one of the resistors is where you would want to connect your wire. Because this a small solder point to attach the wire, after soldering it I would then tack part of the wire down with glue or a sticker or something. That way if the loose wire gets tugged, the force of the tugging will be on the glue/sticker/whatever instead of the solder joint.

Depending on your whim, I'd use either the /SLEEP or the /ENABLE pin to turn off the motors, not the /RESET pin. (Read the datasheet for the chip to know what each of the different pins do.) Just remember, to turn off the motors with either the /SLEEP or /RESET pins, you would digitalWrite(pin,LOW) to enable the sleep or reset modes. But if you use the /ENABLE pin you need to digitalWrite(pin,HIGH) to disable the enable mode.

I might be tempted to wire the /RESET signal to the Arduino's reset pin so the drivers are reset when you reset the Arduino.

You may also want to contact the designers of this board to make sure I'm not giving you potentially bad information.

Oh, it also looks like D10-D13 are not used by this shield, so as long as your project doesn't use them you can wire whichever signal you want to use to one of those 4 digital I/O.

Thank you for writing back with such detailed information. I think that when I read it about 10 times, I might get it. It looks pretty straight forward. Normally I can even understand Greek if I read it enough times and that is what I will do.

I do not need the motors to turn on individually. The X carriage moves from station to station and the Y boom moves up while in route. When the carriage gets to a new station, the boom drops and the whole thing can shut down for a few minutes before moving on.

I just got the second post. So I would run a wire from ...say D10 to what, where?

Would I run and wire from D10 to one of these? two of these?

Sembazuru: e pins are connected to an Arduino pin.

Remember, if you find a stepper driver board that does allow you to 'turn off' the motors, unless the turn off technique shorts all the motor coils you will not have significant holding power and external forces may spin your stepper motors.

Shorting the motor coils does not stop the motor turning. It might add some braking force if it is already turning, but it won't lock it in position.

MarkT:

Sembazuru: e pins are connected to an Arduino pin.

Remember, if you find a stepper driver board that does allow you to 'turn off' the motors, unless the turn off technique shorts all the motor coils you will not have significant holding power and external forces may spin your stepper motors.

Shorting the motor coils does not stop the motor turning. It might add some braking force if it is already turning, but it won't lock it in position.

If the motor is already stopped (static), the back-EMF of all the motor wires shorted together creates a tremendous force. If you have a spare 4 or 6 wire stepper lying around, short all the wires together and then try to turn the shaft. On my steppers (I think they are 12V steppers, might be 24V) when I short either all 6 wires (or just the 4 wires that I'd use hooking it up in bipolar mode) I can't turn the bare shaft with my fingers. I haven't tried applying any mechanical advantage tho...

It won't hurt anything if the carriage is free to move. It is on a flat plain and the natural friction of the wheels under cable tension keeps it in place. The boom of course is held down by gravity when the power is off...if this newbe can get it to turn off.

None of the ones that you have circled. Those are for the analog passthroughs on A0-A3. (A4 & A5 are connected to the IIC header as an I2C passthrough.)
If you want to use D10, my suspicion would be to connect D10 to one of the ends of one of the 3 resistors that I have circled in red. But that is just an intuitive guess. I would want to check continuity with those 6 points to the 5 following circuit points: GND, VDD_EXT (can be found on both ICs at pin14, and pin 2 of both the IIC and UART headers), pin 3 of either IC, pin 15 of either IC, and pin 22 of either IC.

Hmm… I may be wrong… Looking closely at the picture of the board in the documentation it almost looks like the STEP signal (pin 10) goes to one of those resistors…

Even with checking continuity, it might be best to contact support@iteadstudio.com directly to see if they can help you know where to run wire(s). I’m not finding enough detail (like board layout information for all signal layers).

A question something like

I want to put the drivers and my motors into sleep mode with pin D10 on my Arduino. What do I jumper to D10 to allow me to do this?

might be a good conversation starter.

Good luck.

Thank a lot.

I took your advice and wrote to iteadstudio support and also posted on there forum but got no response at all. I tried RobotShop support at the same time and got this graphic approved so I bought it there.

you need to connect pin 15 on the driver IC to pin 10.

that looks correct indeed. It will use an analogue pin as a digital output to control the enable signal.

Thanks again.

Bummer that ideadstudio didn’t get back to you, but I’m glad you got an answer. The only reason why I was suggesting soldering to a resistor end instead of an IC pin is sometimes it can be difficult to solder an add-on wire to an IC pin w/o causing bridges to adjacent pins. Not having the board myself, I wasn’t able to find the correct location for you.

But, the second quote isn’t correct. You aren’t using any analog pins anywhere. Pin 10 of the Arduino is a digital pin… Other than that, yes.

Pin 15 of the IC is the /ENABLE pin. That slash before the word “enable” is important. It means that the signal is “low active”. So, to enable the chip you need to put a low logic signal on that pin. (And conversely, put a high logic signal on that pin to disable it.) Pin 15 of both chips are connected together according to the schematic, so that one point will enable/disable both chips. The board already has the pull-down resistor to pull the pins down to keep the driver ICs in enable mode, so that wire should be all you need. Just remember the inverse logic (or just think of it as a “Disable” pin).

One hour after my last post I got this in my e-mail from Itead :

Hi,

Thanks for your mail and I am very happy to do something for you.

The ENX and ENY enable pins of the motor shield are connected to A0 and A2. If you don't want to use them, please set the A0 and A1 to high voltage, digtialWrite(A0,HIGH).

And they are stackable, the description is wrong, thank you for pointing it out.

Looking forward to your reply.

Best Regards!

...along with his name and company.

[quote author=Asa Herring link=topic=171313.msg1276362#msg1276362 date=1371098645] One hour after my last post I got this in my e-mail from Itead :

Hi,

Thanks for your mail and I am very happy to do something for you.

The ENX and ENY enable pins of the motor shield are connected to A0 and A2. If you don't want to use them, please set the A0 and A1 to high voltage, digtialWrite(A0,HIGH).

And they are stackable, the description is wrong, thank you for pointing it out.

Looking forward to your reply.

Best Regards!

...along with his name and company. [/quote]

You might want to let the folks at robotshop know about this, and the fact that this description doesn't match the schematic at http://www.robotshop.com/content/ZIP/documentation-shd037.zip

And let the itead folks know that this description doesn't match their schematic at ftp://imall.iteadstudio.com/IM120417015_Dual_Step_motor_driver/SCH_IM120417015_Dual_Step_motor_driver_shield.pdf (Which appears to be the same schematic in robotshop's zip file.) Also get clarification, is it supposed to be A0 and A2 like in the first sentence, or A0 and A1 like in the second sentence?