ADC configuration for PMSM driver

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

ADC configuration for PMSM driver

1,847 Views
feramo
Contributor I

Hello guys,

I am new in developing with Kinetis microcontrollers and MCUXpresso and would greatly appreciate if you could help me.

I am developing a motor controller to drive a PMSM. Due to the project tight schedule, I already designed a PCB based on FRDM-KV31F and FRDM-MC-LVPMSM boards and the first prototype batch is being produced by now. I am using the very same pins for the motor driver, hall sensor and current sensors, so I expect to use the driver example with just a few modifications to fit my needs.

Along with the motor driver and sensors as they are on freedom boards, I also included on my project 2 ADC single ended channels (for acceleration and brake analog signals) on port B1 and B2 and one differential ADC channel for a thermistor sensing on pins 16+17 (ADC1_D*1/ADC0_D*2). So here are my questions:

  1. As the functioning of the motor driver depends on the ADC, FTM and PDB configuration, how can I change the "pmsm_hall_sensor" project without impacting the motor controlling operation?
  2. Any tips or literature on how to implement multiple ADC configuration on the same project (eg.: 1 diff pair and 2 single ended simultaneously).

Thank you!

Fernando

0 Kudos
Reply
2 Replies

1,761 Views
philip_drake
NXP Employee
NXP Employee

You may have realized there is an application note AN12374 that has most of what you need to get started.  

AN12374 - PMSM Field-Oriented Control on FRDM-KV31F with Hall and Encoder Sensors

I've attached the sw for the application note.  

Below I shared with you a project for the high voltage kit with hall start, SW v3. I shared this with the intention of showing you how to add measuring of two auxiliary channels intended for temperature sensors or whatever. 

Auxiliary channels are set in mcdrv_hvpkv31f120m.h header file: (ADC1_SE17)

/* Aux channel 1 is assigned to ADC1 only */

#define M1_ADC0_AUX1                   (MCDRV_CHAN_OFF)

#define M1_ADC1_AUX1                   (7)

/* Aux channel 2 is assigned to ADC1 only */

#define M1_ADC0_AUX2                   (MCDRV_CHAN_OFF)

#define M1_ADC1_AUX2                   (17)

Switching of measured AUX ADC channels is in function MCDRV_AuxChanAssign(…) in mcdrv_adc_adc16.h. Switching is executed on the base of toggling variable bAuxSampleActive after every reading of ADC result register R1 (RB).

adding_adc_channels_fm.png

0 Kudos
Reply

1,761 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Fernando,

Can you attach your "pmsm_hall_sensor" project? do you control the motor as a BLDC with six sptes or control it as PMSM with FOC?

BR

Xiangjun Rong

0 Kudos
Reply