betaflight / betaflight-esc

Open source ESC firmware.
GNU General Public License v3.0
103 stars 40 forks source link

Add input signal autodetect #24

Open DieHertz opened 6 years ago

DieHertz commented 6 years ago

Currently the code seems broken, there is a DSHOT implementation taken from desolateESC, but I think it's not used anywhere. I'm going to add various PWM protocols and DSHOT support.

brycedjohnson commented 6 years ago

Dshot is supposed to be self clocking right? Did we need to have dshot 150/300/600/1200 or could it figure it out on its own. Isn't the kiss pretty flexible on dshot - like you could put dshot 450 into it and it would handle it just fine?

DieHertz commented 6 years ago

I'm talking about autodetect for pwm and DSHOT as a whole, blheli also didn't constrain dshot rate and is flexible as kiss.

This enum with different DSHOT rates I'll remove.

brycedjohnson commented 6 years ago

At least in blheli_s: https://github.com/bitdump/BLHeli/blob/master/BLHeli_S%20SiLabs/BLHeli_S.asm#L3637

There is a check for 150, 300, 600

Maybe blheli_32 does something different?

DieHertz commented 6 years ago

Indeed, but we're better than BLHS, right? :-) As about BLH32, no idea

nitr0123 commented 6 years ago

Sorry if this is the wrong place to ask. I'd love to help but don't know where to start. Is there some code I can read or a book etc to get started and possibly contribute ? Should I be reading blheli ? asm is a bit hard to understand. Edit: Would it be useful / possible to have a look at field oriented control ?

DieHertz commented 6 years ago

@nitr0123 This particular issue I'm already working on, in general looking at BLHeli_S code might give some insight, as well as current project C code.

stale[bot] commented 6 years ago

This issue / pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week.

jaxxzer commented 6 years ago

Any progress on this @DieHertz?

jaxxzer commented 5 years ago

Here's an example: https://github.com/jaxxzer/gsc-firmware/blob/master/src/example/example-detect-input-protocol.cpp