Thread Tools
This thread is privately moderated by joelucid, who may elect to delete unwanted replies.
Aug 03, 2019, 05:06 AM
Registered User
Thread OP
Discussion

JESC - Surgical Precision with Rpm Filter on BLHeli_S


The RPM Filter in BetaFlight 4.0 removes any motor noise with surgical precision by positioning very narrow notch filters in real time on the motor frequencies. Notch filters have infinite noise suppression at the center so the RPM filter removes motor noise completely while adding very little delay, truly taking flight performance to a new level. This has become possible by real-time rpm telemetry, introduced recently in BLHeli32.

And now this is possible on BLHeli_S hardware, too! Introducing JESC:

- JESC is a new open source firmware for BLHeli_S ESCs

- Requires an efm8bb21 based BLHeli_S ESC. You can recognize them by their name tag displayed in BLHeli Configurator: if it contains an H in the middle like F-H-30 it's supported.

- Based on BLHeli_S but removes all the legacy protocols and related code for light-weight code base.

- DShot 300 and Dshot 600 supported.

- Adds 48khz PWM mode for extra smooth freestyle flight.

- Super reliable protocol detection due to focus on modern protocols only.

- Adds extensibility with services.

- Optional RPM Telemetry add-on firmware available for small $$ to enable BetaFlight's Rpm Filter and the coming Dynamic Idle feature via dshot signal line rpm telemetry at up to dshot 600 and 8k pid frequency. No additional wiring required.

- New startup tones which indicate whether rpm telemetry is active.

- Configurable using the new jesc-configurator.

The results are smoother and colder motors - even with bent props - and better pid loop performance due to the much reduced filter delay. The ESCs make this possible by sending the current speed of each motor at full pid loop speed to the FC where it's used to tune the filters.

More information at jflight.net.

Flight demos:

Betaflight 4.0, rpm filter, scooter 4", emax 1606, LOS (1 min 43 sec)


Zappy 135, nk1306, 550mah 3s, kk3045x3 (2 min 8 sec)


All coded in 8051 assembler by the guy who implemented the rpm filter
Last edited by joelucid; Sep 04, 2019 at 10:05 AM.
Sign up now
to remove ads between posts
Aug 03, 2019, 05:39 AM
the people squad
schrodingers cat's Avatar
Awesome, and I can testify to this...

I have a question about the dynamic idle, so far I have not been able to get the dynamic idle to be as slow as my usual idle, even when following your instructions on how to set the speed. On the bench, props off, the idle is faster than "normal" and does not go below this speed even when lowering the parameters. As an example, if I arm with "nomal" idle while looking at the motors tab, I see motor values of say around 1030, but with dyn idle active, the motor values wont go below say 1065. (rough approximate numbers from recall)
Aug 03, 2019, 05:51 AM
Registered User
Thread OP
Quote:
Originally Posted by schrodingers cat
Awesome, and I can testify to this...

I have a question about the dynamic idle, so far I have not been able to get the dynamic idle to be as slow as my usual idle, even when following your instructions on how to set the speed. On the bench, props off, the idle is faster than "normal" and does not go below this speed even when lowering the parameters. As an example, if I arm with "nomal" idle while looking at the motors tab, I see motor values of say around 1030, but with dyn idle active, the motor values wont go below say 1065. (rough approximate numbers from recall)
If you use dynamic idle you should set the dshot_idle_value to 1. Otherwise idle_throttle gets added to dshot_idle_value and you have twice the idle. I've since changed dynamic idle to also use dshot_idle_value instead of introducing a new variable so once that is merged you shouldn't need to do this anymore.

Background is that dshot_idle_value sets the minimum dshot value that is ever sent to the motors. By setting that to the lowest possible dshot value, but adding idle_throttle and dynamically increasing the minimum output value if one of the motors gets too slow we can take advantage of the full dshot output range.
Aug 03, 2019, 06:11 AM
the people squad
schrodingers cat's Avatar
Yes so I have dshot_idle_value set to 1 (which of course comes up as 0.01 on the configuration tab) and then I have the idle_throttle set to say 20 (if my "normal" idle offset was 2). Even if I lower this idle_throttle more, motors stay at the same higher speed. This is consistent on 4 different setups I've done. Not a complaint, just not sure what I'm doing wrong. (I've also set the Hz to 45 from the default zero to turn the feature on)
Aug 03, 2019, 06:15 AM
Registered User
Thread OP
Quote:
Originally Posted by schrodingers cat
Yes so I have dshot_idle set to 1 (which of course comes up as 0.01 on the configuration tab) and then I have the idle_throttle set to say 20 (if my "normal" idle offset was 2). Even if I lower this idle_throttle more, motors stay at the same higher speed. This is consistent on 4 different setups I've done. Not a complaint, just not sure what I'm doing wrong. (I've also set the Hz to 45)
Then I can only imagine that the setups are idle_hz constrained. Idle_throttle at 20 is very, very little. If that's true just lower idle_hz until you get your preferred idle motor speed.

Typically too low idle motor speeds are to be avoided since they lower the response of the quad: it takes time to spin up the motors. You should have idle_throttle as high as possible without causing negative side effects (like noticeable thrust at zero throttle).
Aug 03, 2019, 06:21 AM
the people squad
schrodingers cat's Avatar
Ok, will bear that in mind, thanks

Also, I'm doing an NK setup and am wondering, do I first flash the "patch" 1.3NK then flash the 1.4, then the telem 2.0 or....
Aug 03, 2019, 06:22 AM
Registered User
Thread OP
Quote:
Originally Posted by schrodingers cat
Ok, will bear that in mind, thanks

Also, I'm doing an NK setup and am wondering, do I first flash the "patch" 1.3NK then flash the 1.4, then the telem 2.0 or....
I haven't compiled the patch for the most recent jesc yet. Please try the standard fw first and if you get issues I'll add the patch. Not sure if this is specific to my aggressive tuned quads and very high rates.
Aug 04, 2019, 04:24 AM
aka TheIsotopes
Isotopes's Avatar
is it possible that dyn idle does not work yet with jesc?

no matter what I have set at idle_min_rpm, it does not change the idle speed, it always stays around 1040

on another fc with blheli_32 esc (last beta) it works without problems
Aug 04, 2019, 06:17 AM
Registered User
Thread OP
Quote:
Originally Posted by Isotopes
is it possible that dyn idle does not work yet with jesc?

no matter what I have set at idle_min_rpm, it does not change the idle speed, it always stays around 1040

on another fc with blheli_32 esc (last beta) it works without problems
Dynamic idle has two main config parameters and in the jflight binary still uses dshot_idle_value as well:
- dshot_idle_value should be set to 1
- idle_hz should be set to the minimum rpm that guarantees no desyncs
- idle_throttle should be set to the amount of idle throttle you want to use to get good response out of the motors. Typically around what you had as dshot_idle_value / 10.

As long as idle_throttle is enough to keep rpm of all motors > min_hz the idle pid doesn't really get into play. But if one of your motors slows down too much in reverse air flow dynamic idle will sort of dynamically increase dshot_idle_value so that all motors get a bit more juice.

If idle_hz does not change the idle rpm of the motors it means that either dshot_idle_value wasn't set to 1 or idle_throttle is so high that all motors are above idle_hz.
Aug 04, 2019, 06:19 AM
Registered User
Thread OP
Quote:
Originally Posted by Isotopes
is it possible that dyn idle does not work yet with jesc?

no matter what I have set at idle_min_rpm, it does not change the idle speed, it always stays around 1040

on another fc with blheli_32 esc (last beta) it works without problems
Oh I see that you already use the new code which calls idle_hz idle_min_rpm. That means you aren't using jflight. Does rpm telemetry work at all?
Aug 04, 2019, 06:34 AM
aka TheIsotopes
Isotopes's Avatar
Quote:
Originally Posted by joelucid
Oh I see that you already use the new code which calls idle_hz idle_min_rpm. That means you aren't using jflight. Does rpm telemetry work at all?
I'm using latest build #1780 with jflight esc 1.4 and telemetry 2.0

EDIT: I can set idle_min_rpm up to 100, but the motors still rotate in idle with 1045 max

here my diff:
Code:
# Betaflight / MATEKF405 (MKF4) 4.1.0 Aug  4 2019 / 06:51:11 (096ca9f2d) MSP API: 1.42

# start the command batch
batch start

board_name MATEKF405

# name: Mark1

# feature
feature -SOFTSERIAL
feature -TELEMETRY
feature -OSD
feature LED_STRIP

# beeper
beeper -BAT_CRIT_LOW
beeper -BAT_LOW
beeper -ON_USB

# map
map TAER1234

# led
led 0 9,2::AW:0
led 1 9,3::AW:0
led 2 9,4::AW:0
led 3 9,5::AW:0
led 4 6,5::AW:0
led 5 6,4::AW:0
led 6 6,3::AW:0
led 7 6,2::AW:0

# mode_color
mode_color 6 0 3
mode_color 6 1 6

# aux
aux 0 0 0 1600 2000 0 0
aux 1 13 1 1000 1200 0 0
aux 2 26 0 1800 2000 0 0
aux 3 31 0 1200 1400 0 0
aux 4 36 1 1800 2000 0 0

# master
set gyro_sync_denom = 2
set gyro_lowpass_hz = 0
set gyro_lowpass2_hz = 150
set dyn_notch_range = MEDIUM
set dyn_notch_width_percent = 0
set dyn_notch_q = 200
set dyn_notch_min_hz = 200
set dyn_lpf_gyro_min_hz = 0
set acc_hardware = NONE
set mag_hardware = NONE
set baro_hardware = NONE
set serialrx_provider = SUMD
set blackbox_device = SPIFLASH
set dshot_idle_value = 1
set dshot_burst = OFF
set dshot_bidir = ON
set motor_pwm_protocol = DSHOT600
set bat_capacity = 1550
set use_cbat_alerts = ON
set cbat_alert_percent = 20
set vbat_duration_for_warning = 50
set vbat_duration_for_critical = 20
set pid_process_denom = 1
set scheduler_optimize_rate = ON
set gyro_1_sensor_align = CW180
set gyro_1_align_yaw = 1800
set name = Mark1

# profile 0
set dyn_lpf_dterm_min_hz = 200
set dyn_lpf_dterm_max_hz = 300
set dterm_lowpass2_hz = 0
set feedforward_transition = 30
set iterm_relax_type = GYRO
set iterm_relax_cutoff = 10
set i_pitch = 85
set i_roll = 80
set d_min_roll = 25
set d_min_pitch = 28
set d_min_boost_gain = 35
set d_min_advance = 50
set idle_min_rpm = 45
set idle_adjustment_speed = 40

# rateprofile 0
set roll_rc_rate = 135
set pitch_rc_rate = 135
set yaw_rc_rate = 120
set roll_expo = 15
set pitch_expo = 15
set roll_srate = 75
set pitch_srate = 75
set tpa_rate = 80
set tpa_breakpoint = 1750

# end the command batch
batch end
Last edited by Isotopes; Aug 04, 2019 at 06:48 AM.
Aug 04, 2019, 07:36 AM
Registered User
Thread OP
My last minute bug in dynamic idle. Here's the fix: https://github.com/betaflight/betaflight/pull/8661
Aug 04, 2019, 08:19 AM
aka TheIsotopes
Isotopes's Avatar
Quote:
Originally Posted by joelucid
My last minute bug in dynamic idle. Here's the fix: https://github.com/betaflight/betaflight/pull/8661
nope, still the same problem but now on both fc

EDIT: I can not remember why I wrote earlier that it worked with the second fc with blheli_32.
I had tested your fix on both fc, then I'm back on build # 1780 and noticed that this build on both fc is not working
Last edited by Isotopes; Aug 04, 2019 at 09:18 AM.
Aug 04, 2019, 09:30 AM
Registered User
Thread OP
Quote:
Originally Posted by Isotopes
nope, still the same problem but now on both fc

EDIT: I can not remember why I wrote earlier that it worked with the second fc with blheli_32.
I had tested your fix on both fc, then I'm back on build # 1780 and noticed that this build on both fc is not working
Please try an dshot_telemetry_info to see if you get valid rpm data.
Aug 04, 2019, 09:39 AM
aka TheIsotopes
Isotopes's Avatar
@joelucid

standing motors:
Code:
# dshot_telemetry_info
Dshot reads: 1377699
Dshot invalid pkts: 0
Dshot irq micros: 2

Motor     RPM   Invalid
=====   =====   =======
    0       0     0.00%
    1       0     0.00%
    2       0     0.00%
    3       0     0.00%

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rotating motors
Code:
# dshot_telemetry_info
Dshot reads: 639723
Dshot invalid pkts: 0
Dshot irq micros: 2

Motor     RPM   Invalid
=====   =====   =======
    0      90     0.00%
    1      88     0.00%
    2      77     0.00%
    3      77     0.00%

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


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