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.

please help help me dc motor speed control

Status
Not open for further replies.

mossab hammad

Newbie level 4
Joined
Feb 28, 2010
Messages
6
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
sudan
Activity points
1,324
i wont to change this project to close loop
i use resistance and feedback shaft encoder sensor
i wont change in code in mikroc
code
unsigned long kp,speed=0,speed1=0,old=0;
char speed2,kp,x=1;
char key[]={'x','x',3,2,1,'x',6,5,4,'x',9,8,7,'x',10,0,11},txt[10];
void main()
{
trisc=0;
Pwm_Init(5000);
delay_ms(20);
Keypad_Init(&PORTB);
delay_ms(20);
Lcd_Init(&PORTD);
delay_ms(20);
Lcd_Cmd(LCD_CURSOR_OFF);
Lcd_Cmd(LCD_CLEAR);
lcd_out(1,1,"SUST university" ) ;
lcd_out(2,1,"Electrical department" ) ;
delay_ms(3000);
Lcd_Cmd(LCD_CLEAR);
lcd_out(1,1,"Designed for:" ) ;
lcd_out(2,5,"Musaab hamad" ) ;
delay_ms(5000);
Lcd_Cmd(LCD_CLEAR);
Pwm_Start();
Pwm_Change_Duty(0);
delay_ms(20);
while(1)
{
while( !(kp = Keypad_Read())) {}

kp=key[kp];
speed=0;
x=1;

while(1)
{
if(kp==10)
{
old=speed1;
speed1=speed;
break;
}
if(kp==11)
{
speed1=old;
break;
}
speed=speed*10+kp ;
lcd_chr(1,x,kp+48);
delay_ms(40);
while( !(kp = Keypad_Read())) {}
kp=key[kp];
x++;

delay_ms(40);

}
if(speed1<=1000)
{
Lcd_Cmd(LCD_CLEAR);
lcd_out(2,1,"speed=" ) ;
inttostr(speed1,txt) ;
lcd_out_cp(txt) ;
speed2=(speed1*255)/1000;
Pwm_Change_Duty(speed2);
delay_ms(40);}

}


}
 

plz i need help in my project i change this to close loop
i need change in code and diagram
or point help me in this
very soon plz
thans
 

thanks
but i use keypad to enter the speed look to circuit
and use shift encoder sensor to feedback
i need change in code and circuit
thans to your help
 

if you r going to use micro-controller, (it would be advisable) use the pulse width modulation technique
 

thanks
i use pwm in my project
i build my project open loop but i can not build close loop
plz help me to build it close loop (code , diagram)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top