View Single Post
  #35   Spotlight this post!  
Unread 20-05-2009, 08:39
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Failed attempt to explain JAG linearity

Nice App! I'll take you to Strange Brew - much better beer than Milly's.

In my mind, there were two possible reasons for all of this:
1) Longer periods widen the gap between mean current and rms current.
2) Longer periods force the inductor to "run dry". The "dry" period affects the effective duty cycle.

My interpretation of your app supports #2, but not #1.

I just ran the simulation at 1kHz. I think this frequency shows the problem most clearly. You can clearly see ramp up, ramp down, and dwell. As you dither around that frequency, the ratio between those three sections does not remain constant. This means that the effective duty cycle is chop-frequency dependent.

These results match perfectly with text-book buck regulator design principles. And really, what is an H-bridge other than a buck-boost regulator arguing with itself? I'm convinced that I could teach my students without any (ok, much ) hand waving. I still think it would be a great topic for a white paper.

For LabVIEW-less Al -
His code wraps the following in a code block. You can stick it into language-of-your-choice.
Spoiler for code:

Code:
//Hbridge simulation... one side only
//Input duty cycle duty
//Output motor back emf  v_emf
//Parameters

L=L/1000000. ;//convert uh to henrys
tau = L/R;
dt = T/100; // set 100 steps per pwm period
tau_motor =1/( kt*ke/R/Izz);  // time constant of loaded motor
c_motor = ke*kt/Izz;

   if(t==0) avg_current = 0;

// Begin integration of current and motor voltage

    T_cycle = t - T_start;
     // compute on cycle current
     if(T_cycle <= T*duty) 
     {
          v_drive = 12 ;
          current_rate = (v_drive - v_emf - current*R)/L ;//ON phase current rate
          
      } 
     else 
      {
           v_drive = 0;
           current_rate = (v_drive - v_emf - v_diode -current*R)/L;//OFF phase current rate
          
      }
        
           if(v_emf>0)  { v_emf_rate =c_motor*(current - i_free);}
           else 
              { v_emf_rate = c_motor*(current+i_free); }
        
    cum_current = cum_current + current*dt;
        
   if(T_cycle>=T)   { T_start = t; 
     avg_current = cum_current /T ;
     cum_current = 0;}
   
     current = current + current_rate*dt;
     if(v_drive == 0 && current<0) current = 0;
     v_emf  = v_emf + v_emf_rate*dt;
     t  = t + dt;
   
    if(pre_init == 1 && (abs(1-avg_current/i_free)<.005)) pre_init = 0;  //Done with preinit 
    v_emf_norm = v_emf/12;
Attached Thumbnails
Click image for larger version

Name:	1kHz.JPG
Views:	40
Size:	51.2 KB
ID:	7969