Stepper Motor

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
Frank G.
Posts: 7
Joined: Thu Jan 05, 2006 2:12 am
Contact:

Stepper Motor

Post by Frank G. »

Hi!

This question pertains to actuator board stepper motor.
Using a switch to go forward and reverse had no problem, controlling speed no problem but unable to single step the 15 degree stepper motor.
Each time I press the botton it will go from 60 degrees to 90 or the full 360. I've tried different things including going single face with no success. What am I doing wrong? or What am I not doing?

Thanks

Frank G.

johndobson
Matrix Staff
Posts: 9
Joined: Wed Jan 25, 2006 12:02 pm
Location: Halifax, England
Contact:

stepper motor

Post by johndobson »

Here is the driving algorithm:
Orange (I/O 3) Yellow (I/O 0) Brown (I/O 1) Black (I/O 2) Input on pins 0-3
(bin, hex, dec)
Step 1 1 0 1 0 1010, 0AH, 10
Step 2 0 1 1 0 0011,03H, 3
Step 3 0 1 0 1 0101, 05H, 5
Step 4 1 0 0 1 1100, 0CH, 12

If you don't follow the sequence exactly then you may miss a step.

My first step would be to check code matches this. Let me know if it does nto work out.

John

Frank G.
Posts: 7
Joined: Thu Jan 05, 2006 2:12 am
Contact:

Post by Frank G. »

Hi!John


Thanks for responding.

Yes the code dos mach.

What I have don is to add delay between each step.

/* step-1_0Ah */
output_highPort_b(0);
delay_ms(500);
output_low_port_b(1);
delay_ms(500);

What happens is that I could see the steps going through the complete cycle of code. 0A,03,05, and 0C. ( 60 degrees)

But what I wan is to single step 15 degrees at a time.

I even tryed adding more delay just to see the same thing.

I tryed stepping one and two steps, it seem to want to work, but then locks up.

I have a worksheet that came with the board, that has an exercises to
do that very thing. Well I'm trying.

Thanks

Frank G.

johndobson
Matrix Staff
Posts: 9
Joined: Wed Jan 25, 2006 12:02 pm
Location: Halifax, England
Contact:

stepper

Post by johndobson »

Hae you got LEDs on port B to make sure what you think is being produced is actually produced?

Are you in Low Voltage Mode? if so B3 is often disabled so all bets are off.

John

Post Reply