Hi folks,
I recently bought the iTead dual stepper motor driver shield. Unfortunately, I am experiencing some unexpected behaviour, to which you might know some reason or solution:
Setup 1. When having one stepper connected (Y) and powering the Arduino Uno SMD only by USB, the stepper works as expected, just, that the Arduino gets pretty hot near the power transistor at the external power supply plug (which is not connected).
Setup 2. Adding the external power supply (12V, 1500mA max) to the iTead shield and restarting the Arduino, the stepper starts losing steps. The heat-problem persists. Also, the both chips on the shield get pretty warm (normal?)
Setup 3. When adding the second stepper (not using it) using just the USB as power supply, the Y-stepper loses steps. The heat-problems persist.
Setup 4. When adding power supply to the shield in setup 3., all problems of 3. persist.
Below, you can find my program for testing. I left all the switches and jumpers on the iTead shield unchanged (factory settings: 5V logic, Vref: both middle, all step size jumpers to high).
Note: In my setup, the iTead shield is not short-cut by the USB-connector of the Arduino.
Hope, I'm not doing anything wrong!
Thanks for your help, Stefan.
// ******************************************************
// Micro Robotics
// Test Procedure to test Y channel
// www.robotics.org.za
// written by : Frikkie du Toit
// For Stepper Shield ver 1.0
//
// To test Y Channel To test X Channel
// STEP_PIN 6 STEP_PIN 2
// DIR_PIN 7 DIR_PIN 3
// YMS1 8 YMS1 4
// YMS2 9 YMS2 5
// ******************************************************
#define STEP_PIN 6
#define DIR_PIN 7
#define YMS1 8
#define YMS2 9
void step_mode(byte yms1, byte yms2)
{
// Set the pins to select the step mode
digitalWrite(YMS1, yms1); // Set pin YMS1 to the parameter given
digitalWrite(YMS2, yms2); // Set pin YMS2 to the parameter given
}
void step(int steps, float speed)
{
// Take the amount of steps specified
// Negative value for opposite direction
byte dir;
float micro_sec_delay;
if (steps > 0) // If steps are positive
{
dir = HIGH; // Set direction
}
else // If steps are negative
{
dir = LOW; // Set direction
}
steps = abs(steps); // Set steps to absolute value
digitalWrite(DIR_PIN, dir); // Set the direction pin to dir
micro_sec_delay = 1 / (speed / 100) * 70; // Calculate delay between step pin toggles
for (int i = 0; i < steps; i++)
{
// Takes all the steps in the specified direction
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(micro_sec_delay);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(micro_sec_delay);
}
}
void setup()
{
// Set all the pin modes
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
pinMode(YMS1, OUTPUT);
pinMode(YMS2, OUTPUT);
}
void loop()
{
step_mode(LOW, HIGH); // Set step mode to Quarter Step mode
step(400, 25);
delay(500);
step(200, 25);
delay(500);
step(200, 25);
delay(500);
step(200, 25);
delay(500);
step(-800, 10);
delay(500);
}