News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Change the value in argument registers

Started by shivang1993, June 06, 2019, 11:14:40 PM

Previous topic - Next topic

shivang1993

Hello,

I am using the EDDP kit with the IIoT-EDDP-master code from Github for the field oriented control. As specified in the documentation, there are several argument registers in the foc.h file. How can we update the value of those register values (like the Kp and Ki values)? Do we need to change them in the focserver.conf file? If yes, do we need to re-build any other files apart from foc.cpp file?

Also is there any way to monitor the real time values of the variables defined in foc.cpp file when the motor is running for de-bugging purpose?

Thanks

Andrei Errapart

You can modify register with any of the following methods:
1) Change focserver.conf and restart focserver
2) To dump all registers, run the following command on the USB console:
focserver -p
    To monitor the registers, run the following command on the USB console:
watch focserver -p
    To change a register value, run the following command on the USB console:
focserver -w REGISTER=VALUE
3) Modify the default web application to control and monitor the registers you need.

The following registers are available:
* Control
* FluxSp
* FluxKp
* FluxKi
* TorqueSp
* TorqueKp
* TorqueKi
* RPMSp
* RPMKp
* RPMKi
* Shift
* Vd
* Vq
* Fa
* Fb
* Control2
* Mode
* FixedDelay
* SpreadSpectrum


shivang1993

Thanks a lot Andrei. This works :)

Can you also tell me is there any way to access the variables defined in the foc.cpp file ? I want to see the real-time value of these variables for de-bugging purpose. I understood how to access the argument registers but still have confusion over accessing other varibales defined the foc.cpp file.

Thanks

Andrei Errapart

These variables cannot be monitored without rebuilding the design with the modified foc.cpp. These modifications should permit observing the variables you want.

Let me note that: as soon as you modify the design, it is your responsibility to get it working (again).

Depending on the your requirements to the real-time, there are two options:
* Not real time, low refresh rate: use the approach in the previous answer and extend the status registers with the variables you want to observe. This requires changes in foc.h, foc.pp and the focserver.
* Real-time: Bring out the variables you want and add a logic analyzer (ILA) to your design.