Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

[SOLVED] Bipolar stepper motor drive

Status
Not open for further replies.

kanni1303

Full Member level 3
Joined
Jun 29, 2012
Messages
161
Helped
12
Reputation
24
Reaction score
11
Trophy points
1,298
Location
Chennai, Tamil Nadu, India
Activity points
2,679
I am using 293d for bipolar stepper motor drive and it is not working why i dont know... the coding i used is
Code:
PORTB=0x05;
DelayMs(50);
PORTB=0x09;
DelayMs(50);
PORTB=0x0A;
DelayMs(50);
PORTB=0x06;
DelayMs(50);
i tried by changing delay but no use...
i found the winding and formulated as per the winding but still not wrkng... it steps for few steps and stops there but not rotating i dont know what is the mistake...
 

kanni1303

Full Member level 3
Joined
Jun 29, 2012
Messages
161
Helped
12
Reputation
24
Reaction score
11
Trophy points
1,298
Location
Chennai, Tamil Nadu, India
Activity points
2,679
And this is the diagram i used... i dont know what is the reason behind the problem... but it is not rotating... but i hear the sound in the motor... supply i used is 12V battery with 7812 regulator and for Microcontroller 9V battery... and my code is...
Code:
#include<htc.h>
int _XTAL_FREQ=12000000;

int i;
void forv();
void rev();
void reva();
void fora();

void DelayMs(unsigned char delay)
{
unsigned int j;
for(i=0;i<=delay;i++)
{
for(j=0;j<=1000;j++);
}
}

void port_initialize()
{
TRISB=0X00;
PORTB=0x00;
TRISC=0xFF;

#define a RC0
#define b RC1
#define c RC2
#define d RC3

}

void main()

{
port_initialize();
while(1)
{
 if(a>0x00)
 { 
  forv();
 }
 if(b>0x00)
 {
  rev();
 }
 if(c>0x00)
 {
  reva();
 }
 if(d>0x00)
 {
  hfora();
 }
}
}

void forv()
{
PORTB=0x05;
DelayMs(50);
PORTB=0x09;
DelayMs(50);
PORTB=0x0A;
DelayMs(50);
PORTB=0x06;
DelayMs(50);
}

void rev()
{

PORTB=0x08;
DelayMs(100);
PORTB=0x09;
DelayMs(100);
PORTB=0x01;
DelayMs(100);
PORTB=0x03;
DelayMs(100);
PORTB=0x02;
DelayMs(100);
PORTB=0x06;
DelayMs(100);
PORTB=0x04;
DelayMs(100);
PORTB=0x0C;
DelayMs(100);
}
void reva()
{
PORTB=0x05;
DelayMs(150);
PORTB=0x09;
DelayMs(150);
PORTB=0x0A;
DelayMs(150);
PORTB=0x06;
DelayMs(150);
}
void fora()
{
PORTB=0x05;
DelayMs(200);
PORTB=0x09;
DelayMs(200);
PORTB=0x0A;
DelayMs(200);
PORTB=0x06;
DelayMs(200);
}
i am first trying to rotate in forward direction for that i used different delay and made this... my motor winding are Yellow Orange Brown and Black among which Yellow and Orange are one winding and Black and Brown are another winding.. pls help me...
Screenshot (111).png
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top