small step angle stepper motor interface on P18F4580

Status
Not open for further replies.

illkard

Newbie level 2
Joined
Jul 21, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
13
Hi all, I'm trying to interface my pic with a stepper motor (step angle=0.1125(half step) <--that's how thy write it on the datasheet; rpm ranging form 20rpm to 150rpm). But, my problem is that I cant seems to control the speed of the motor. i've tried using both full step and half step, in the case of half step, the motor rotate very slowly. any idea on how do i interface my pic with the stepper motor so that i can control the speed?
 

The stepper motor makes a full step or partial step based on the pulse waveforms you are sending to it. How are you generating the pulses? If the pulses being sent are very slow -> slow motor rotation.
How many phases does the stepper motor have? They all must be pulsed in the proper order
 

Currently I'm generating half step pulse via the following code. The motor has 2 phase/bipolar motor and it has 1:8 gear ratio.

Code:
void msdelay(unsigned char mil)
{
	unsigned char c,d;
	for(c=0;c<mil;c++)
		for(d=0;d<165;d++);
}

void motctrl(void)
{
	unsigned char e;
	for(e=0;e<33500;e++)
	{
		PORTD=0x09;
		msdelay(500);
		PORTD=0x08;
		msdelay(500);
		PORTD=0x0C;
		msdelay(500);
		PORTD=0x04;
		msdelay(500);
		PORTD=0x06;
		msdelay(500);
		PORTD=0x02;
		msdelay(500);
		PORTD=0x03;
		msdelay(500);
		PORTD=0x01;
		msdelay(500);
	}
}
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…