Operating System:
Mac OSX 10.7.5 (w/ Arduino 1.0.5)
Ubuntu 13.04 (w/ FabScan)
Board:
Arduino Uno R3
Hi,
I hope this is the right place to ask this question, advance apologies if not. I am working on a project with a FabScan laser scanner that uses an Arduino board and we are having issues with the motor - namely that it does not work any more. Last Wednesday while running a typical scan the motor would not turn correctly, instead moving by a few degrees clockwise and counterclockwise. I used a test sketch recommended on the FabScan Google group (link) to test what was wrong. Previously when the motor was working fine, uploading the sketch it via the Arduino software would (as intended) lead to the laser turning on and off and subsequently the motor turning. However, now when the sketch is uploaded, only the laser turns on and off, while the motor does nothing.
We measured the Pololu driver with a multimeter and both the logic power supply and the motor power supply were working correctly. However when testing the four pins running to the motor the multimeter reading was zero - this, again, is with two different motors and two different Pololu drivers.
We have replaced first the NEMA 17 step motor (as well as the power supply), then the Pololu A4988 stepper motor driver and lastly the FabScan Shield module, all to no effect. The laser works but the motor does not. Similarly, when using the FabScan software the laser can be turn on and off, while the controls for the motor do nothing.
So by process of elimination, I’m guessing that the issue is likely with the Arduino board and would hugely appreciate any suggestions as to what the cause maz be. I attached the Verbose Output below.
Thank you very much!
Eradj
Verbose Output.rtf (42.9 KB)
Test Sketch.rtf (4.04 KB)
To avoid confusion can you either post the test code you use (or attach it to your post) and describe how you would use it - what is done on the PC? (using what PC software?) and what should happen with the test sketch.
If it used to work before, and now doesn't work with the same software my strong suspicion is a wiring problem - has something come loose, or has something been connected in the wrong place?
Is there feedback from the Arduino to the PC to confirm that the Arduino is receiving the expected commands?
...R
Hi Robin, thanks a lot for your reply.
I attached the test sketch to my original post . The test sketch is supposed to check whether the hardware of the scanner (the motor and the laser) which is connected to the Arduino is working. I downloaded a version of the the Arduino software for OS X from this website http://arduino.cc/en/Main/Software, opened the .ino sketch file, verified it and then finally uploaded it to the Arduino board.
This is supposed to turn the laser on and off 3 times, and then turn the motor. However this no longer happens and only the laser turns on. As suggested in the FAQ section on this forum, I ran the Arduino software with Verbose Output shown (attached above) but I have to admit that I don't know enough to really understand if there's any info there that could be helpful.
As I mentioned we have tried using a new motor, a new stepper motor driver (and therefore new wiring and newly soldered connections) and a new FabScan shield, and the connections are all as per the instructions so this would suggest the issue is with the Arduino board.
Thank you again.
Gimme a break ...
You seem to know a little about computers. You don't seriously think I can load code into my text editor from your sexy screen shot.
...R
No of course not, as I mentioned in my previous post I attached the test sketch .rtf file to the original post (there is also a link to the site where I got it from). I added the screen shot since you asked how I used the test sketch.
Why would I expect an Arduino sketch to be in a .rtf file.
Why is it in a .rtf file.
I had to save the file.
Then open it with with Open Office.
Then copy the text
Then paste it into my editor.
And save it as a .ino file
If you just put it in a .ino file to start with think of all the time it would have saved for both of us.
I am in two minds whether to bother at all, but since I have taken all this trouble I will have a quick look at it.
...R
By the way, why have you included the Verbose Output? That is only useful if the program fails to compile.
Have you the ability to connect an A4988 driver and a motor to the Arduino without any of the fabscan stuff? If you can, this short code should make the motor work - just make sure to use the correct pins, or modify the code to match your pins.
// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0
byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20; // microseconds
int millisbetweenSteps = 25; // milliseconds
void setup()
{
Serial.begin(9600);
Serial.println("Starting StepperTest");
digitalWrite(ledPin, LOW);
delay(2000);
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(directionPin, HIGH);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
delay(3000);
digitalWrite(directionPin, LOW);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
}
void loop()
{
}
If this works it seems likely there is a wiring/connection problem with your other arrangment. If it doesn't then something is broken. If you suspect the Arduino try some other sketches on it that cause LEDs (with suitable resistors) to light using the pins that would normally drive the A4988.
...R
The Troubleshooting guide suggested to post the verbose output.
I tried as you suggested but unfortunately it didn't help. At this point I'd guess that the issue is with the Arduino board's connection to the stepper motor driver (when uploading a sketch with the A4988 attached the verbose output sayas there's no synching), so I ordered a new Arduino and will try that.
Thanks for the help.
eyakubov:
I tried as you suggested but unfortunately it didn't help.
I made a few suggestions - code to test the steppers and an idea to test if the Arduino I/O pins were functioning.
What does "it didn't help" mean? Did my code not work? Did the LEDs not light up?
Can you draw a clear diagram of how everything is connected and post a photo of the drawing.
My guess is the Arduino is not broken (but I could be wrong :)).
...R