This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV8312-69M KIT alternative to user.h

Hi to everyone!

I'm working with DRV8312-69M KIT, and I'm following the labs. I want to do an automatic identification of motor parameters, which means that:

- first run motor parameters ID, and store the measured parameters

-then run the inertia ID, and store the measured inertia

I cant modify the values of user.h because they are declared as #define, and value can't be changed.

I tried to declare them as variables in user.c, but i get linking errors. I also tried to declare as external variables. There are a lot of functions depending of these values of user.h, how could I solve it?

Any input would be great! Thanks

  • Alberto,

    When you run Motor ID those values are automatically stored in the CTRL_ and are ready to run.

    Are you saying that you want your end product to do a motor ID and then store those value?  One time?  Every time some other logic is used?

    Well, you could write it to a sector of Flash, or have a function that writes new data, then loops around and writes over old data....or you could use an I2C EEPROM.

    Regardless, when you pull that motor data from some memory location you need to update the gUserParams structure with the new values and then pass them to the Controller

      // initialize the user parameters: this would allow you to load completely different "sets" of user.h.  See user.c

    // you can create another function that sets all of the user.h variables for your motors, but this function then sets those variables up into the UserParams structure

      USER_setParams(&gUserParams);

      // set the default controller parameters into the CTRL system, these then get passed to the EST.

      CTRL_setParams(ctrlHandle,&gUserParams);

     

    For -MOTION there will also be some SpinTAC components to set.

  • Thank you for the suggestions. Parameters have to be tuned only once, but it has to be at the application place. I will try to store the parameters and then update them, thanks!

  • Alberto,

    For -MOTION there are only two parameters that need to be tuned the Inertia and the Bandwdith.  These can both be updated at run-time.  I would suggest that you look into combining lab 05c which includes the inertia identification in with another lab that runs the speed control.  This will allow you to estimate the system inertia, provide the updated value to the speed controller, and run the motor using a single project.