This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I like SFRA library for its great help optimizing 500kHz current control loop. But I would like also to use SFRA for slow 16Hz temperature-fan loop or ~100-200Hz temperature-TEC loop. Are there any low/high frequency limits in SFRA? I don't see this information in SFRA pdf. Can SFRA work for temperature control, where feedback always drifts up/down because of external factors?
And here's a problem:
I would like to start from 0.1 Hz, since FAN isn't fast thing and FAN PWM is limited to 16Hz. SFRA lib seems generating starting 0.1Hz frequency waveform well, I also clearly see injection response in temperature ADC, doble checked feedback variable and inject/collect calls. But SFRA kind of freezes forever and doesn't advance to next frequencies. Since there's nothing about frequency limits in the SFRA doc, I thought perhaps 0.1Hz is a problem? But I'm using floating point variant, also SFRA injection for 0.1Hz is working! I tried changing starting frequency to 10, 100Hz, almost always it takes ages to advance, in best case it takes few minutes to step to next frequency.
I tried 500kHz injection. It was better, but sometimes it takes ~10s to advance from starting 0.1Hz, and sometimes step takes over minute. I wonder what could cause such long and random delays? Does SFRA need N whole Finjection periods to collect data? Then why N is random? Is it all because temperature background always slowly drifts up/down, which perhaps upsets SFRA measurements and SFRA restarts for current frequency? Could any SFRA status variable reveal what's wrong? I see no explanation for status and state in SFRA pdf.
Moving from 16 to 140Hz loop didn't help, still n random minutes to step.
Thanks,
Edward
Edward,
1. There is no low frequency limit as such, but as SFRA was designed for faster control loops, we have only tested it at 0.5Hz and above.
2. Check systems with 10Hz bandwidth or so should not be a problem, we have to do this for voltage loops in PFC
figure 40
3. Few things you can do to speed up the SFRA execution. do fewer frequency points, i.e. only do 10 -20 points or so
4. Low-frequency sweeps are going to take longer time, sometimes playing slightly with the frequency value can put the SFRA out of a numeral accuracy issue if one frequency is taking significantly longer than the other.
5. Edward, yes if the ISR rate in which SFRA is called is that slow 16-140Hz it is going to take very long, unfortunately currently we do not have a mechanism to let the user tune the speed of SFRA compromising accuracy. I have added it to requirements for a future release when that happens. For now, i do not have a solution for it.
The only thing I can suggest is if you can run it slightly faster? I understand the bandwidth is very low and it does not need to run fast but that will help in the speed of execution.
Also, SFRA GUI freezing could be just SCI comms freezing up after some time. You can look at sfra object freqindex and see if it is incrementing. ?
Hi,
Correction, it's not SFRA data in .ebss, but my SFRA.obj file.
Its interesting, I moved every SFRA related data (magnitude, frequency vectors etc) to RAM addresses < 0x10000, still SFRA is not happy. Moving whole .ebss to < 0x10000 fixes SFRA injection, but placing .ebss again >0x10000 breaks SFRA injection. I've put breakpoint in disassembly window below LCR SFRA_F_INJECT call. DP on return from inject call is 0x634, which is >=18D00 or RAMGS12, which is empty and not used at all. Moving .ebss again below 0x10000 and stopping in same place, DP is now 0x234, which points to internal SFRA_LIb variables like _SFRA_F_preCount etc.
Any idea what else must be provided to not have problems with SFRA library? SFRA pdf instructs only to put SFRA inject and collect routines to RAM for best performance and to put SFRA_F_Data to dataRAM1, which is not explained what it is, must dataRAM1 be placed < 0x10000 or not. In my case SFRA_F_Data is allocated < 0x10000, I also tried putting SFRA_F_INIT , collect and inject also to RAM < 0x10000, it doesn't help. For some weird reason whole .ebss has to sit < 0x10000. Any idea why?
Edit:
SFRA_FTMU_Lib one point time seems being consistent with tested frequency. Each next step takes less time. This is better compared to SFRA_F_Lib. But 100Hz at 500kHz ISR takes about 5-6 seconds. 100 points from 100Hz to 200kHz take about 2.5minutes, which is about 5 times longed than SFRA_F_Lib, which finishes the same 100Hz - 200kHz 100 points in less than 30seconds. Well, if single 100Hz point using SFRA_FTMU_Lib takes 5 seconds, then 0.1Hz would take over an hour. Not good for such slow loops. I'll try it with PWM-TEC loop which is much more faster and I hope it will work. I'll try it later, no HW at the moment.
Thanks
Edward