Author Topic: Change the value in argument registers  (Read 2156 times)

shivang1993

  • Active Member
  • *
  • Posts: 13
Change the value in argument registers
« on: June 06, 2019, 11:14:40 PM »
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

  • Active Member
  • *
  • Posts: 37
Re: Change the value in argument registers
« Reply #1 on: June 07, 2019, 01:20:38 PM »
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:
 
Code: [Select]
focserver -p    To monitor the registers, run the following command on the USB console:
 
Code: [Select]
watch focserver -p    To change a register value, run the following command on the USB console:
 
Code: [Select]
focserver -w REGISTER=VALUE3) 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

  • Active Member
  • *
  • Posts: 13
Re: Change the value in argument registers
« Reply #2 on: June 07, 2019, 05:32:11 PM »
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

  • Active Member
  • *
  • Posts: 37
Re: Change the value in argument registers
« Reply #3 on: June 11, 2019, 11:23:42 AM »
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.