How to config ADC of MTRCKTSBNZVM128_CW11

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

How to config ADC of MTRCKTSBNZVM128_CW11

1,675 Views
Monke
Contributor I

When I tested MTRCKTSBNZVM128_CW11 in sensless mode,I want to mesaure a external vlotage to control the speed of motor,So I confged the ADC1 :

Monke_1-1641883814528.pngMonke_2-1641883835451.pngMonke_3-1641883917103.png

No matter how I modify it,The motor cannot operate normally at all times,I have tried to modfied the PTUTriggerEventList[1][0][1],but Nouse,motor still work in openloop and can‘t enter to closeloop

0 Kudos
4 Replies

1,650 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Monke,

It has been already discussed here:

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-BLDC-Adc-Problem/m-p/835830

 

Regards,

Daniel

0 Kudos

1,639 Views
Monke
Contributor I

Thank you for your reply,I read the topic that you suggest to me,but I don't know what i modified is right,

because if I add the fourth AD sample to ADC0.BLDC can work correctly,but when i add an ADC to ADC1 in the same way,motor still work in openloop.

I have initilized the adc :

volatile short PTUTriggerEventList[PTU_TOT_TRIGGERs_GEN_NO][PTU_TOT_LISTS_NO][3] = {
{ /*DelayT0 */
{0x0100,0x0200,0x0000},{0x0000,0x0000,0x0000}
},
{
{0x0100,0x0200,0x0000},{0x0000,0x0000,0x0000}
}
};

volatile char ADC1CommandList[6][4] = {
{0x40,0xCA,0x00,0x00},
{0xC0,0xD3,0x00,0x00},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00}
};

PTUTriggerEventList[1][0][1] = PTUTriggerEventList[1][0][0] +Delay3; // ADC1 Second sample - AD1

I have tried to modified the value of Delay3,but it is nouse,motor still can't run correctly.

Can you give me some suggestions?

0 Kudos

1,581 Views
RadekS
NXP Employee
NXP Employee

Hello Monke,

You may add new ADC channel measurement either during one of the trigger events or, you may create a new trigger for it.

It seems that you tested both options.

In the first case (multiple conversions at a single trigger), the first command(s) should start 0x00 (normal sequence) and the sequence ends by command starting either 0x40, 0x80 or 0xC0 byte (end of sequence/list).

For example:

PR_SECTION(adcLists)
  volatile char ADC1CommandList[6][4] = {
{0x00,0xCA,0x00,0x00}, // [normal] + no int [C0], phase voltage [CA], 4 clock cycles sample time [00], reserved [00]
{0xC0,0xD3,0x00,0x00}, // [end of list] + no int [C0], AN3 voltage [D3], 4 clock cycles sample time [00], reserved [00]
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00}
};
  volatile unsigned short ADC1ResultList[6] = {0, 0, 0, 0, 0, 0};
PR_SECTION(DEFAULT_SEC)

 

The second option is to create a new PTU trigger - as you tried in the second case.

I suppose that command 

PTUTriggerEventList[1][0][1] = PTUTriggerEventList[1][0][0] +Delay3; // ADC1 Second sample - AD1

is part of UpdateDutycycle() function.

Did you implement also limitations by MIN_ADC_TRIGGER_SECOND for Delay3?

Did you add a code for for ADC1ResultList[1] value reading (in ADC0done_ISR())?

 

Best regards

RadekS

0 Kudos

1,481 Views
Monke
Contributor I

Hello,RadekS:

Thank you for your reply,
 I have tried to modified the Value of Delay3,but it is no use;

I have read the article:Solved: MC9S12ZVML128_BLDC_Sensorless adding ADC - NXP Community

in this source code,the delay of thrid sampling time is 35,so I tried to modifed the value of delay3,but it is Nouse,bldc still can‘t work correctly.

0 Kudos