Informazioni su uscita PWM moduli SlimLine Cortex
Home › Forum › Controllori SlimLine e Netsyst (LogicLab) › Informazioni su uscita PWM moduli SlimLine Cortex
- Questo topic ha 4 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 3 anni, 2 mesi fa da
Sergio Bertana.
-
AutorePost
-
Ottobre 15, 2020 alle 3:49 pm #57934
Sergio Bertana
Amministratore del forumIl generatore PWM è una parte hardware del controllore quindi ecco perchè questo topic si riferisce al comportamento delle 2 uscite PWM gestibili dai soli moduli CPU basati su processore Cortex M7. Nelle caratteristiche di questi moduli è riportata l’indicazione FMin 5Hz, FMax 2kHz.
Questo significa che l’uscita può operare in un campo di frequenza compreso tra 5Hz e 2kHz ma occorre focalizzare l’attenzione sulla impostazione del duty cycle. La configurazione hardware del PWM permette l’impostazione del valore con differenti ranges in funzione della frequenza di uscita impostata (Vedi il blocco funzione SysSetPWMOut). Ecco la tabella:
+------------------+----------+----------+-------------+------------------+ | Frequenza uscita | Duty Min | Duty Max | Risoluzione | Possibili valori | +------------------+----------+----------+-------------+------------------+ | Fino a 30 Hz | 0.01 % | 99.99 % | 0.01 % | 10000 | +------------------+----------+----------+-------------+------------------+ | Fino a 300 Hz | 0.1 % | 99.9 % | 0.1 % | 1000 | +------------------+----------+----------+-------------+------------------+ | Fino a 3000 Hz | 1 % | 99 % | 1 % | 100 | +------------------+----------+----------+-------------+------------------+
Come si vede dalla tabella se la frequenza di uscita è inferiore a 30 Hz è possibile variare il valore del duty cycle con una risoluzione di 0.01%, avendo quindi 10000 possibili valori. Oltre i 30Hz e fino a 300Hz è possibile variare il valore con una risoluzione di 0.1%, avendo quindi 1000 possibili valori. Oltre i 300Hz e fino a 1000Hz è possibile variare il valore con una risoluzione di 1%, avendo quindi 100 possibili valori.
Anche se la caratteristica di uscita del PWM limita la frequenza massima a 2kHz, in realtà l’hardware del PWM out può arrivare oltre (Infatti nella tabella riportiamo 3kHz come dato masssimo), la limitazione è data dal circuito di uscita del modulo che non è in grado di gestire frequenza così alte.
Nota: superando il valore di 1kHz non si è in grado di gestire la linearità sulla impostazione del valore di duty cycle. Come si vede da questa rilevazione oscillografica con un carico da 1KOhm sull’uscita di un modulo MPS054, alla frequenza di 2,5Khz con un duty cycle impostato al 78 % si ha in realtà un segnale in uscita che ha duty cycle al 50%.
Quindi ipotizzando che si stesse operando a 20Hz con un duty cycle impostato a 50.35% salendo a 200Hz il valore del duty cycle reale diventerà pari a 50.3%. Così a 500Hz il valore del duty cycle reale diventerà pari a 50%.
Gennaio 24, 2022 alle 8:51 am #63405George
PartecipanteI want to use the PWM output on a MPS054, but i measured an asymmetry on the Ton / Toff at 50 % duty cycle. At frequency 400 hz i measured Ton: 1.183ms and Toff : 1.318 ms. After adding an offset of 3.0 % to 50 % the asymmetry is compensated.
The problem (when the device is cold) is that after power up i measure Ton:1.280 ms, Ton:1.220 ms and only after 20 – 25 minutes the compensation becomes active. Drifts slowly to Ton:1.253ms, Toff:1.247ms. Could be a device hardware drift?
Looks like there is need to warmup for the first power up.
Gennaio 24, 2022 alle 9:01 am #63408Sergio Bertana
Amministratore del forumAs output device for the PWM we use a PhotoMOS (Model AQY221R4V from Panasonic) as you can see from the datasheet the TOn and TOff characteristics change according the ambient temperature. Consider also that this times change also by device to device.
So if you need a very precise duty cycle you must characterize every device to measure the real Ton and TOff times at the working temperature and then compensate then by acting on the Duty parameter.
Gennaio 27, 2022 alle 8:44 am #63570George
PartecipanteThank you for your answer.
My problem is not to characterize the device and to find the correction offset (I already found it), but that of the settling time needed (from asymmetric Ton/Toff to symmetric, about 25 .. 30 minutes) from the machine startup every morning to operate. Is there a workaround on this issue?
How affects the load current of the PWM output the operating conditions?
Maybe light load current better for rise time, but not good for temperature drift?
Gennaio 27, 2022 alle 9:02 am #63581Sergio Bertana
Amministratore del forumUnfortunately as you can see from the datasheet the TOn and TOff times changes according the temperature. So if you want correct them the only way is to change the duty cycle according temperature.
It seems strange to me but on the datasheet there’s not any indication about times drifting vs output current.
My considerations are:
- If you need a extremely precise PWM output you have to bypass the OptoMOS and use directly the processor pin, but this invalid the warranty.
- Otherwise you can connect a I2C PWM generator board on the extension bus and manage it wit the SysI2CWrRd function. On the market exist boards based on the PCA9685 or similar.
-
AutorePost
- Devi essere connesso per rispondere a questo topic.