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

L6203 DC MOTOR CONTROL PROBLEM

Status
Not open for further replies.

atom06

Newbie level 3
Joined
May 2, 2006
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
l6203 dc motor

Hi,

I want to control a 4A DC motor in a bidirectional way with PIC16F877A however,I do not figure out the input pins 5,7 and 11.In some net sites it is stated that input for pin5 and pin 7 must be pwm, however, the square wave for these pins should be inverted form.(see that attachment) In datasheet, I can not see this explanation.
I wrote following program however,it does not work.

The PWM inversion can be done by following schematic however, I do not want to use logic gates.


-------------------------------------------------------------------
#include <16F877.h>
#include <math.h>
#FUSES NOWDT,NOWRT,NOPUT,NOBROWNOUT,NOLVP,NODEBUG
//#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPROTECT //Code not protected from reading
//#FUSES NOCPD //No EE protection
#use delay(clock=20000000)
#use rs232(baud=57600,parity=N,xmit=PIN_C6,rcv=PIN_C7)


byte input[3];
int i;

void main()

{
while(true)
{


for(i=0;i<3;i++)
{
input=getc();
}



setup_ccp1(CCP_PWM);
setup_timer_2(T2_DIV_BY_16, input[2], 1);




if (input[0]==1)
{
set_pwm1_duty(input[1]);
output_low(PIN_D2);
output_high(PIN_C4);



}
else if (input[0]==0)
{
set_pwm1_duty(input[1]);
output_high(PIN_D2);
output_LOW(PIN_C4);


}


}

}

------------------------------------------------------------------------

The PWM inversion can be done by following schematic however, I do not want to use logic gates.
 

laktronics

Banned
Joined
Jan 6, 2007
Messages
943
Helped
176
Reputation
352
Reaction score
18
Trophy points
1,298
Activity points
0
l6203

Hi,
I think you can control the motor either way. In the data sheet, you drive one input with PWM, keeping the other input at zero and when you want to reverse, the input signals are simply reversed just by changing the direction control signal level; all the time keeping enable high. You can simulate this condition by using two PWM outputs ( a costly alternative) of the micro, keeping one of them at zero state at a time, or use an equivalent logic shown in the data sheet.

In the case of Data sheet circuit, you get full range of PWM for speed control. In the case of the approach shown at the sites, by applying an inverted PWM to one of the inputs, you are driving the motor in push-pull mode and the direction is changed at 50% duty cycle of the PWM, no need to have a separate bit for direction control, but your range of control is reduced to half.

Regards,
Laktronics
 

Ngel

Junior Member level 1
Joined
Mar 18, 2008
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,394
l6203 pwm

Hm, i got an problam that i use a battery mcu dc motor and L6203, when i start the motors the mcu restarts it because that the high current that the motor need and doint a power down on the mcu.
check out that you use two diffrent supply for motor and another for mcu, or just use a big battery.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top