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.

servo motor controller using 8051

Status
Not open for further replies.

jayanthyk192

Full Member level 3
Joined
Sep 17, 2010
Messages
179
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,580
Hi,

i just built a servo motor controller using an 8051.the program did its job(PWM),but the problem is in the motor.at some positions the motor keeps vibrating and does not stop.it gets locked in position but it vibrates.this happens for only some positions.the code does not have a problem because i checked the output with an LED,and it worked fine(dim and high).please help me debug.

thank you.
 

yes Mr. Ckshivaram thats right, we can test it on proteus and debug it.
so we can know our schematic is right or not when we debug it.
 

test it in proteus and then debug. or put your code and circuit here.......

i dont have proteus.so,here's the really simple code:
Code:
#include<reg51.h>
#define out P2
sbit up=P1^0;
sbit down=P1^1;

void delay(int x)
for(i=0;i<=x;i++);

main()
{
int on=100,off=100
  while(1)
   {
    if(up==1 && on<=200){on++;off--}
    if(down==1 && on>=0){on--;off++}
    out=0;
    delay(on)
    out=255;
    delay(off)
    }
}

i wrote the code without using 'timers',as i'm not too familiar with them.so please ignore efficiency for now.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top