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.

Instaspin Lab12b control problem

Other Parts Discussed in Thread: MOTORWARE

I am trying to control my 3-phase PMSM motor with lab12b. My motorware version is 14. I use an incremental encoder with 2048 pulse. But I have a problem in acceleration and deceleration, sth seems to limit my torque reference. It takes too long time for the motor to reach target speed. 

Here are results of my investigation:

1) Encoder reading seems OK. I turned the motor shaft with my hand and confirmed that st_obj.vel.conv.Pos_mrev increases 1 at each 1 mechanical turn. Similarly st_obj.vel.conv.Pos_erev also increases as expected.

2) With the same inertia parameters and controller bandwidth parameter I saw that lab 5e works fine. At lab 5e, motor reaches target speed as quick as we desire.

As far as I know, the only difference between lab 5e and lab 12b is the replacement of Estimator with encoder functions. In my trials I used exactly the same control parameters for lab5e and lab12b, so why is the result different in terms of controller response?

3) According to my observation, at lab 5e when the reference speed is zero and when I try to rotate the motor shaft manually, it strictly resists my attempt and I cannot rotate the shaft. I see from the watch window that Iqref increases up to 1,5A.

On the other hand, at lab12b when I try to rotate the motor shaft manually when the reference speed is zero, it does not resist. I can easily rotate the shaft. On watch window I see that Iqref increases only up to 0.3A. 

So according to my comment at lab12b sth limits Iqref. Thus, even if controller parameters, target speed and acceleration limits are the same motor rampup time lasts too much longer at lab12b.

Is this comment true? If so, how can I change the limit for Iqref?

Best regards.

  • There should be no changes between lab 05e and 12b in the way that the controller output maximums are established. You can look at gMotorVars.SpinTAC.VelCtlOutputMax_A in order to confirm. That variable sets the maximum output current for the SpinTAC Velocity Controller.

    My guess is that USER_MOTOR_MAX_CURRENT is different when you are running the two different labs.
  • Thanks for the reply, I have already checked the motor max current variable and definitions. It is completely the same and my setting is 8.2A.

    Actually in motorware 14, I was not able to read encoder data. So at my project I took the encoder files and functions from motorware 13 and embedded into my project 12b in motorware 14. By this way, I have successfully read encoder data so that when I rotate the shaft manually I read expected values at encoder variables. Moreover, motor reaches target speed. The problem is acceleration, acceleration is so low and motor torque is so low. So that I am suspicious about quadrature axis current. Which functions can affect the output of the current controller? Is there any possibility for some of these functions to limit current?

    Anyway, also in lab12a I see that inertia measuring is nearly 5 times greater than the inertia measuring in lab 5. What can be the reason of this difference in inertia measurement?
  • I think you should reconsider mixing the encoder software from MotorWare 13 & 14.  We made some changes in between those two versions which could be causing some of the issues you are seeing.  

    What I think is happening is that your encoder is not getting aligned properly.  What is the value you are using for USER_MOTOR_RESISTANCE_EST_CURRENT_A?  This is the amount of current that the system will use in order to force the motor into alignment so that is can align the motor electrical angle with the encoder.  When the system goes into the state EST_State_Rs after startup does the motor move?

  • Actuaaly I am using 3A as align current and I see that the motr aligns properly so that erev parameter becomes zero. The problem is tgat after aligning it  acceleration rate is too low it takes so lonv time to reach ultimate speed.

    Anyway, as ykubsay mixi g motorware 13 and 14 may result a problem I will go  q k to the cod3 and try to work with motorware 14 only. But at my previous attempt I had some problems in reading encoder data.If the result will be the same for this case also possibly I will disturb  you again  with my questions :-)

  • Here is my new test results:

    I added st_obj.velCtlHandle into watch window.

    For lab 12b

    I saw that VelCtlErrorID becomes 13107 and 0 , VelMovStatus becomes ST_MOVE_BUSY and 0x0140.

    For lab 5e

    I saw that VelCtlErrorID is always 0 , VelMovStatus is always 0x0140.

    Why is there such a difference between two codes? I could not find the meaning of these in your documents or in the code. Does that difference make sense for you?

  • In lab 12b and lab 5e Velocity Move is not implemented, so the value will be random since that block isn't being used. The VelCtlErrorID sounds like it is the value I would expect. It became 0 after being initialized.
  • Thanks Adam,
    Eventually I achieved to run the motor properly. As a summary, the problem is mixing mw13 and 14 as you have said before. I have compared two motorware files and found the problem. Anyway, it has solved. But I still did not understand what limited the current. Because i was seeing that mrev and erev parameters increased properly, motor reaches final speed. But acceleration rate is low. Maybe i will further investigate it if i need. Thank you very much for your contribution.