Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

small step angle stepper motor interface on P18F4580

Status
Not open for further replies.

illkard

Newbie level 2
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top