s32k144 pmsm closed loop model based design

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k144 pmsm closed loop model based design

Jump to solution
2,312 Views
Sriram
Contributor IV

Hello , 

I am building a pmsm foc prototype and i have a doubt regarding the adc triggering . i am trying to interface sensors to the s32k mcu by connecting it to adcs. about 8 sensors need to be interfaced . my question is will be adc be triggered only when the motor in the dev kit is running or is there some other way i can interface the sensors and use the code to run my pmsm motor . 

Thank you

0 Kudos
1 Solution
2,259 Views
adriantudor
NXP Employee
NXP Employee

Hi Sriram,

Here is the PMSM closed loop example with ADC potentiometer measurement added to ADC reads. All ADC's are read continuously so you can add other ADC readings in PDB_0 or PDB_1. You can add the "ADC_POT" variable in the FreeMaster project to see live updates even if the motor is not running.

 

Best regards,

Adrian

 

 

View solution in original post

8 Replies
2,260 Views
adriantudor
NXP Employee
NXP Employee

Hi Sriram,

Here is the PMSM closed loop example with ADC potentiometer measurement added to ADC reads. All ADC's are read continuously so you can add other ADC readings in PDB_0 or PDB_1. You can add the "ADC_POT" variable in the FreeMaster project to see live updates even if the motor is not running.

 

Best regards,

Adrian

 

 

2,225 Views
Sriram
Contributor IV

@adriantudor  a small doubt regarding the model , my end goal is to run a pmsm prototype using the code generated from the model . Will this model be able to run the motor or is there any change i should do for the pwm pdb synchronisation.

 

Thank you fr ur help

0 Kudos
2,221 Views
adriantudor
NXP Employee
NXP Employee

Hi Sriram,

The main difference between this model and the default model is that this model keeps the PWM always running with some values that can not spin the motor. The default model starts the PWM when the motor must be running, that's why the ADC's didn't work until the motor is spinning.

This model can spin the motor and also can read an additional ADC (onboard potentiometer) and you can add other ADC readings by adding them in the PDB block and the effective ADC reading in the "ADC1_IRQHandler" block. So you don't have to modify anything to run the motor, but if you want to read other ADC's, then you must do what I already told you.

And keep in mind that this model uses Hall sensors to get the speed and position of the motor.

Please let me know if you encounter any problems.

 

Best regards,

Adrian

 

2,190 Views
Sriram
Contributor IV

i tried adding new adc reading to the model . I added the adc inputs and updated the corresponding pre triggers in the pdb config block but when i add new adcs none of them seem to be working in freemaster readings go to zero. Is there anything i need to add to the model ? 

i attached some models.  1 adc file is the model with 1 adc added in addition to the pot. When run the model with POT adc without adding any other adc inputs i am able to get the pot readings from freemaster but when i add one more adc then the freemaster shows 0 reading fr both adcs

4ntc model is the one im trying to implement. Im planning to test the model by connecting my pmsm prototype so i want to validate the model before i can test it out on a motor.

 

Thanks fr the help @adriantudor 

0 Kudos
2,159 Views
adriantudor
NXP Employee
NXP Employee

Hi Sriram,

The reason for that unfunctional ADC triggered readings is due to the low time delay between two consecutive ADC triggers. There must be a minimum time between two consecutive ADC readings for the same ADC instance (due to "ADC conversion time"). I tried to use about 200 cycles (see photo below) of delay between two consecutive trigger events and it seems to work fine. You can tweak it to find a lower value if you need that. The minimum value can be calculated with info that you can find in the Reference manual.

As advice, in the test stage, you can use a power source with overcurrent protection to power the GD3000 board and set the limit to about 2.5-3 amps. After you acquire a stable model and after you see that every protection is functioning as expected (overcurrent, overvoltage, and any other protection that you want), you can use a regular power supply. Keep in mind that those motor control models are just for demo and not for production, so it's up to you to develop a model that suits your requirements.

Best regards,

Adrian

2,217 Views
Sriram
Contributor IV

Ok sir thanks fr the reply . I will try it out 

0 Kudos
2,254 Views
Sriram
Contributor IV

Thank you 

0 Kudos
2,281 Views
Sriram
Contributor IV

this is not the solution , i want to know why the motor in the devkit has to running when i want to interface sensors via adc.

0 Kudos