Turntable stepper motor for 3d scanning

Hi, this is my first arduino project.

I`ve bought: - Arduino UNO Rev3 - Arduino Motor Shield Rev3 - Kysan 1124090 Nema 17 Stepper Motor (stepper motor from Arduino shop)

I`m trying to build turntable for 3d scanning.

I want connect it through USB to Windows 8.1 x64 PC. My soft after scanning is virtually pressing some key from keyboard ("Z") to show that it is ready for next scanning.

I want to Arduino listen for key event ("z" key) to start movement for few steps and next stop to wait for next key event.

I`ve seen few tutorials and I think I am ready to do it :)

I have problem with that stepper motor and power supply. It`s 4,2V (http://store.arduino.cc/product/MK00742) and my Arduino will be continuously connected through USB (USB has got own power supply) to listen for key event.

Which voltage power supply I should buy to not fry my PC. I will connect power supply to Motor Shield and Arduino will be powered from USB. Is that correct? Is it allowed to connect power supply by 2,1 mm jack on Arduino board with USB connected. What if I will connect 12V? Will I need 12V for that stepper motor? Will I fry my PC with 12V? I wanted to buy power supply 1A-2A 12V with 2,1mm plug. It would be needed for my future arduino project but I think it`s better for this project buy power supply without plug (naked wires) 5V and connect it only to motor shield to not fry my PC. Which option will be better?

Any help will be appreciated.

I know this will not be welcome advice but that driver is a poor choice for that motor. Look at stepper motor basics.

Unless the torque required from the motor is very low you will need to power it with more than 4.2v and you can't do that with the driver that you have.

A specialized motor driver board will have an inbuilt capability for microstepping which may be important for a turntable project.

...R

Thanks for answer. Ive bought 200 steps motor (200 steps = 360 degrees). One step is 1,8 degree. This is more than enough. I dont need microsteps. I thought rather to do 10 steps movement to get 18 degrees. So scanner will make scan every few steps. The smallest settings will be 1,8 degree but it`s too small amount for me. 18 degrees will be enough to make scan.

So may you tell me after that info: is it motor shield is ok for my purposes? What power supply should I buy?

http://www.nmbtc.com/step-motors/engineering/full-half-and-microstepping/ I`ve read here that two phased stronger method will need doubled voltage 4,2V*2. I may also use single phase method with single voltage.

I don`t need more than 200 scans for one object becouse my scaner need only small over scan area to put it together. It has small amount of DOF so I can do few scans to get good result. But I need turn it in Y axis. Thats the point. Microsteps are not needed for my method.

The motor is 1.5A low impedance bipolar - not very suitable for H-bridge driver board, it needs a chopper driver really, and one that can handle 1.5A.

The 298 chip used on the Rev 3 shield can in theory handle 2A, but in practice it can't because there isn't a large heatsink and a fan attached to it.

You want microstepping if you want the motor to behave well and not exhibit bad resonance issues BTW.

So should I change motor shield or motor? Will it work with that shield and motor if I supply 12V 2A without heat sink and I will rest after 200 steps (360degrees). That table wont work all the time. From time to time only. Do the scan and rest without air cooling?

Will it work badly or wont work at all? Ive heard about short delay which is a must but it`s not a problem for me.

Thanks Robin once again for link. I`ve read carefully. I may return to shop that motor shield but I should know what to buy next.

They have: - Pololu A4988 Black Edition ( https://www.pololu.com/product/2128 ) - Big Easy Driver ( https://www.sparkfun.com/products/11876 )

Which driver will be easier for a green user like me? Which will be easier for voltage steering? Is it needed to decrease voltage during work (logically through microprocesor or manually through potentiometer od driver board)?

Please recommend me also DC power supply for that motor. Is that 12V 2A will be ok for me or not? Should I need more voltage & amperage? Should I buy about 35V and 2A? Where can I find such a stron DC power supply.

Please recommend me what to buy instead that motor shield. I may return it to shop during 14 days.

Edit: I`ve watched that movie: https://www.youtube.com/watch?v=SCyGM2Tp37w. So I think that I will prefer Big Easy Driver. Please tell me if I buy 12V 2A will it be ok for slow rotation or I need that 35V?

bartosh44: - Pololu A4988 Black Edition ( https://www.pololu.com/product/2128 ) - Big Easy Driver ( https://www.sparkfun.com/products/11876 ) .......

So I think that I will prefer Big Easy Driver. Please tell me if I buy 12V 2A will it be ok for slow rotation or I need that 35V?

Either one will be fine - they both use the Allegro A4988 chip. I believe the BigEasydriver defaults to microstepping and the Pololu board defaults to single stepping. Personally I find the advice on the Pololu website clearer. On the other hand the Pololu board needs an external capacitor which is included on the BigEasydriver board.

I suspect 12v will be enough but you can really only tell by testing. And you may not need to go all the way to 35v.

...R

bartosh44:
So should I change motor shield or motor? Will it work with that shield and motor if I supply 12V 2A without heat sink and I will rest after 200 steps (360degrees). That table wont work all the time. From time to time only. Do the scan and rest without air cooling?

Will it work badly or wont work at all? Ive heard about short delay which is a must but it`s not a problem for me.

Start by working out your mechanical requirements(*), then choose the motor, then choose
the driver. Lots of people work perversely in the other direction - mechanical load is
what determines what is needed, not electrical specs…

(*) speed, torque, type of motor, any gearing system…

Thanks. Ive bought Pololu a4988 and 100uF capacitor. Ive bought also power supply 15-24V ~5A and small heatsink for A4988 chip.

I have other question. I want to fire that step motor event from keyboard connected to PC (Arduino continously connected to PC).

For example I hit “Z” key from PC keyboard (connected to PC) and Arduino will run step motor code to run f.e. 10 steps rotation of motor.

Is that possible with Arduino Uno or only with Leonardo and Micro?

Becouse Im affraid Ive bought also wrong microprocessor board.

Eghhh. Hard beginning.

bartosh44: For example I hit "Z" key from PC keyboard (connected to PC) and Arduino will run step motor code to run f.e. 10 steps rotation of motor.

That is perfectly feasible but will require a little planning.

If all you want to do is send characters from the PC keyboard the simplest way may be to use a terminal program like puTTY which can be configured to send each character as the key is pressed. The Arduino IDE does not send anything until you press Return.

If you want more sophisticated behaviour from your PC you will need to write a PC program to communicate with the Arduino. That is not difficult. This demo shows how to do it with Python.

You will also need corresponding code on your Arduino to receive the characters and respond to them. The examples in serial input basics may be useful.

...R

But can I reach that with Uno board or only with Leonardo, Micro and Mega?

Edit: I thought that something like this will work on my Arduino Uno board: Serial.read(); to read Z key pressed.

Edit2: OK. It works through serial monitor inside Arduino application. I see now how it works.

bartosh44: But can I reach that with Uno board or only with Leonardo, Micro and Mega?

You need a Leonardo if you want the Arduino to send keystokes to the PC by pretending to be a keyboard.

Your need is in the other direction and any Arduino will work.

...R

Thanks Ive done it and it works. Led is blinking after hitting Z key and stepper motor works without any interaction but I cant do to steer motor after serial sending.

This is becouse when I connect everything and connect arduino to my PC serial port is out. When I disconnect motor power serial COM is back. Strange. This is my code:

int ch = 0; 
int i;
int krok;
void setup() {
  ch = 0;
  krok = 0;
  pinMode(13, OUTPUT);
  delay (1000);
  Serial.begin(9600);
}

void loop() {             
         if(Serial.available()>0){ ch = Serial.read();}
         if ('Z' == ch)
         {
             for (i = 0; i<10; i++)
             { 
               digitalWrite(13, HIGH);
               delay (10);
               digitalWrite(13, LOW);
               delay (10);
               krok = krok + 1;
                 if((i == 9) && (krok<200)){ Serial.println("S"); }
                 if((i == 9)&&(krok>=200)){ krok = 0; }
               delay (100);
             }
          ch = 0;
        }
}

What should I connect first Arduino or motor power? I connect high motor power first and next I connect arduino to usb. I see that led are blinking in different way than if I connect only one power supply. I connect only pin 13 to step. VDD and 5.5V to pololu. VMOT & ground to 15-24V DC power supply (with capacitor of course). Coil pins to motor. Reset and sleep together. It`s working without PC but after connecting it to PC my serial COM is out (during arduino connection).

Sounds like you have bad wiring, and possibly overloading the USB port on your computer. Could also be some type of comport conflict.

COM is work well (arduino + A4988 + stepper motor) on USB until I connect motor power (15-24V). Motor power works well if it`s not connected to PC.

What should I connect first?

1) connect motor higher power (stepper driver) 2) connect USB PC power (arduino) 3) work 5) disconnect USB PC power 6) disconnect motor higher power

Is that correct?

Motor power is only connected to the Vmotor on the A4988 board, right? You have decoupling on Vmotor? You have a star-ground setup?

bartosh44:
Thanks Ive done it and it works. Led is blinking after hitting Z key and stepper motor works without any interaction but I cant do to steer motor after serial sending.

I don’t see any motor control code in the program in Reply #12

…R