Forums

Controlling a Stepper Motor.

Started by calcasmy July 9, 2012
Greetings, 

To start with, I am not even a beginner and am planning to learn... I am
trying to control a stepper motor. This is where I got so far:



1. Stepper Motor connected to power supply (12V) with darlington pair.
2. Converted USB serial signals to parallel signals for connecting to the
darlington pair. 
3. I wanted to use a microcontroller, but didn't want to complicate it
(next level). I have worked as a C# programmer earlier (So I do have some
coding experience).

My Question: 

1. How do I generate the Signals and send them to USB to Parallel
converter.
2. What language do I use. *(I am familiar with C, Can I use C or can I use
C# itself).
3. Is this want is called Assembly level programming. (or is assembly level
programming used for controlling Microcontrollers only)?

Any help is much appreciated.

Thanks & Regards
Nick



	   
					
---------------------------------------		
Posted through http://www.Electronics-Related.com
On 7/9/2012 4:26 PM, calcasmy wrote:
> Greetings, > > To start with, I am not even a beginner and am planning to learn... I am > trying to control a stepper motor. This is where I got so far: > > > > 1. Stepper Motor connected to power supply (12V) with darlington pair. > 2. Converted USB serial signals to parallel signals for connecting to the > darlington pair. > 3. I wanted to use a microcontroller, but didn't want to complicate it > (next level). I have worked as a C# programmer earlier (So I do have some > coding experience). > > My Question: > > 1. How do I generate the Signals and send them to USB to Parallel > converter. > 2. What language do I use. *(I am familiar with C, Can I use C or can I use > C# itself). > 3. Is this want is called Assembly level programming. (or is assembly level > programming used for controlling Microcontrollers only)? > > Any help is much appreciated. > > Thanks & Regards > Nick > > > > > > --------------------------------------- > Posted through http://www.Electronics-Related.com
Maybe this will get you started: http://www.daniweb.com/software-development/cpp/threads/107651/how-to-control-a-stepper-motor-using-a-microcontroller-programmed-at-c Tom
On Mon, 09 Jul 2012 16:56:37 -0400, Tom Biasi <tombiasi@optonline.net>
wrote:

>On 7/9/2012 4:26 PM, calcasmy wrote: >> Greetings, >> >> To start with, I am not even a beginner and am planning to learn... I am >> trying to control a stepper motor. This is where I got so far: >> >> >> >> 1. Stepper Motor connected to power supply (12V) with darlington pair. >> 2. Converted USB serial signals to parallel signals for connecting to the >> darlington pair. >> 3. I wanted to use a microcontroller, but didn't want to complicate it >> (next level). I have worked as a C# programmer earlier (So I do have some >> coding experience). >> >> My Question: >> >> 1. How do I generate the Signals and send them to USB to Parallel >> converter. >> 2. What language do I use. *(I am familiar with C, Can I use C or can I use >> C# itself). >> 3. Is this want is called Assembly level programming. (or is assembly level >> programming used for controlling Microcontrollers only)? >> >> Any help is much appreciated. >> >> Thanks & Regards >> Nick >> >> >> >> >> >> --------------------------------------- >> Posted through http://www.Electronics-Related.com >Maybe this will get you started: >http://www.daniweb.com/software-development/cpp/threads/107651/how-to-control-a-stepper-motor-using-a-microcontroller-programmed-at-c > >Tom
Lots of background on using steppers here: http://www.cs.uiowa.edu/~jones/step/ and here: http://www.taomc.com/bits2bots/index.htm and here: http://www.doc.ic.ac.uk/~ih/doc/stepper/
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig70324EBD9A7E908D6D0884DF
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable






On 12-07-09 02:26 PM, calcasmy wrote:
> Greetings,=20 >=20 > To start with, I am not even a beginner and am planning to learn... I a=
m
> trying to control a stepper motor. This is where I got so far: >=20 >=20 >=20 > 1. Stepper Motor connected to power supply (12V) with darlington pair. > 2. Converted USB serial signals to parallel signals for connecting to t=
he
> darlington pair.=20 > 3. I wanted to use a microcontroller, but didn't want to complicate it > (next level). I have worked as a C# programmer earlier (So I do have so=
me
> coding experience). >=20 > My Question:=20 >=20 > 1. How do I generate the Signals and send them to USB to Parallel > converter. > 2. What language do I use. *(I am familiar with C, Can I use C or can I=
use
> C# itself). > 3. Is this want is called Assembly level programming. (or is assembly l=
evel
> programming used for controlling Microcontrollers only)? >=20 > Any help is much appreciated.
The very first step to take is this: http://homepage.cs.uiowa.edu/~jones/step/ Read sections one through seven and you are in a much better position to do research. The good doctor's paper will save you a lot of misery. There WILL be a quiz. mike --------------enig70324EBD9A7E908D6D0884DF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJP+5tQAAoJEDTMN7GV3zbXaa4H/2xX9PyVcoXEqDAmMgok4f5X VKkjbAQowfctsUX0o1Hubd1bgalfPWl/gIZkXklY27Xo/tDKZsqgvCLQ0YfFj0Gs Ygz9ztSR4hhumY2LLqecyP4zgG06cWvsl+O1tjExBxQFe2QihYzmZljVuv1vEHBL 1gFSbW0dZ6euH7k/4isnp+/GtBkJYTAh/PMBCLHIdYrEC/qIRdxB0iT5YTySv7vd bxzAugnJdApXJyks6CsSSCQc8aC5GvOWqkQX8y7Kpcvwde8xexSus6rMJyfszSmV uwxwhhFRxZG1W0yx811ACirp/PGp7XqvM8W+bcxhuHys/z7sOroPIlFhxv5EFQI= =YVho -----END PGP SIGNATURE----- --------------enig70324EBD9A7E908D6D0884DF--
On 7/9/2012 1:26 PM, calcasmy wrote:
> Greetings, > > To start with, I am not even a beginner and am planning to learn... I am > trying to control a stepper motor. This is where I got so far: > > > > 1. Stepper Motor connected to power supply (12V) with darlington pair. > 2. Converted USB serial signals to parallel signals for connecting to the > darlington pair. > 3. I wanted to use a microcontroller, but didn't want to complicate it > (next level). I have worked as a C# programmer earlier (So I do have some > coding experience). > > My Question: > > 1. How do I generate the Signals and send them to USB to Parallel > converter.
First off stepper motors are usually two phase motors that are driven in quadrature, meaning 90 deg signals. You will likely need four transistors to drive them in pairs of two. You need to get the data sheet on the specific motor you have plus read some of the references posted by others to arrive at an actual circuit and how to drive it.
> 2. What language do I use. *(I am familiar with C, Can I use C or can I use > C# itself).
You can use any language you are familiar with and can find a compiler for the specific processor you intend to use. Many people work in C.
> 3. Is this want is called Assembly level programming. (or is assembly level > programming used for controlling Microcontrollers only)?
C is NOT assembly language. Assembly language is the lowest level language used in microcontrollers It is specific to the type of processor. Assembly language works one operation at a time and directly controls arithmetic, logic functions, I/O ports and memory access. It is usually easy to learn and become familiar with. Because it works at the lowest level it is more obvious what is going on and easier to trouble shoot especially for a beginner. For this application, you'd likely set up an output register with four bits, A,B,C,D. that drive the driver transistors. Each step is a change of state thus: (1) Ahi, Blo, Clo, Dhi; (2) Ahi, Blo, Chi, Dlo; (3) Alo, Bhi, Chi, Dlo; (4) Alo, Bhi, Clo, Dhi, then repeat. If you look at this, it's two square waves 90 deg out of phase. Each of the four states is one step of the motor's shaft. It's trivial to generate a clock at the required period then change the state of the register in the above pattern for each step. This can be done at any rate up to some maximum specified by the motor. Stopping the pattern holds the motor at that step. The motor is reversed by shifting the A B or the C D pattern by 180 degrees; i,e., inverting it. You can e-mail me at montassocatyahoodotcom. Good luck
> Any help is much appreciated. > > Thanks & Regards > Nick > > > > > > --------------------------------------- > Posted through http://www.Electronics-Related.com >