I require urgent help in getting a setup through which we can control 4 stepper Motors using USB port on my PC.
The components I have currently are:
1. USB to RS232 (Serial) Convertor Card.
2. A3982 IC - 4 Nos.
3. 4 Stepper Motors.
Stepper Motor Specifications
Dimensions: 35mm x 35mm x 26mm
Shaft diameter: 3mm
Shaft length: 8.5mm
Step angle: 1.8 Degrees
Drive sequence: Bi polar
Rated current 0.6Amps
Resistance 3 Ohms
Holding torque: 347gm/cm or 34mNm
Rotor inertia: 5g.cm2
Weight: 105 Gms.
4. My Laptop, where I intend to run a program to control the 4 Stepper Motors.
I am completely novice in this field, but a strong enthusiast and hobbyist.
I also require your suggestions / help in writing C code for this. Some sample programs on how to write & read from USB port would be sufficient, as I am quite good at C. This is intended to run on a XP OS.
I am not good at Circuit Diagrams. Of late I have been longing to do electronics projects. This is my first attempt to it. I am hereby attaching the rough diagram how it is intended to look like ( step_motor.jpg ). Another attachment is taken from internet ( plotter.jpg ), which is how I want it look like.
Basically, I am trying to plot the X & Y Axes on a Plane ( floor, where an object is kept ). Using these Axes, I will have to decide co-ordinates to hold the object etc..
The idea is to have a Light Emitter on 1 motor & reciever on another motor. we will move the motors until the Reciever doesnt recieve the emitted light. PC would count the steps the motor moved. This marks X Axis. Similar procedure would be followed to determine the Y Axis.
Sorry, If I am not upto the mark with the Circuit Diagrams. I am taking help from this forum to learn the same.
Planning to write the code to drive this circuitry once I am completely done with the hardware.
Please help me in making my idea a reality.
Thanks In Advance.
I don't really understand what you are trying to do, but unless your motors are turning extremely slowly USB will be problematic. USB is not real time so any pulses to the motor will arrive eratically and the motor operation will not be smooth. Also, a RS232 port does not have enough lines to drive 4 steppers and also return sensor inputs. If you need to use USB, the best option would be to put a microcontroller at the stepper end and just send commands to it over the USB-RS232.
Another option would be to use this USB chip. http://www.ftdichip.com/Products/FT2232C.htm It can be configured as two 8-bit IO ports. You set and read bits on the ports through an API into a driver they provide. You can access the API from your C code. It has a synchronous bit-bang mode, but even with that you still might have problems with smooth stepping at high step rates.
PS: Windows is not a real time operating system. The CNC programs that work on Windows take great pains and use proprietary code to get smooth stepping on a non-real time system. The Windows software you propose could be easy for very low step rates or if you can accept eratic stepper movement. If you need smooth movement at high step rates it could be very complicated.