cancel
Showing results for 
Search instead for 
Did you mean: 

Motor Pilot and Plot

Texram
Associate III

Hi,

I'm using MC WB 6.3.0 with Motor Pilot.

I wonder how to plot the following signals that are defined in MC WB in Motor Pilot:

PWM_CHU_H, PWM_CHV_H, PWM_CHV_H,

BEMF_U, BEMF_V, BEMF_W 

Texram_0-1721086176101.png

 

I don't see these registers are defined in the list of Registers in Motor Pilot.

Thanks

 

2 REPLIES 2
Gael A
ST Employee

Hello Texram,

Well the easiest way to have a look at those signals would be to take out the oscilloscope, especially for PWM but I guess that if you are asking that's because you can't or don't want to. Know that a DAC can be used also, you can enable it via WorkBench in the Application Configuration tab.

As you mentioned, those registers are not available in the MP list of registers, so if you want to see them, you'll have to manually add them, which requires modifying both the FW and the Pilot.

 

The Pilot is the easiest one, so I'll start with that one :

Depending on the GUI you are using, the Pilot refers to a list of registers that can be found here : "C:\...\MC_SDK_x.x.x\Utilities\PC_Software\STMotorPilot\RegisterList". You need to have a look at your .qml file to know which Register List you will need to modify. For example, the MC_FOC_SDK.qml (C:\...\MC_SDK_x.x.x\Utilities\PC_Software\STMotorPilot\GUI) file refers to the RegListSTMV2.json file. You can see that in line 23 : property string registerFileDescription: "RegListSTMV2.json"

In that file, you need to add all the relevant information about the registers you want to add ; remember the ID you are using, as it has to be the same on FW side.

 

Now onto the FW side :

You can start by adding the needed registers in register_interface.h, while making sure there is no duplicate IDs, and that IDs are referring to the same register on FW and Pilot.
Then, the next step would be to call those registers in the RI_GetPtrReg() fct that can be found in register_interface.c. Now this is where the fun begins, as most likely the values you are searching for are not available as is in the FW, so you will probably have to do some computations in the code that I don't know beforehand to call for the right pointer in your case MC_REG_XXX : part of code.

Mind the units of the values you want to plot, as the MCP only allows 16 bits transmissions for ASYNC, so you'll also have to convert your values to 16 bits.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.
Texram
Associate III

Hi Gaël :

Thank you for such detailed instructions.

I found a different way (using an UART port) to print out these data.