Bug(?) with sending BLDC-Tool and UART commands simultaneously?

General topics and discussions about the VESC and its development.
Jackl
Posts: 10
Joined: 12 Mar 2017, 22:23

Bug(?) with sending BLDC-Tool and UART commands simultaneously?

Postby Jackl » 26 Jun 2017, 08:14

Hi all!

I think I just encountered a Bug/non-documented-/strange behaviour of the VESC.

I have a VESC connected to an STM32 MCU that sends torque (==motor current) commands via UART to my VESC. Refresh rate is around 100Hz.
If the vehicle is "disabled" by a switch on my MCU, the STM32 sends 0Nm (==0A) commands to the VESC.

Now if I am trying to do some new settings for the VESC in BLDC tool everything works fine. But if I try to move the motor by the arrow keys for example, I get really strange motor behaviour. The motor does not actually spin but just stutters a few degrees. Sounds really nasty :shock:
As soon, as I disconnect the UART, manual control via BLDC-Tool works fine again.

I suppose it is due to two different commands (UART and BLDC-Tool) hit the VESC and give 0A and xA in fast alternating order? As far as I remember, BLDC-Tool also uses UART?

Can anyone confirm this behaviour?
Wouldnt it be a good idea, to implement some kind of override in BLDC-Tool against all other commands?

Cheers!

rew
Posts: 940
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Bug(?) with sending BLDC-Tool and UART commands simultaneously?

Postby rew » 26 Jun 2017, 08:55

The VESC accepts "commands" from several different sources. If your UART keeps sending "and now stop" commands, then that's what the VESC will do. If you want to be able to override this in BLDC_TOOL, you can disable the UART app in BLDC_TOOL. Or you can modify your application: "if (last_command != 0 OR this_command != 0) send_command_to_vesc ();" this will skip sending the repeated "shutdown" commands to the VESC, allowing you to easily override the other source-of-commands when it is idle.

Jackl
Posts: 10
Joined: 12 Mar 2017, 22:23

Re: Bug(?) with sending BLDC-Tool and UART commands simultaneously?

Postby Jackl » 26 Jun 2017, 17:18

Hi rew,

thanks for the fast reply!

I figured a way how to work around it, so I was pretty much just looking if someone could reproduce the behaviour.

This:
rew wrote:If you want to be able to override this in BLDC_TOOL, you can disable the UART app in BLDC_TOOL.

Is actually not true for me. I still get more or less exactly the same behaviour. Don't know exactly why...

rew wrote:Or you can modify your application: "if (last_command != 0 OR this_command != 0) send_command_to_vesc ();

Good Idea, is now implemented.

Cheers!

rew
Posts: 940
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Bug(?) with sending BLDC-Tool and UART commands simultaneously?

Postby rew » 26 Jun 2017, 18:59

Jackl wrote:This:
rew wrote:If you want to be able to override this in BLDC_TOOL, you can disable the UART app in BLDC_TOOL.

Is actually not true for me. I still get more or less exactly the same behaviour. Don't know exactly why...

The applications get started at boot-time. So if you enable or disable an application you need to click "reboot" in BLDC_TOOL before those changes get activated....

Is that it?

Jackl
Posts: 10
Joined: 12 Mar 2017, 22:23

Re: Bug(?) with sending BLDC-Tool and UART commands simultaneously?

Postby Jackl » 27 Jun 2017, 07:36

rew wrote:The applications get started at boot-time. So if you enable or disable an application you need to click "reboot" in BLDC_TOOL before those changes get activated....

Is that it?


Yessss! rew, you are great! Everything seems good now :)

And I thought I read everything about the VESC...


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest