I'm looking to start a project using a stepper motor. The device needs to turn a box at 50rpm for 10mins or 500 revolutions. It needs a counter to count the number of turns. It also needs an emergency stop button and stop button that resets the counter and puts the motor in it's starting position.
I'm new to all this but think Arduino should be able to do this.
Welcome.
Install and open ArdinoIDE. Open menu File>examples - you see some sketches. work thru each and try to understand how it works. of course you will often search explanation in web to many at first look strange words. I personally prefer to look videos on youtube to some project or idea.
The first thing is to decide on a stepper motor that will supply the required torque at the required speed. Then choose an appropriate stepper driver and motor power supply. Once you have all that connected then write the software.
The AccelStepper library will help you to control the motor. The library code takes care of counting steps. If you have properly chosen your motor, you do not worry about missing steps. My 3D printer runs of hours without missing a step.
The emergency stop should physically disconnect power, it does not go through the controller.
Homing is easy with the addition of a limit switch. Can be mechanical, opto or magnetic (Hall effect). Usually, homing automatically zeros the step count (in code).
Hi thanks for the reply. The box is 300mm square and weighs 4-5kg with a 0.5kg weight free to move inside the box. The box rotates around the centre of the 300mm square. It's supported on bearings and the speed is quite low. 50 rpm.
It's a price of equipment for testing wood pellets and these normally use a three phase motor and these are normal controlled by an inverter and driven by a worm driven gear box. This is good because when it stops it brakes the box.
Thinking about it I only need the Arduino to control the stepper motors speed by producing the pulse out put and count the number of revolutions and open a relay after the 500 revolutions are up.
The counter could be controlled by a reed switch and this can be used to control the stop position. I'll draw a simple diagram of the circuit.
What I'm not familiar with is supplying the different voltage to the different parts of the system. The steeper motors would operate on a higher voltage and current than the Arduino.
Why are you using a stepper motor? Do you need precise positioning? Or speed control? Or both?
Since we don't know anything about the stepper, the driver or the Arduino of choice, we cannot say anything but generalities.
Choose a supply that can supply the motor at the right voltage and current plus some overhead (1.5-2 X). Use a buck converter to drop that voltage down to the Vcc (5V or 3.3V) and connect the output of the buck converter to the Vcc pin of the Arduino.