Forum: Mikrocontroller und Digitale Elektronik dsPIC33F - current limit Frequenzänderung


von nam (Gast)


Lesenswert?

Hallo,

Ich habe folgendes Problem mit dem dsPIC33FJ16GS504:
Halbbrücke, Buckconverter. Schaltfrequenz ist fix auf 200kHz, duty cycle 
per PTPER auf ca. 60 % (viel höher, als was ich benötige). Der Strom 
wird jeden Cycle gemessen und kürzt den duty cycle sobald eine 
Komparatorschwelle überschritten ist. (current limit mode)

Grundlegend für die Schaltung ist, dass der Strom geregelt werden soll.
Dafür variiere ich die Schwellspannung des Komparator.

Nun zum Fehler: Bei niedrigen Strömen, also niedriger Schwellspannung, 
fällt die Schaltfrequenz auf exakt die vorgegebene Hälfte von 100kHz.
Kann mir jemand sagen, wieso? Ist irgendeine Einstellung daran Schuld? 
Bei der Regelung über den Dutycycle durch PDC1 passiert das nicht.

Die Regelung MUSS aber über den Current limit geschehen, weil ich sehr 
schnell von 0 au 30A schalten muss und somit der duty cycle kurzzeitig 
lang sein muss, damit der Strom schnell ansteigen kann.

Vielen Dank im Voraus!


ACLKCONbits.ASRCSEL = 1; /* Primary Oscillator is the Clock Source */
    ACLKCONbits.FRCSEL = 0; /* Input clock source is determined by
    ASRCSEL bit setting */
    ACLKCONbits.SELACLK = 1; /* Auxiliary Oscillator provides the clock
    source */
    ACLKCONbits.APSTSCLR = 7; /* Divide Auxiliary clock by 1 */
    ACLKCONbits.ENAPLL = 1; /* Enable Auxiliary PLL */
    while(ACLKCONbits.APLLCK != 1); /* Wait for Auxiliary PLL to Lock */


  PTCONbits.PTEN = 0; //PWM Module disabled
  PTCON2bits.PCLKDIV = 0b000; //Prescaler 1


  //// Dead-Time
  PWMCON1bits.DTC = 0b00;
  DTR1 = 150; //Totzeit beim Beginn des "Left Legs"-Überganngs [Weak 
Leg]
  ALTDTR1 = 120; //Totzeit beim Ende des "Left Legs"-Überganngs [Weak 
Leg]

  PWMCON1bits.FLTIEN = 0;     // Fault interrupt disabled and FLTSTAT 
cleared
  PWMCON1bits.CLIEN = 0; //Current limit interrupt disabled
  PWMCON1bits.ITB = 0; //PTPER/STPER registers provide timing for this 
PWM generator
  PWMCON1bits.MDCS = 0; //PDC1 register provides duty cycle for PWM1
  PWMCON1bits.XPRES = 0; //External pins do not affect the PWM time base
  PWMCON1bits.IUE = 0; //TODO eventuell auf 1 ändern

  IOCON1bits.PENH = 1; //PWM module controls PWM1H pin
  IOCON1bits.PENL = 1; //PWM module controls PWM1L pin
  IOCON1bits.POLH = 0; //PWM1H Output Pin Polarity is active-high
  IOCON1bits.POLL = 0; //PWM1H Output Pin Polarity is active-high
  IOCON1bits.PMOD = 0b00; //PWM1 Complementary PWM Output mode
  IOCON1bits.SWAP = 0; //Don't swap PWM high and low pin
  IOCON1bits.OVRDAT = 0; // State for PWMxH and PWMxL Pins is low if 
Override is Enabled

  PTPER = 5231;
  PDC1 = 3000;

  FCLCON1bits.IFLTMOD = 0; //Normal fault mode
  FCLCON1bits.CLSRC = 0; //Current limit signal is "Reserved"
  FCLCON1bits.CLPOL = 0; //Current limit signal is active high
  FCLCON1bits.CLMOD = 1; //Current limit mode is enabled
  IOCON1bits.CLDAT1 = 0;
  IOCON1bits.CLDAT0 = 1;

  FCLCON1bits.FLTSRC = 1; //Fault input signal is "Reserved"
  FCLCON1bits.FLTPOL = 0; //Fault input is signal is active high
  FCLCON1bits.FLTMOD = 0; //Fault mode is enabled
  IOCON1bits.FLTDAT1 = 0;
  IOCON1bits.FLTDAT0 = 1;

  TRGCON1bits.TRGDIV = 0;
  PWMCON1bits.TRGIEN = 0;  //Trigger interrupt is not pending
  //while (PWMCON1bits.TRGSTAT!= 1);

  __builtin_write_OSCCONL(OSCCON & ~(1<<6));
  RPOR16bits.RP32R = 0b100111; // Comparator 1 auf virtuellen Pin 32.
  RPINR29bits.FLT1R = 32; // Input für Fault1 ist virtueller Pin 32
  __builtin_write_OSCCONL(OSCCON | (1<<6));

  PTCONbits.PTEN = 1; //PWM Module enabled.

von Stampede (Gast)


Lesenswert?

Hallo,

verstehe das nicht so genau. PDC1 regelt den Duty Cycle, PTPER die 
Periode.
Oder willst du einen Constant On Time Regler bauen?

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.