cancel
Showing results for 
Search instead for 
Did you mean: 

SPINFamily tool for ihm03a1 - application crash when set motor >2 Ohms at menu

dungeonlords789
Senior III
 
1 ACCEPTED SOLUTION

Accepted Solutions
Dario CUCCHI
ST Employee

Hi @dungeonlords789​ ,

Thanks for the info provided. I think I understood what is causing the error.

The parameters you set (Lm = 5mH, Rm = 8 Ohm) correspond to a value of INT_SPEED about equal to 1016 step/s that is higher than the maximum allowed value

of INT_SPEED register (976.5 step/s).

This is the reason why an exception is raised.

I know it could be a little bit confusing and the GUI should provide a clearer explanatory message.

However, I can suggest how to run the wizard and configure the POWERSTEP01 to run your motor.

In the wizard you have to set Lm = 5.25 mH or higher.

This is just to go on, we will change it to the correct value later.

The other parameters can be left unchanged.

Go on with the different configurations of the wizard, till it is done and you can write the configuration registers.

Now you can open the "BEMF compensation" window as shown here:

0693W000003ByOHQA0.png

Set here the correct parameters, so Lm = 5mH, Rm = 8 Ohm, together with the other parameters.

Click the “evaluate button�?: you will still get a warning but you can write the configuration registers for compensation, clicking the “write button.

Now the motor should run properly.

0693W000003ByOMQA0.png

You can even fine tune the slopes (ST_SLP, FN_SLP_ACC /FN_SLP_DEC) in order to keep the phase current as much as constant in the entire speed range of your application.

Try to follow these suggestion and let me know if the motor runs as expected.

View solution in original post

14 REPLIES 14
Dario CUCCHI
ST Employee

Hi @dungeonlords789​ ,

I need some more information to understand and help you to fix this unexpected problem.

When you set the motor > 2 ohm, are you referring to the “BEMF compensation�? window ?

If so, I suppose you want to run your motor  in voltage mode.

Which are the other parameters you set in this window ?

What do you mean exactly with “application crash�? ? Does the window just close or you get some kind of error message ?

Does the application crashes when you write the BEMF compensation registers ?

dungeonlords789
Senior III

I use Wizard -> Voltage mode. Look at picture.

Full err text:

Подробна�? информаци�? об и�?пользовании оперативной

(JIT) отладки вме�?то данного диалогового

окна �?одержит�?�? в конце �?того �?ообщени�?.

************** Тек�?т и�?ключени�? **************

System.ArgumentOutOfRangeException: Заданный аргумент находит�?�? вне диапазона допу�?тимых значений.

Им�? параметра: Value

  в xSpinFamily.Parameter.set_Value(Int32 value)

  в GUI.Wizard.VMParametersPage_PowerStep.SaveParameters(Int32 pKVAL_RUN, Int32 pKVAL_HOLD, Int32 pSTSLP, Int32 pINTSPD, Int32 pFNSLP)

  в GUI.Wizard.VMParametersPage.EvaluateRegValues()

  в GUI.Wizard.VMParametersPage.Check_button_Click(Object sender, EventArgs e)

  в System.Windows.Forms.Control.OnClick(EventArgs e)

  в System.Windows.Forms.Button.OnClick(EventArgs e)

  в System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

  в System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

  в System.Windows.Forms.Control.WndProc(Message& m)

  в System.Windows.Forms.ButtonBase.WndProc(Message& m)

  в System.Windows.Forms.Button.WndProc(Message& m)

  в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

  в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

  в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Загруженные �?борки **************

mscorlib

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.8762 (QFE.050727-8700)

   CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

GUI

   Вер�?и�? �?борки: 3.2.6113.16617

   Вер�?и�? Win32: 3.2.*

   CodeBase: file:///D:/Program%20Files%20(x86)/Texas%20Instruments/SPINFamily%20Evaluation%20Tool%203.2/GUI.exe

----------------------------------------

System.Windows.Forms

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.8653 (QFE.050727-8600)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.8770 (QFE.050727-8700)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Drawing

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.8681 (QFE.050727-8600)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

xSpinFamily

   Вер�?и�? �?борки: 1.1.0.16615

   Вер�?и�? Win32: 1.1.0.*

   CodeBase: file:///D:/Program%20Files%20(x86)/Texas%20Instruments/SPINFamily%20Evaluation%20Tool%203.2/xSpinFamily.DLL

----------------------------------------

IBUUI

   Вер�?и�? �?борки: 1.4.6113.16615

   Вер�?и�? Win32: 1.4.*

   CodeBase: file:///D:/Program%20Files%20(x86)/Texas%20Instruments/SPINFamily%20Evaluation%20Tool%203.2/IBUUI.DLL

----------------------------------------

System.Configuration

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.7057 (QFE.050727-7000)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

----------------------------------------

System.Xml

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.8679 (QFE.050727-8600)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

----------------------------------------

System.Management

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.8766 (QFE.050727-8700)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll

----------------------------------------

mscorlib.resources

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.8762 (QFE.050727-8700)

   CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

UIControls

   Вер�?и�? �?борки: 1.2.0.16610

   Вер�?и�? Win32: 1.2.0.*

   CodeBase: file:///D:/Program%20Files%20(x86)/Texas%20Instruments/SPINFamily%20Evaluation%20Tool%203.2/UIControls.DLL

----------------------------------------

Accessibility

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.7057 (QFE.050727-7000)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

----------------------------------------

Microsoft.Scripting

   Вер�?и�? �?борки: 0.9.0.0

   Вер�?и�? Win32: 0.9.20209.00

   CodeBase: file:///D:/Program%20Files%20(x86)/Texas%20Instruments/SPINFamily%20Evaluation%20Tool%203.2/Microsoft.Scripting.DLL

----------------------------------------

Microsoft.Scripting.Core

   Вер�?и�? �?борки: 0.9.0.0

   Вер�?и�? Win32: 0.9.20209.00

   CodeBase: file:///D:/Program%20Files%20(x86)/Texas%20Instruments/SPINFamily%20Evaluation%20Tool%203.2/Microsoft.Scripting.Core.DLL

----------------------------------------

System.Windows.Forms.resources

   Вер�?и�? �?борки: 2.0.0.0

   Вер�?и�? Win32: 2.0.50727.5420 (Win7SP1.050727-5400)

   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_ru_b77a5c561934e089/System.Windows.Forms.resources.dll

----------------------------------------

************** Оперативна�? отладка (JIT) **************

Дл�? подключени�? оперативной (JIT) отладки файл .config данного

приложени�? или компьютера (machine.config) должен иметь

значение jitDebugging, у�?тановленное в �?екции system.windows.forms.

Приложение также должно быть �?компилировано �? включенной

отладкой.

�?апример:

<configuration>

   <system.windows.forms jitDebugging="true" />

</configuration>

При включенной отладке JIT любое необрабатываемое и�?ключение

пере�?ылает�?�? отладчику JIT, зареги�?трированному на данном компьютере,

вме�?то того чтобы обрабатывать�?�? данным диалоговым окном.

0693W000003BsZdQAK.png

Dario CUCCHI
ST Employee

Hi @dungeonlords789​ ,

Thanks for the info provided. I think I understood what is causing the error.

The parameters you set (Lm = 5mH, Rm = 8 Ohm) correspond to a value of INT_SPEED about equal to 1016 step/s that is higher than the maximum allowed value

of INT_SPEED register (976.5 step/s).

This is the reason why an exception is raised.

I know it could be a little bit confusing and the GUI should provide a clearer explanatory message.

However, I can suggest how to run the wizard and configure the POWERSTEP01 to run your motor.

In the wizard you have to set Lm = 5.25 mH or higher.

This is just to go on, we will change it to the correct value later.

The other parameters can be left unchanged.

Go on with the different configurations of the wizard, till it is done and you can write the configuration registers.

Now you can open the "BEMF compensation" window as shown here:

0693W000003ByOHQA0.png

Set here the correct parameters, so Lm = 5mH, Rm = 8 Ohm, together with the other parameters.

Click the “evaluate button�?: you will still get a warning but you can write the configuration registers for compensation, clicking the “write button.

Now the motor should run properly.

0693W000003ByOMQA0.png

You can even fine tune the slopes (ST_SLP, FN_SLP_ACC /FN_SLP_DEC) in order to keep the phase current as much as constant in the entire speed range of your application.

Try to follow these suggestion and let me know if the motor runs as expected.

@Dario CUCCHI​ did you plan fix SPINFamily tool for ihm03a1 or provide source codes of aplication? This is some extra suggestions from me.

  1. SPINFamily crash when set motor >2 Ohms at menu, see above
  2. It is cool idea generate settings file in C format. But is is bette to use typedef union powerstep01_Init_u not define. See powerstep01 example:

powerstep01_struct =

      {

      /* common parameters */

      .vm.cp.cmVmSelection = POWERSTEP01_CM_VM_VOLTAGE, // enum powerstep01_CmVm_t

      (7102.22), // Acceleration rate in step/s2, range 14.55 to 59590 steps/s^2

      (7102.22), // Deceleration rate in step/s2, range 14.55 to 59590 steps/s^2

      2000.0, //12000 // Maximum speed in step/s, range 15.25 to 15610 steps/s 

      0, // Minimum speed in step/s, range 0 to 976.3 steps/s

      POWERSTEP01_LSPD_OPT_OFF, // Low speed optimization bit, enum powerstep01_LspdOpt_t

      15624.98, // Full step speed in step/s, range 7.63 to 15624.98 steps/s

      POWERSTEP01_BOOST_MODE_OFF, // Boost of the amplitude square wave, enum powerstep01_BoostMode_t

      POWERSTEP01_OCD_TH_93_75mV, // Overcurrent threshold settings via enum powerstep01_OcdTh_t

      STEP_MODE_1_64, // Step mode settings via enum motorStepMode_t

      POWERSTEP01_SYNC_SEL_DISABLED, // Synch. Mode settings via enum powerstep01_SyncSel_t

      (POWERSTEP01_ALARM_EN_OVERCURRENT| POWERSTEP01_ALARM_EN_THERMAL_SHUTDOWN | POWERSTEP01_ALARM_EN_THERMAL_WARNING | POWERSTEP01_ALARM_EN_UVLO |

         POWERSTEP01_ALARM_EN_WRONG_NPERF_CMD /*|POWERSTEP01_ALARM_EN_ADC_UVLO*/), // Alarm settings via bitmap enum powerstep01_AlarmEn_t

      POWERSTEP01_IGATE_32mA, // Gate sink/source current via enum powerstep01_Igate_t

      POWERSTEP01_TBOOST_0ns, // Duration of the overboost phase during gate turn-off via enum powerstep01_Tboost_t

      POWERSTEP01_TCC_875ns, // Controlled current time via enum powerstep01_Tcc_t

      POWERSTEP01_WD_EN_DISABLE, // External clock watchdog, enum powerstep01_WdEn_t 

      POWERSTEP01_TBLANK_250ns, // Duration of the blanking time via enum powerstep01_TBlank_t

      POWERSTEP01_TDT_125ns, // Duration of the dead time via enum powerstep01_Tdt_t

      /* voltage mode parameters */

      (10.0), // Hold duty cycle (torque) in %, range 0 to 99.6% (KVAL_HOLD)

      (10.0), // Run duty cycle (torque) in %, range 0 to 99.6%

      (10.0), // Acceleration duty cycle (torque) in %, range 0 to 99.6%

      (10.0), // Deceleration duty cycle (torque) in %, range 0 to 99.6%

      (848.83), // Intersect speed settings (INT_SPEED) for BEMF compensation in steps/s, range 0 to 3906 steps/s double _dIntSpd = 4*RNum/(LNum/1000)/2.0/M_PIl;/*[steps/s]*/

      (0.02136), // BEMF start slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step

      (0.0351), // BEMF final acc slope (FN_SLP_ACC) settings for BEMF compensation in % step/s, range 0 to 0.4% s/step

      (0.0351), // BEMF final dec slope settings for BEMF compensation in % step/s, range 0 to 0.4% s/step

      (1.0), // Thermal compensation param, range 1 to 1.46875

      (187.5), // Stall threshold settings in mV, range 31.25mV to 1000mV

      POWERSTEP01_CONFIG_INT_16MHZ_OSCOUT_2MHZ, // Clock setting , enum powerstep01_ConfigOscMgmt_t

      POWERSTEP01_CONFIG_SW_HARD_STOP, // External switch hard stop interrupt mode, enum powerstep01_ConfigSwMode_t

      POWERSTEP01_CONFIG_VS_COMP_DISABLE, // Motor Supply Voltage Compensation enabling , enum powerstep01_ConfigEnVscomp_t

      POWERSTEP01_CONFIG_OC_SD_DISABLE, // Over current shutwdown enabling, enum powerstep01_ConfigOcSd_t

      POWERSTEP01_CONFIG_UVLOVAL_HIGH, // UVLO Threshold via powerstep01_ConfigUvLoVal_t

      POWERSTEP01_CONFIG_VCCVAL_15V, // VCC Val, enum powerstep01_ConfigVccVal_t

      POWERSTEP01_CONFIG_PWM_DIV_2, // PWM Frequency Integer division, enum powerstep01_ConfigFPwmInt_t

      POWERSTEP01_CONFIG_PWM_MUL_1, // PWM Frequency Integer Multiplier, enum powerstep01_ConfigFPwmDec_t

  1. It will be more userfriendly to allow use Wizard of SPINFamily without connection to Nucleo board. I create custom board and I want generate settings to it.
  2. 0693W000005A7TPQA0.png
Dario CUCCHI
ST Employee

Thanks @dungeonlords789​  for your suggestions: I will forward them and ask to introduce these modification in the software.

Anyway, the source code of the software cannot be distributed.

Regarding the use of the GUI without the board connected:

If I well understood, you need to use the BEMF compensation window as a calculator to get the compensation coefficients.

You can try to open the GUI and select the tab “PCC0092 & EVAL�?.

0693W000005ASbKQAW.pngIn this case you can open the main screen , select the “BEMF compensation�? button and open the window without any board connected.

Then, you can set all the parameters and press the evaluate button to get graphs and compensation coefficients.

Hope this can help you.

@Dario CUCCHI​ any news about SPINFamily tool ihm03a1 update?

Dario CUCCHI
ST Employee

No news for the moment.

Hi @dungeonlords789​ 

this is just to give you an update on the SPINFamily GUI.

Unfortunately the new GUI version to introduce the modifications discussed above was put on hold.

Meaning that a new version of this GUI will not be available soon…

I suggest make SPINFamily opensource.