LMD18200 Pin8 Sensing

Status
Not open for further replies.

AmadeusCosimo

Newbie level 1
Joined
Jul 29, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
14
Hej,
i am using a H Bridge (LMD18200) for controlling a DC Motor. Therefore i am using the Pin8 Current Sensing Output and a simple PI-controller. My problem is that i just can measure the abs value of the motor current, if i get the datasheet right. Does anyone know how to get the real signum of the current?

I tried to just take the signum of the desired current which i apply to the motor controller, but when i am using a sinusoidal input i get problems at the zero crossing.

My controller code at the moment looks like this (i am using matlab/simulink and a dspace box CP1103)

Code:
Dir_x ... direction bit for H-Bridge
UMx....Voltage for DC motor which is later on converted into a PWM Signal (0..1) -> (0..12)V
e1I.... Error for integral value of PI Controller
reset...to reset the controller errors when starting the simulation/measurement
AntiWindUp....freeze the integral value when reaching the maximum voltage
IMx_d...desired current
IMx....measured current
par...parameter-file
function [UMx,Dir_X]  = PICurrentControl(resetI,IMx_d,IMx,AntiWind,par)
persistent e1I
if isempty(e1I)
e1I=0;
end

persistent e1
if isempty(e1)
e1=0;
end

persistent Ux
if isempty(Ux)
Ux=0;
end

if (resetI)
e1I=0;
end


%Calculate Control Deviation 
e1=abs(IMx_d)-abs(IMx);

%1..AntiWindup on, 0..of

if(AntiWind)
    if (Ux < 12 && Ux > -12)
        e1I=e1I+0.01*e1;
    else
        e1I=e1I;
    end

else
    e1I=e1I+0.01*e1;
end

if(IMx_d == 0)
    Ux = 0;
    e1I = 0;
else
Ux = par(1)*e1 + par(2)*e1I;
end

UMx = abs(Ux);

if (sign(IMx_d) >=0)
     Dir_X = false;
else Dir_X = true;
end


My strategie know was to control the abs value of the error (IMx_d-IMx) and take the signum of the desired current as the direction bit of the H-Bridge. Furthermore i just set the output voltage as zero when the desired current is zero. But this step results in problems.
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…