Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMotor Velox F7 SE Motor 3 Problem (DShot) #484

Closed
wehrenseb opened this issue Jun 29, 2024 · 1 comment · Fixed by #485
Closed

TMotor Velox F7 SE Motor 3 Problem (DShot) #484

wehrenseb opened this issue Jun 29, 2024 · 1 comment · Fixed by #485
Labels
bug Something isn't working

Comments

@wehrenseb
Copy link

Describe the bug

I got myself a TMotor Velox F7 SE stack for a new 5 inch build. Unfortunately i found, that any firmware version that i build and flash via the bf configurator, has problems with motor 3. (For some reason i can only build BF 4.5 RC1 and newer. I can't build 4.4.3 myself. Can someone clue me in why?)

With dshot_bidir enabled, motor 3 shows a high error rate, ranging from 5-10% when idle, to 30...40..50% when spinning. Sometimes the motor starts spinning by itself, even when motors are disabled in the configurator. So let's say motor 3 is acting very weirdly.

image

Once i go back to version 4.4.3 (i can't build it myself, but i got the original hex-file from TMotor) everything works fine again.

I started to dig deeper and compared CLI outputs of 4.5. build with bf-configurator to 4.4.3 shipped by TMotor. Interestingly there are major differences in the way the TIMERS and DMA channels are set up. I have general understanding of how micro-controllers, timers and dma work. That's what gives me the feeling, that something is very wrong here. But i'm not deep enough into BF, to draw the right conclusions and even more, resolve or help to resolve the issue. That's why i'm reaching out, hoping someone is able to help me and everyone else encountering that issue.

Here is what i found:

Resources:

4.5 build in configurator (not working):

resource MOTOR 1 A01
resource MOTOR 2 B00
resource MOTOR 3 B05
resource MOTOR 4 B01
resource MOTOR 5 C08
resource MOTOR 6 C09
resource MOTOR 7 A08
resource MOTOR 8 A09

4.4.3. shipped by TMotor (working):

resource MOTOR 2 B00
resource MOTOR 3 B05
resource MOTOR 4 B01
resource MOTOR 5 A09
resource MOTOR 6 A08
resource MOTOR 7 C09
resource MOTOR 8 C08

While there are differences with motor 5,6,7 and 8 beeing switched, i don't think this has something to do with my issue, since my issue has mainly to do with motor 3 ( B05 ).

Timers:

4.5 build in configurator (not working):

timer A01 AF2
# pin A01: TIM5 CH2 (AF2)
timer B00 AF2
# pin B00: TIM3 CH3 (AF2)
timer B05 AF70
# pin B05: TIM0 CH18 (AF70)
timer B01 AF2
# pin B01: TIM3 CH4 (AF2)
timer C08 AF70
# pin C08: TIM0 CH18 (AF70)
timer C09 AF70
# pin C09: TIM0 CH18 (AF70)
timer A08 AF1
# pin A08: TIM1 CH1 (AF1)
timer A09 AF1
# pin A09: TIM1 CH2 (AF1)
timer B03 AF1
# pin B03: TIM2 CH2 (AF1)
timer A10 AF1
# pin A10: TIM1 CH3 (AF1)

4.4.3. shipped by TMotor (working):

timer A01 AF2
# pin A01: TIM5 CH2 (AF2)
timer B00 AF2
# pin B00: TIM3 CH3 (AF2)
timer B05 AF2
# pin B05: TIM3 CH2 (AF2)
timer B01 AF2
# pin B01: TIM3 CH4 (AF2)
timer A09 AF1
# pin A09: TIM1 CH2 (AF1)
timer A08 AF1
# pin A08: TIM1 CH1 (AF1)
timer C09 AF3
# pin C09: TIM8 CH4 (AF3)
timer C08 AF3
# pin C08: TIM8 CH3 (AF3)
timer B03 AF1
# pin B03: TIM2 CH2 (AF1)
timer A10 AF1
# pin A10: TIM1 CH3 (AF1)

Here i think, we see some problems. In the FW build by the configurator, the timer on B05 related to motor 3 shares TIM0 Ch18 with two other Pins, namely C08 and C09. In my understanding of timers, that makes no sense. In the working factory firmware of TMotor, this is also not the case. Every output has their own timer channel and that firmware is working. It's a similar story with DMA:

DMA:

4.5 build in configurator (not working):

# pin A01: DMA1 Stream 4 Channel 6
dma pin B00 0
# pin B00: DMA1 Stream 7 Channel 5
dma pin B05 0
dma pin B01 0
# pin B01: DMA1 Stream 2 Channel 5
dma pin C08 0
dma pin C09 0
dma pin A08 0
# pin A08: DMA2 Stream 6 Channel 0
dma pin A09 0
# pin A09: DMA2 Stream 6 Channel 0
dma pin B03 0
# pin B03: DMA1 Stream 6 Channel 3
dma pin A10 0
# pin A10: DMA2 Stream 6 Channel 0

4.4.3. shipped by TMotor (working):

# pin A01: DMA1 Stream 4 Channel 6
dma pin B00 0
# pin B00: DMA1 Stream 7 Channel 5
dma pin B05 0
# pin B05: DMA1 Stream 5 Channel 5
dma pin B01 0
# pin B01: DMA1 Stream 2 Channel 5
dma pin A09 0
# pin A09: DMA2 Stream 6 Channel 0
dma pin A08 0
# pin A08: DMA2 Stream 6 Channel 0
dma pin C09 0
# pin C09: DMA2 Stream 7 Channel 7
dma pin C08 0
# pin C08: DMA2 Stream 2 Channel 0
dma pin B03 0
# pin B03: DMA1 Stream 6 Channel 3
dma pin A10 0
# pin A10: DMA2 Stream 6 Channel 0

Pin B05 related to the problematic motor 3 has no dma channel assigned in the configurator-built firmware. However it's assigned to a dma channel in the working factory firmware by TMotor.

Is it correct to assume, that he config.h file for the TMOTOR VELOX F7 SE is simply wrong? Or am i missing something here?

For a full comparison of the configs:
4.5 Build in configurator (not working): "ea8963bb-7f82-4a86-82e9-9265ed3b15b3"
4.4.3 by TMotor (working): "d57fae43-4542-431a-a12a-c5dacef14ec4"

I would love to help to bring things in working order for me and everyone else using this FC. But i currently don't know what i need to do, to find out the correct configuration and propose a corresponding change to the config file. I hope you guys can point me into the right direction.

Regards

To Reproduce

  1. Use BF configurator to build and flash any version of BF to TMotor Velox F7 SE.
  2. Enable DSHOT 600
  3. Enable bidirectional dshot
  4. Try to spin up Motors

Expected behavior

Motors spinning with telemetry working and a near zero error rate.

Support ID

Id: "ea8963bb-7f82-4a86-82e9-9265ed3b15b3"

Flight controller

TMotor Velox F7 SE

Other components

  • Velox F7 SE 50A ESC

How are the different components wired up (including port information)

No response

Add any other context about the problem that you think might be relevant here

I submitted support data for both firmwares:
4.5 Build in configurator (not working): Id: "ea8963bb-7f82-4a86-82e9-9265ed3b15b3"
4.4.3 by TMotor (working): Id: "d57fae43-4542-431a-a12a-c5dacef14ec4"

@haslinghuis haslinghuis added the bug Something isn't working label Jun 29, 2024
@haslinghuis haslinghuis transferred this issue from betaflight/betaflight Jun 29, 2024
@sugaarK
Copy link
Member

sugaarK commented Jun 30, 2024

fixed here #485

@sugaarK sugaarK closed this as completed Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants