Thread Tools
This thread is privately moderated by joelucid, who may elect to delete unwanted replies.
Jan 03, 2020, 01:11 AM
Registered User
Quote:
Originally Posted by gilelach
You are genius! I have disabled Led Strip and now everything works! I fly FPV only, so LED loss is less important for me. Now I can go ahead and purchase 20 pack license for two identical flight controllers and others I have.
Thank you for your support!
If you're implying I should have bought enough for one quad to test, as you have smartly done, please know my aircraft were flying quite satisfactorily, and the filtering was almost secondary to simply contributing (something I tend to do consistently.) At least half of my motivation is to contribute, but if I can learn something new as part of the transaction, and possibly wind up with better performing aircraft, even better. As it stands now, I'll continue to buy 20 packs until I outfit the whole fleet. I have to believe there may be a sophisticated way to shuffle things about, that will let bit bang(?) and LED coexist, but if not, I picture going forward using a combination of static LEDs for nav lights on the remaining quads, and maybe I can configure profiles to activate LED, and drop RPM when I fly LOS. Although I guess toggling bidirectional dshot is not an option of profiles. That said, when Im on the go, it's really not a big deal to paste an alternate diff using my phone. Anyway, I've had exactly zero doubt so far that I'll find workable configurations. Though obviously I should not rely strictly on this support thread to do so.
Sign up now
to remove ads between posts
Jan 03, 2020, 05:11 AM
Registered User
Thread OP
Quote:
Originally Posted by obelix662000
Actually I don't think there is some current coming into the battery while braking. Braking is short circuit current, to me there is no pathway to the battery. What body diode do you mean? Here is a picture from my post showing braking with MOSFET shunt. Acom is opened all the time at this stage, and braking (damping) happens with opening the Bcom. If COMs are at the lower side the picture is similar. + and - are polarities of the back EMF. In that post I did simulation that reproduce experimental measurements very well, no current to the battery was found either (Fig.6).

96kHz might be too much, inductance of the motor will limit current if pulses are too short.
I know quadmcfly has measured very significant charging currents when massively braking motors and heís using lipos as voltage supply for his tests since bench supplies donít handle these spikes well.

Hereís how I think it works: say A - B is braking 100%, so both Ac and Bc are on and a massive current will start circulating in a loop. Letís say it flows downwards through Bc and upwards through Ac.

If we now switch off Bc the current will try to continue to flow due to the inductance of the motor. It can flow up through Ac either because thatís still on or through the body diode of the fet which allows reverse currents even if the fet is off. But it can no longer flow down Bc.

It needs to go somewhere so it flows up Bp through its body diode and reaches the lipo as long as the resulting voltage is high enough to cross the diode.

Think of it a bit like a switching boost converter which generates a higher voltage from emf by switching an inductor current loop off.
Jan 03, 2020, 05:26 AM
Registered User
Thread OP
Quote:
Originally Posted by cplus
So am I to assume this applies to me as well? (If you were planning to reply to me, and I've jumped the gun, I beg your pardon.)

I use navigational lighting on over half my fleet of 20+, with intentions to have lighting on them all eventually. I don't fly only FPV. Navigation/orientation lighting increases LOS range, and orientation accuracy, and is simply required when flying in low light. It also functions as a visual "buzzer," (most of my aircraft have aux. powered buzzers as well.) If vbat telemetry to my Taranis radio is not supported by the receiver of a particular model, I install, and designate a single downward LED to convey it. In addition to providing critical function, I have several models where I've integrated LEDs to simulate thrusters, etc., playing a key roll the aesthetic theme. When considering others' perspectives, such as only ever flying FPV, I can understand how the LED controller/pad could be seen as just another path for data, or completely disregarded all together, however, this is not the case for me. I'd estimate a nearly equal split of my flight time between FPV/LOS.

There are still unused pads on nearly all my FC's, I'd guess, but Im still peeling back the layers of this stuff, and at this point I couldn't say which may be suitable alternatives to host the LED signal, or allow use of the 'timer 1,' mentioned, if any.
Hey, sorry for not replying to your post directly. Just some new year festivities related response time issues .

So here is the situation: with timer based dshot we had to do timer / dma remapping for many boards to enable bidir dshot at all. Thatís why it primarily caught on among early adopters.

In 4.1 we added dshot bitbang which is much more flexible. It just needs exclusive access to either timer 1 or timer 8 and can then drive any FC.

But there is one tiny issue here: on F411ís there is no timer 8. So bitbang needs timer 1 and on some boards thatís used for led or soft serial. Now luckily most of these boards actually donít need any remapping for timer dshot so we were able to fix it by using timer dshot on those.

But there seem to be a few - the one I responded to yesterday is the first one I ran into - where there is a timer 1 conflict and one of the motors canít be covered with timer dshot.

You can try to either move the motor pad or the led pad using resource / timer / dma remapping. The constraints are that on dshot bitbang timer 1 needs to be exclusively used by dshot (on 411). And if you use timer dshot you need to find a pad that can be mapped to a timer channel that is exclusively used by dshot. It canít be an N channel timer pin. And you need to find a dma stream for the timer channel thatís unique among all other dma streams in use.

If you go a few pages back I described how to do this using the data sheet and the reference manual.
Jan 03, 2020, 05:38 AM
Registered User
Thread OP
Quote:
Originally Posted by cplus
If you're implying I should have bought enough for one quad to test, as you have smartly done, please know my aircraft were flying quite satisfactorily, and the filtering was almost secondary to simply contributing (something I tend to do consistently.) At least half of my motivation is to contribute, but if I can learn something new as part of the transaction, and possibly wind up with better performing aircraft, even better. As it stands now, I'll continue to buy 20 packs until I outfit the whole fleet. I have to believe there may be a sophisticated way to shuffle things about, that will let bit bang(?) and LED coexist, but if not, I picture going forward using a combination of static LEDs for nav lights on the remaining quads, and maybe I can configure profiles to activate LED, and drop RPM when I fly LOS. Although I guess toggling bidirectional dshot is not an option of profiles. That said, when Im on the go, it's really not a big deal to paste an alternate diff using my phone. Anyway, I've had exactly zero doubt so far that I'll find workable configurations. Though obviously I should not rely strictly on this support thread to do so.
Thanks for your support, cplus - its much appreciated. You'll really need to look at each board - I doubt many will have resource conflicts. Overall 4.1 is performing way beyond my hopes wrt hw compatibility.

If you move towards the end of https://github.com/betaflight/betafl...and-RPM-Filter it still has snippets for various boards to make them timer dshot compatible. That can be a worthwhile exercise in its own right since timer dshot uses significantly fewer cpu resources than bitbang.
Jan 03, 2020, 01:56 PM
Registered User
Quote:
Originally Posted by joelucid
I know quadmcfly has measured very significant charging currents when massively braking motors and he’s using lipos as voltage supply for his tests since bench supplies don’t handle these spikes well.

Here’s how I think it works: say A - B is braking 100%, so both Ac and Bc are on and a massive current will start circulating in a loop. Let’s say it flows downwards through Bc and upwards through Ac.

If we now switch off Bc the current will try to continue to flow due to the inductance of the motor. It can flow up through Ac either because that’s still on or through the body diode of the fet which allows reverse currents even if the fet is off. But it can no longer flow down Bc.

It needs to go somewhere so it flows up Bp through its body diode and reaches the lipo as long as the resulting voltage is high enough to cross the diode.

Think of it a bit like a switching boost converter which generates a higher voltage from emf by switching an inductor current loop off.
Discharge time is tauD=LR, charge time tauC=L(R+Ri), Ri is some additional internal resistance of wires/battery. In any case discharge time is shorter than charge time. If we have current reach the maximum in one PWM pulse, the discharge will be also finished within the same pulse time. I don't believe in any current circulation after Bcom gets OFF again. After Bcom gets off the current to the inductance have the same direction from Vemf because L is already discharged.

Simulations works very well for electronic circuits, my model includes all realistic values, including MOSFETs resistance, capacitance etc. I did many different simulations with different parameters of inductance, resistance, body diodes etc. and never see any current into the battery.
I don't remember if I measured battery current with my fast Hall-sensor, anyway I'm going to to it in a week or two when I'll get to my stuff again.
Last edited by obelix662000; Jan 03, 2020 at 02:07 PM.
Jan 03, 2020, 02:33 PM
Registered User
Thread OP
Quote:
Originally Posted by obelix662000
Discharge time is tauD=LR, charge time tauC=L(R+Ri), Ri is some additional internal resistance of wires/battery. In any case discharge time is shorter than charge time. If we have current reach the maximum in one PWM pulse, the discharge will be also finished within the same pulse time. I don't believe in any current circulation after Bcom gets OFF again. After Bcom gets off the current to the inductance have the same direction from Vemf because L is already discharged.

Simulations works very well for electronic circuits, my model includes all realistic values, including MOSFETs resistance, capacitance etc. I did many different simulations with different parameters of inductance, resistance, body diodes etc. and never see any current into the battery.
I don't remember if I measured battery current with my fast Hall-sensor, anyway I'm going to to it in a week or two when I'll get to my stuff again.
I donít think it happens while one step is active and pwm switches between on and off but when the esc commutates from one to the next. Thatís when the current that built up due to the combination of pwm off, pwm on and bemf needs to dissipate. I think you get a short spike that goes into the battery.

The measurements in your article seem to support it: there is a voltage spike to >4v when the commutation happens. This would be much more with higher inductance motors of course.

I could easily be wrong. Have never simulated it or measured it or even read about this. Just my personal hypothesis.
Jan 03, 2020, 06:03 PM
Registered User
checking resistance on two new 18500 Panasonics....wondering how to read the results of my measurements and calculations. Please see attached photo for testing numbers and the resistor I used along with the DMM.
Jan 03, 2020, 06:22 PM
Brisbane, Australia
Internal resistance = voltage drop divided by current.
So 0.38V divided by 3.1A = 0.123 ohms = 123 milliohms.
Are you sure you are in the right thread?
Jan 03, 2020, 06:59 PM
Registered User
Quote:
Originally Posted by joelucid
I don’t think it happens while one step is active and pwm switches between on and off but when the esc commutates from one to the next. That’s when the current that built up due to the combination of pwm off, pwm on and bemf needs to dissipate. I think you get a short spike that goes into the battery.

The measurements in your article seem to support it: there is a voltage spike to >4v when the commutation happens. This would be much more with higher inductance motors of course.

I could easily be wrong. Have never simulated it or measured it or even read about this. Just my personal hypothesis.
OK, I agree you are right. We have step up converter at this stage, with inductance current from back EMF when Bcom is ON,; at the moment of Bcom OFF and Bpwm ON we have voltage spike LdI/dt+bEMF exceeding Vbat, and therefore charging. I was able to get it from my model with better time resolution.
Here is the plot. Middle is coil current and bottom is battery current.
Last edited by obelix662000; Jan 03, 2020 at 07:05 PM.
Jan 04, 2020, 03:13 AM
Registered User
Quote:
Originally Posted by joelucid
Hey, sorry for not replying to your post directly. Just some new year festivities related response time issues .

So here is the situation: with timer based dshot...

...But there is one tiny issue here: on F411ís...

...You can try ..

... go a few pages back I described how to do this using the data sheet and the reference manual.

...thank you for the support...
Of course! Being asocial as I am, I hadn't considered the implications of this time of year. And if you work as much as it appears, by all means, may you enjoy any breaks you take.

If I am hearing you right, I can separate out my F411 boards, and those will be the ones that may present this.. challenge. Is that correct?

I did read the thread prior to posting, but much went over my head, as technical information tends to do the first time. I'm not surprised you've already provided such a resource. Cheers

Really, this is an ideal situation for me, as I have purpose now to dig down into the layers [any] I've been yearning to understand.
Thank you for your entirely thorough replies. Well worth waiting for, any day of the year.

Finally, I'd point out that you're saying 'thank you,' to a 'thank you,' but I'm similarly gracious, given an equivalent circumstance. ...just to say that you, and many others, have already given A LOT, so the gratitude is all mine.
Jan 04, 2020, 04:28 AM
Registered User
Thread OP
Quote:
Originally Posted by obelix662000
OK, I agree you are right. We have step up converter at this stage, with inductance current from back EMF when Bcom is ON,; at the moment of Bcom OFF and Bpwm ON we have voltage spike LdI/dt+bEMF exceeding Vbat, and therefore charging. I was able to get it from my model with better time resolution.
Here is the plot. Middle is coil current and bottom is battery current.
Cool! Thanks for looking into this.
Jan 04, 2020, 04:34 AM
Registered User
Thread OP
Quote:
Originally Posted by cplus
Of course! Being asocial as I am, I hadn't considered the implications of this time of year. And if you work as much as it appears, by all means, may you enjoy any breaks you take.

If I am hearing you right, I can separate out my F411 boards, and those will be the ones that may present this.. challenge. Is that correct?

I did read the thread prior to posting, but much went over my head, as technical information tends to do the first time. I'm not surprised you've already provided such a resource. Cheers

Really, this is an ideal situation for me, as I have purpose now to dig down into the layers [any] I've been yearning to understand.
Thank you for your entirely thorough replies. Well worth waiting for, any day of the year.

Finally, I'd point out that you're saying 'thank you,' to a 'thank you,' but I'm similarly gracious, given an equivalent circumstance. ...just to say that you, and many others, have already given A LOT, so the gratitude is all mine.
Yeah F411's only have timer1, so these are the ones most likely having issues. F405 can have them too but it's usually easily solved by specifying which timer (1 or 8) to use for bitbang DShot. Luckily the crazybeef4, matek411, matek411rc don't have the issue since they can use timer dshot.

The way I've implemented bitbang dshot is that I let everything else initialize and then see which timer and dma stream is still available. That way I could make it work automatically on almost every board. But there are a few edge cases: if some driver lazily uses a timer after I initialize the motors it might cause a conflict. AFAIK this only happens with some more exotic forms of telemetry - but it's good to keep it in mind.
Jan 04, 2020, 10:11 AM
Registered User
Thread OP
If anybody's interested https://jflight.net/downloads/ has an early access of JESC 2.3 for L type escs. It supports 24khz and 48khz pwm with pwm dithering for full 2000 step throttle resolution. Dshot 150 and 300 are supported. I have rpm telemetry working on these escs, too, but it impacts other aspects of performance so negatively that I'm thinking to leave that out - at least for now.

These hex files should give you the efficiency of 48khz on your L whoops! Install using BLHeli Configurator. Jesc-configurator does not support them yet (coming ...). The L esc bits will be free.

I don't have any L style ESCs but H type ESCs can run L style binaries and that is working. But real life L esc tests would be much appreciated. Let me know what you think!

EDIT: Bits pulled due to a last minute bug. Fix coming.
EDIT2: updated bits online
Last edited by joelucid; Jan 04, 2020 at 04:09 PM.
Jan 04, 2020, 11:24 AM
Registered User
sadly there is no way for me to have 48K esc working properly on my eachine trashcan.
Simply i can no more perform rolls because they result in an uncontrollable quad that crash the ground. chk this video:
rolllllll (0 min 16 sec)


FC is CrazybeeF4FR V3 with escs recognized as F-H-40
(not the original CrazybeeF4FR V2 with escs recognized as S-H-50)

i have tested all possible 48K configurations:
BF4.0 + F_H_40_48_REV16_77.HEX (Jazz Maverick)
BF4.1 + F_H_40_48_REV16_77.HEX (Jazz Maverick)
BF4.1 + JESC_F40_48_2_2.HEX + telemetry license

and all of those result in the same issue regardless of BF PID/FILTER tuning

on the other hand every possible configuration with a 24K esc works fine (no death rolls)

it's very frustrating because 48K is great for flight time improvement and smoothness.

please help!
Jan 04, 2020, 11:37 AM
Registered User
granola_fpv's Avatar
Quote:
Originally Posted by joelucid
In theory 48khz could be supported by L escs but it would reduce throttle resolution to 256 steps. Probably too low. 24khz pwm on jesc has 1024 throttle steps. 48khz has 512 steps.
All of my racing whoops are currently running O_L_5 ESC firmware, so I'm keenly interested in the possibility of 48kHz on "L" ESCs. I came across this comment today in another thread (BLHeli_S - Smooth as Silk - Page 380) ó†sounds like JazzMaverick is experimenting with something ó†a new "delta-sigma" approach?

Quote:
On a different note, would it be possible to make the BB1 ESCs go at 48khz?
Quote:
Yes, it's something that Jazz is looking into. One of the problems with 48kHz on BB1 was lack of throttle resolution, but he has implemented a new delta-sigma approach that solves this problem. The same code allows 96kHz on BB2 which I'm testing right now and is looking good. Jazz is doing some really great work here!
Would this be something you'd consider implementing in JESC, assuming it works?

BTW thanks again for all the amazing work. I've got JESC w/ RPM filtering on all my outdoor micros now and it rocks


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Question what Angle Should I Use With My RPM Gearbox On A Slash 2WD Greshthecat Off-road Cars 2 Jun 17, 2019 01:54 PM
Discussion OpenTx on Taranis + RPM sensors: RPM sync? Willsonman Radios 12 May 20, 2017 02:21 PM
Data Using Blheli_S ESC's with Damped Light on larger quads ElyZa Multirotor Drone Talk 11 Mar 28, 2017 01:33 PM
Discussion Field test on Mayteech BLHELI_S ESCs MaytechRC Multirotor Drone Power Systems 0 Jul 02, 2016 07:26 PM
Discussion VTX on 6S with reg. Need LC filter? GMPheli FPV Equipment 2 Nov 22, 2015 10:59 AM