I am building a prototype of a mechanical device, and I need to be able to control a pair of stepper motors both driving the same shaft from either end. In other words they need to operate identically except rotating in opposite directions. I understand this part can be achieved by wiring them opposite ways.
My question concerns how to control the motors. I need to be able to use an iPhone or other device to operate the motors at various speeds in either direction, respecting mechanical endstop switches. I also need to track and display the current position on the phone.
Later I am going to want to monitor and display various conditions (strain gauges, temperature of parts, rotation speed of parts,) maybe 8 input in all, and perform calculations based on readings, operating the motors in response to the calculations. I am not anticipating the need to control anything but the stepper motors.
What do I need to buy in order to achieve this as economically as possible? Will I need to do a bunch of programming, and if so in what language/environments? I have done programming before but not for a long time, and mostly in scripting type languages like HyperTalk.
Thanks for any advice
This is a fairly advanced project... You can use Bluetooth or Wi-Fi for short distance, or GSM/GPRS over the cell phone network. For communication over the cell phone network the Arduino will need a cell phone number/contract and a SIM card.
Your choice of communication protocol will determine what hardware you need and your programming. You can get various shields (plug-in boards) depending won what you choose.
I am building a prototype of a mechanical device, and I need to be able to control a pair of stepper motors both driving the same shaft from either end. In other words they need to operate identically except rotating in opposite directions. I understand this part can be achieved by wiring them opposite ways.
Yes, a stepper can go either direction and if you reverse connections the direction will reverse. With both motors locked-together, you can use a single motor driver. Just get a motor driver with at least twice the current rating of a single motor. But, I don't get why you need to drive both ends of the shaft...
What do I need to buy in order to achieve this as economically as possible?
The stepper motors (and perhaps other mechanical parts) will likely be the most expensive component. Otherwise, the Arduino itself, and the other costs tend to be smaller things that just add-up, including the power supply, case, etc. By the time you put an Arduino in a box with a power supply and some connectors and other miscellaneous components, you are usually up around $100 USD.
Will I need to do a bunch of programming, and if so in what language/environments?
The language for the Arduino IDE is C/C++. The basic [u]language library[/u] is fairly simple (since you've done some programming before), but you'll need an additional stepper motor library and a library for the communication and those will add a bit more difficulty. And, don't forget the phone-side. If you can interface with a browser you won't to program the phone.
what size motors ?
toy stepper drivers like the A4988 are great for hobby size steppers of low power
they offer ease of use and micro-stepping.
h-bridges offer a bit more power, no microstepping and are harder to drive.
industrial drivers cost a lot more, can drive higher power and micro-step.
based on what you listed, I would expect problems. if you try to drive a solid shaft, chances are one of the motors will lead, the other will lag and fight each other. much better to design to run with one motor,
if you use isolaroes like lovejoy couplings, you will experience less problems.
you need to figure out how much power you need before you can select motors or drivers.
need to figure out speed. high speed is not things steppers are good for.
based on what you listed, I would expect problems. if you try to drive a solid shaft, chances are one of the motors will lead, the other will lag and fight each other. much better to design to run with one motor,
Some models of RepRap use exactly this technique without any problem. You need to drive both motors from the same driver and get the coils the right way round and there is no problem. Test them first before bolting them in the same shaft. It is also wise to use shaft couplers on both motors to compensate for any shaft misalignment.
You may find some useful stuff in Stepper Motor Basics
Apart from the specific business of driving the motors you have described a complex project with lots of parts - motor control, receiving motor commands, sending data to the phone etc. You should get each piece to work separately before you try to combine them. Have a look at Planning and Implementing a Program
If you are using an Android phone this RemoteXY Thread may be of interest.
Also I would not try to buy all the components up-front. As your experience grows you may change your mind about what is most suitable.
Are two motors on one shaft really necessary ?
...R
kinda follows the same logic as if you need more power, use two relays.
or two transistors. need more power, just add a second power supply.
if you can take the right steps it will work.