Hi,dumitru-daniel.popa
I made some further changes to the model modified by Leon Thürnau to make it work with KV4. I removed the Simulink Data Type Conversion module for multiplication. However, it has problems in the motor model. From the waveform point of view, the measured currents of phase A, phase B and phase C are correct. I do not know why the speed and back EMF of the motor are always zero, and I can not find the reason. I have attached my model. I hope you can help me, thank you!
Hello dumitru-daniel.popa
like you have shown in module 5 I want to measure the voltages directly with an oscilloscope:
For me it was only possible to get this (Motor is not connected):
A - Terminal Phase A, GND
B - Terminal Phase B, GND
M - A-B (Math Operation)
So the line voltage A-B does not have the same trend as yours.
Mine is only positive or negative because the PWM signals are centered and not shiftet like you signals.
It doesn't madder if I'm using the "eFlexPWM_Three_Phase_Output", three single "eFlexPWM_Complementary_Output" or the "FTM_Three_Phase_Output" block...
With Freemaster I could see this signals, which are fine.
So it has to depend on the PWM block ? Are there any differences between S32K and KV4x ?
Best regards
Leon
Hi Leon,
The commands looks OK. It seems like you are using Center Aligned PWM strategy while on S32K i used edge aligned PWM.
For the KV4 toolbox you can select edge aligned only on Independent output block.
Anyhow that should not be an issue during the operation.
Best regards,
Daniel
Hello dumitru-daniel.popa
I want to make my last post here, so you can find it better in the middle of all the other posts.
I'm now able to download the code to the target and checked the variables in freemaster (only in polling mode) like you did in module 5 !
The download works anytime successful but it only runs if the Driver Subsystem FNB41560 is commented out.
So the ADC communication makes anything wrong.
Do you see the mistake in the subsystem ?
FNB41560:
ADC Samples:
Also this question is still relevant for me:
For example I want to stop the PWM if temperature is higher than 100°C.
By the way: What is your temperature recommendation for shutting down ?
Best regards and allways thank you for so much help ! You are a great teacher !
Leon
Okay I solved the Problem by myself.
I remembered a few weeks ago and now I used priorities for the blocks to change the execution order.
ADC_Config (priority 1)
ADC StartA (priority 1)
ADC StartB (priority 1)
ADC Samples (priority 2)
I think the Problem was that the ADC Read block was executed before the ADC Start, Sample and Config blocks ?
This blocks always has to be executed before the ADC Read ?
So only this question is actual relevant:
For example I want to stop the PWM if temperature is higher than 100°C.
By the way: What is your temperature recommendation for shutting down ?
Best regards
Leon
Hi Leon,
In general you do not stop the motor if the temperature exceeds a certain limit - you just throttle it down by reducing the current until the temperature decreases.
I'm not sure what temperature we are taking about there ? The temperature of the motor should be given by the manufacturer.
If you have a motor with neodymium PM than i would not go over 80 deg C.
Best regards,
Daniel
Hello dumitru-daniel.popa
I think this is the temperature sensing to protect the 3-ph Driver ??
So I wanted to stop the PWM Generation directly to stop the current flow and avoid an overheating of the driver.
And I don't know the temperature limit of the Driver NXP has used for the HVP-MC3PH platform ?
Best regards
Leon
Hi Leon,
I can't answer to that question since i have not found any references. Just play on the save side first and start with something like 65 deg C.
Alternatively you could search for the IGBT recommended temperature.
Best regards,
Daniel
Hi Daniel,
In the data sheet I found some information
http://www.mouser.com/ds/2/149/FNB41560-484544.pdf
The "Total System" should be the complete Motion SPM FNB41560 Driver, so as absolut limit I would suggest 125°C.
Best regards
Leon
Hi wangxuan dumitru-daniel.popa
I'm now able to generate code for the embedded Hardware.
But during the build operation I got 6 warnings from the IAR Linker because of the blocks used in the Slow or Fast_Loop_Subsystem
Is that any Problem and how could I solve this ?
IAR ELF Linker V8.20.1.14183/W32 for ARM
Copyright 2007-2017 IAR Systems AB.
Warning[Lt009]: Inconsistent wchar_t size
GFLIB_Cos.o(CM4_MMCLIB_IAR.a) and 4 other objects have wchar_t size
16 bits
V_f_Scalar_Control_KV4x.o and 42 other objects, some of them in
dl7M_tln.a and 10 other libraries have wchar_t size 32
bits
Warning[Lt049]: Potential floating point parameter passing conflict. The first
module below references the second and they have been built with
different settings.
AAPCS, VFP variant: V_f_Scalar_Control_KV4x.o
AAPCS, base variant: GFLIB_Ramp.o(CM4_MMCLIB_IAR.a)
Warning[Lt049]: Potential floating point parameter passing conflict. The first
module below references the second and they have been built with
different settings.
AAPCS, VFP variant: V_f_Scalar_Control_KV4x.o
AAPCS, base variant: GFLIB_Sin.o(CM4_MMCLIB_IAR.a)
Warning[Lt049]: Potential floating point parameter passing conflict. The first
module below references the second and they have been built with
different settings.
AAPCS, VFP variant: V_f_Scalar_Control_KV4x.o
AAPCS, base variant: GFLIB_Cos.o(CM4_MMCLIB_IAR.a)
Warning[Lt049]: Potential floating point parameter passing conflict. The first
module below references the second and they have been built with
different settings.
AAPCS, VFP variant: V_f_Scalar_Control_KV4x.o
AAPCS, base variant: GMCLIB_ParkInv.o(CM4_MMCLIB_IAR.a)
Warning[Lt049]: Potential floating point parameter passing conflict. The first
module below references the second and they have been built with
different settings.
AAPCS, VFP variant: V_f_Scalar_Control_KV4x.o
AAPCS, base variant: GMCLIB_SvmStd.o(CM4_MMCLIB_IAR.a)
13 794 bytes of readonly code memory
696 bytes of readonly data memory
14 573 bytes of readwrite data memory
Errors: none
Warnings: 6
Link time: 0.09 (CPU) 0.11 (elapsed)
Created executable: V_f_Scalar_Control_KV4x.elf
Best regards
Leon
Hi wangxuan
good Job, we are getting closer ! Again I have attached my model.
I've seen your / mine / our modified model and think we could use the data type conversation in the Slow Loop Control Subsystem like shown below:
Then the Speed_Reference (yellow line in COMMANDS) is exactly the same like in module 5 s32k example.
Your implemented gains in the Fast Loop Control Subsystem
Now I was able to simulate correctly. Here are the results:
Like you see the COMMANDS and SVM are completely the same like in s32k module 5.
(U_Alpha and U_Beta are still upscaled)
But in EFFECTS we have some differences, the Motor Speed swings extremely:
I have made some Simulation runs (blue --> wc = 0.001; yellow --> wc = 1; red --> original pmsm module5)
How we could get the same result as in the pmsm Workshop module5 (red line) ?
After this step is done we could parametrize our own Motor with the values of R,L and so on.
Another way could be to use the Simscape Power Systems Toolbox instead of the Simulink PMSM model.
Also the Parameters of the LUT in the Slow Loop Control Subsystem I didn't have parametrized yet.
If this is done I want to download the code to the target and see the results in FreeMASTER.
Best regards
Hi Leon Thürnau,dumitru-daniel.popa
Good job! I got the same result as yours, I found that the back EMF we got was very large at the beginning, and the speed oscillations were obvious at this time. I think the problem lies in this (I do not know if I am correct), because rightly, our speed should be small at the outset, So the back-EMF should also be small, I think it should be caused by motor parameters do not match. The bus voltage we needed was 27 times larger, resulting in a large input phase voltage (about 150 times larger). I modified it according to the PMSM motor parameters in Table 1 and the current reached 300A (which seems to be wrong ), The following is the result I got. It seems that the speed oscillation problem appears to be getting better, but the phase current waveform changes greatly compared with the original one. In contrast, because the back EMF phase and the phase voltage phase are offset, Becomes no longer symmetrical. What do you think and correct? Thank you!
motor model | 60ST-M01330 |
Rated power (W) | 400 |
Rated line voltage(V) | 220 |
Rated line current(A) | 2.8 |
Rated speed(rpm) | 3000 |
Rated torque(N.m) | 1.27 |
Peak torque(N.m) | 3.8 |
Back EMF(V/krpm) | 28 |
Torque coefficient(N.m/A) | 0.5 |
Rotor inertia(Kg.m2) | 0.302×10-4 |
Winding (Line) Resistance (Ω) | 5.83 |
Winding (Line) Inductance (mH) | 12.23 |
Electrical time constant (ms) | 2.1 |
Best regards,
wang xuan
Hi,
with Udc = 12V in FNB41560 Subsystem and wc = 1 in PMSM model I got the same results like in module5 example.
So in General the Problem is the higher bus voltage and another Motor.
I will try to parametrize my Motor and see what happens.
Best regards
Hi Wang Xuan,
I have 2 concerns about your results:
#1: Speed goes down in the beginning: possible culprit: friction constant B and/or J
#2: You have huge currents in the motor: possible culprit: R and/or KV
Best regards,
Daniel
I've looked a bit over the model. I think is an issue related with MATLAB solvers for diff. equations. It looks like you changed the simulation parameters. Mine is using:
Anyhow, you could try to modify the wc initial condition.
You should be able to start see speed & back-emf. If you need further details about the motor - then you can check this one: Dynamic Simulation of Electrical Machines and Drive Systems Using MATLAB GUI | InTechOpen
Hope it helps!
Daniel
I don't have your advanced Parameters in the second Screen:
How could I activate them ?
Hi Leon,
That depends on MATLAB version you are using. Using an older version might not show them at all. Anyhow - i noticed that some of the parameters can only be found in the "All Parameters" Tab. Try to search it there.
Best regards,
Daniel
Hi Daniel,
no I'm sorry..
Also in the "All Parameters" tab there are only the Options for "Signals", "Parameters" and "Data Store Memory block" but not your "Advanced Parameters".
Best regards
Leon