AnsweredAssumed Answered

Does etpu_app_pmsmesvc3 Permanent Magnet Synchronous Motor Vector Control (AN3206) work?

Question asked by Peter Dufault on Feb 7, 2014
Latest reply on Jun 26, 2014 by Peter Dufault

I received the application note source code from Freescale.  It's "pmsmesvc2_CW2.3":

This is release 1.1 of the demo application

PMSM Vector Control, Driven by eTPU on MPC5500


However, the call to fs_etpu_bc_init() in fs_etpu_app_pmsmesvc3_init() is internally inconsistent.  It passes 0xFFFFFE and 0xFFFFFF as the bus ON and bus OFF parameters:


    err_code = fs_etpu_bc_init(

        BC_channel,                                                                 /* channel */

        FS_ETPU_PRIORITY_LOW,                                                       /* priority */

        BC_mode,                                                                    /* mode */

        BC_polarity,                                                                /* polarity */

        2 * (etpu_tcr1_freq / PWM_freq_hz),                                         /* period */

        0,                                                                          /* start_offset */

        0,                                                                          /* services_per_irq */

        0xFFFFFE,                                                                   /* u_dc_bus_ON */

        0xFFFFFF                                                                    /* u_dc_bus_OFF */


These parameters are ufract24_t types (that is, uint32_t in etpu_util.h).  In fs_etpu_bc_init() it checks that u_dc_bus_ON is greater than or equal to u_dc_bus_OFF and returns an error.  So  it is returning this error:


    * Parameters bounds check.















This is using RTEMS 4.11 and the "phycore_mpc5554" board support package using GCC, but I've been using this just fine controlling six axis of DC motors for a few years now.  That means I haven't tested this using FreeMaster and the Freescale development board set.


Does anyone know what's up here?  Does this version of the application work?