You are here

New Motor Simulator (Signal Injection)

12 posts / 0 new
Last post
paltatech
Offline
Last seen: 2 years 10 months ago
Joined: 2017-09-10 22:50
Posts: 33
New Motor Simulator (Signal Injection)

Just as a heads up, we created a pull request to add our virtual motor support code.

With our virtual-motor branch you can engage a virtual motor using the vesc terminal and start playing with it.

More info and fancy screenshots in the Pull Request

https://github.com/vedderb/bldc/pull/82

Maybe someone finds it useful and can't wait for Benjamin to review it.

 

DrMaex
Offline
Last seen: 4 years 4 months ago
Joined: 2020-04-27 09:34
Posts: 5

Hello, I am trying to acquire real time data over UART and this is exactly what I need because the only hardware I have here on my desk ist the STM32F407 Discovery board. In the VESC-Tool I figured it out how to connect the virtual motor and what I see in the Data Analysis Section are just straight lines. How can I put the virtual motor in movement? 

Greets from Germany, Max

maxicor88
Offline
Last seen: 1 year 9 months ago
Joined: 2019-08-01 01:15
Posts: 6

Hello Max, This is also Max haha.

You should be able to drive the virtual motor, the same way you may use a real motor, just by commanding a current command, or duty command or speed command, or position command.

Which version of the firmware of vesc and vesc-tool are you using? To see if I can replicate that on my bench

Regards

 

 

Maxi

DrMaex
Offline
Last seen: 4 years 4 months ago
Joined: 2020-04-27 09:34
Posts: 5

OK, here is my setup:

STM32f407G Discovery running in debugger mode with bldc firmware version 4.1

VESC Tool has been compiled from source (v2.03)

After connecting I get the MessageBox that the firmware is old but mostly compatible.

Now I obtain motor configuration by loading the xml provided in the pull request above ( https://github.com/vedderb/bldc/files/3050533/virtual-motor-config.zip )

After uploading the config I go to VESC Terminal and paste there the string:

connect_virtual_motor 0.025 0.001 0.000020 0.000020 0.020 0.020 48.0

From now I am lost :) 

Which buttons do i have to click in the GUI or what are the commands for the console to let the virtual motor spin?

Thanks

Max

carboninfusion
Offline
Last seen: 9 months 3 days ago
VESC Free
Joined: 2020-04-26 00:40
Posts: 2

I have exactly the same question. Would love to figure this out. The motor experiments seem to send command to the motor but can't figure out any other way to do it from within the VESC-tool. 

maxicor88
Offline
Last seen: 1 year 9 months ago
Joined: 2019-08-01 01:15
Posts: 6

Hello guys, I have tried to test this with a stm32f4 discovery board, and using last available version of vesc firmware v5.01 and vesc tool 2.05.

It seems to work, maybe it needs some upgrade (i found a bug that when you disconnect the virtual motor, the board resets), but I wanted to show you the steps of how to test it, and maybe help me too ;-) 

Previously, I set the motor config to use FOC mode and encoder sensor mode.

Then I go to terminal and connect the virtual motor using a command similar to this:

connect_virtual_motor 0.00001 0.00001 0.00005 0.00005 0.02 0.005 48

Once connected, you should verify in Realtime Data, that No Faults are present.

If no fault is present, you can enter a speed command, or current command, or duty command, and monitor how the virtual motor reacts. How? Clicking in the buttons in the bottom part of the window

After entering the command, you can see how currents, voltages, and other variables look like in the RealTime Data or Sample Data windows.

I hope this helps.

PD: I could not attach pictures... sorry

 

Maxi

maxicor88
Offline
Last seen: 1 year 9 months ago
Joined: 2019-08-01 01:15
Posts: 6

Hello guys, I have tried to test this with a stm32f4 discovery board, and using last available version of vesc firmware v5.01 and vesc tool 2.05.

It seems to work, maybe it needs some upgrade (i found a bug that when you disconnect the virtual motor, the board resets), but I wanted to show you the steps of how to test it, and maybe help me too ;-) 

Previously, I set the motor config to use FOC mode and encoder sensor mode.

Then I go to terminal and connect the virtual motor using a command similar to this:

connect_virtual_motor 0.00001 0.00001 0.00005 0.00005 0.02 0.005 48

Once connected, you should verify in Realtime Data, that No Faults are present.

If no fault is present, you can enter a speed command, or current command, or duty command, and monitor how the virtual motor reacts. How? Clicking in the buttons in the bottom part of the window

After entering the command, you can see how currents, voltages, and other variables look like in the RealTime Data or Sample Data windows.

I hope this helps.

PD: I could not attach pictures... sorry

 

Maxi

DrMaex
Offline
Last seen: 4 years 4 months ago
Joined: 2020-04-27 09:34
Posts: 5

Hi,

I updated the firmware to 5.1 and Vesc Tool to 2.05

After connectiion has been established I change in

Motor Settings -> FOC -> Sensor Mode = Encoder and write this down to the board with the button on the right

Now after pasting your values

connect_virtual_motor 0.00001 0.00001 0.00005 0.00005 0.02 0.005 48

I select the realtime data and see FAULT UNBALANCED_CURRENT Duty Cycle 31.8 % and Current 0A

All changes of the values at the bottom followed by the "play"-button dont seem to have any effect

BUT

when I load the motor settings from the link in my post and upload them to the board (without disconecting virtual motor) the board first disconnects and after reconnecting

realtime data goes crazy with jumps between ~-3200 % and ~+3200 %

at least I can see that the board is alive and its just a matter of proper settings :)

As you can see I dont really understand what I am doing...blush

maxicor88
Offline
Last seen: 1 year 9 months ago
Joined: 2019-08-01 01:15
Posts: 6

Guys, FYI, I have been working in improving the virtual motor code, solved some bugs and I am going to make a pull request soon.

Sorry for the delay,  but I have been very busy last month.

I tested the code in a stm32f4 discovery board, so I am sure it will work for your setup.

I think I need to wait a little bit to be able to make the pull request, as my colleague Marcos has made a pull request with MTPA support, and virtual motor add-on is related with it. I dont want to make 2 pull request in a short time for the same feature.

Regards

Maxi

DrMaex
Offline
Last seen: 4 years 4 months ago
Joined: 2020-04-27 09:34
Posts: 5

Hi, thank you very much that you continue working on thi sfeature and did not forget this thread :) I will write down my experience as soon as your pull request has been merged and I find the time to try it out 

maxicor88
Offline
Last seen: 1 year 9 months ago
Joined: 2019-08-01 01:15
Posts: 6

Hello guys, here is the pull request, let me know if it works for you. 

https://github.com/vedderb/bldc/pull/186

Maxi

Maxi

DrMaex
Offline
Last seen: 4 years 4 months ago
Joined: 2020-04-27 09:34
Posts: 5

Hello,

finally I could find the time to try out your Pull Request (Damn COVID-19 and no nursery).

So I changed to the dev branch and compiled the firmware. When I tried to connect to my dev board with master version of the VESC-Tool, it complained about dev version of firmware on the board and said that I need to change to the dev branch of the VESC-Tool too. So I did but the USB connection seems to be very unstable. I continue to receive serial port error on connection to the board and need to refresh the device list several times to see the connected dev board at all. Is there something I missed?

 

Greets,

Max