Thread Tools
Sep 14, 2020, 01:14 PM
Certified Nerd
rcjetflyer2's Avatar
Thread OP
Quote:
Originally Posted by Tcat
Could you suggest a supplier and part #ís for the header pin blocks? Got chips ordered. Great design project, well done!! Excellent follow on to KK2. Have used KK2 and your manual is very well done. Far cry from single channel gas tube receivers that I started with in the 60ís.
I used these for the 3-pin angled headers: https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

And these for the single pin headers: https://www.amazon.com/Baimeixun-20P...33&s=hi&sr=1-7

Yea you have to buy them in bulk, but they'll last you quite a while
Sign up now
to remove ads between posts
Sep 14, 2020, 01:52 PM
Registered User
Cat 1's Avatar
Great work Nicholas !! This is the next logical step and a great "reset" for Vtol controllers. I really like your approach to the solution. I too have been dabbling with controllers since the "hack the wii controller" stuff and am not a coder. The latest multi-controller setups make my head spin at the code level. This solution is brilliant.

Board on order and subscribed to this thread...
Sep 14, 2020, 03:03 PM
My cat moderates better
BillzillaAus's Avatar
Looks like a very impressive & modern solution, thanks!
Sep 14, 2020, 10:43 PM
Registered User
Nicholas,
This looks REALLY good! I have been using Open Aero VTOL for a long time now, but it has hit its limits and David has moved on to other projects.
The code looks really clean and easy to understand. Congrats on that!
I just got a Teensy 4.0 board today, but the connectors and IMU's will take a few more days, as will getting a PPM RX. Orange (Hobby King) makes Spektrum compatible RX with PPM. I have used their Sbus DSMX RX before with good results, so hopefully the PPM will do as well. Once all the parts arrive, my goal will be to get it into a basic quad.

To me, the big thing missing compared to OAV is the transition mixers. You have a nice time based blend in there, but I rely on full proportional transition control for a lot of my projects. This is a combo of the mixers themselves as well as the output offset vs % transition curves.

It should be pretty easy to add to your code. I will let you know how it goes.

I have a mini-Convergence with OAV that I was going to rewire with faster ESC's, but now I will do it with Teensy. (and much faster ESC's!). That will be a good testbed for transitional mixing. In the past, I have flown it around a lot at 20 to 50% transitioned (below knee height)

Looking at the code, up to half the available processor cycles are used up doing the OneShot 125 output. Lots and lots of cycles available, but it should be pretty easy to make a variant of the PWMServo code (Teensy version) to do OS125 at the 2 kHz main loop rate using the hardware PWM capability and only a few CPU cycles. Once working, it would actually make the main loop code simpler. Dshot or faster OneShot would be nice, but probably no real advantage given the limit of a 2kHz main loop (which is still really fast for most VTOL airplanes)
Thanks for doing this and making it available!
Bob
Sep 15, 2020, 07:34 AM
Certified Nerd
rcjetflyer2's Avatar
Thread OP
Quote:
Originally Posted by parky
...

To me, the big thing missing compared to OAV is the transition mixers. You have a nice time based blend in there, but I rely on full proportional transition control for a lot of my projects. This is a combo of the mixers themselves as well as the output offset vs % transition curves.

It should be pretty easy to add to your code. I will let you know how it goes.

I have a mini-Convergence with OAV that I was going to rewire with faster ESC's, but now I will do it with Teensy. (and much faster ESC's!). That will be a good testbed for transitional mixing. In the past, I have flown it around a lot at 20 to 50% transitioned (below knee height)

Looking at the code, up to half the available processor cycles are used up doing the OneShot 125 output. Lots and lots of cycles available, but it should be pretty easy to make a variant of the PWMServo code (Teensy version) to do OS125 at the 2 kHz main loop rate using the hardware PWM capability and only a few CPU cycles. Once working, it would actually make the main loop code simpler. Dshot or faster OneShot would be nice, but probably no real advantage given the limit of a 2kHz main loop (which is still really fast for most VTOL airplanes)
Thanks for doing this and making it available!
Bob
Yea, one thing I would like to improve on is the stock fading capability. I threw in the linear variable fader right before release just so it had SOMETHING... I definitely passed the code on to you guys right where I left off, so I'm interested to see people's approaches to better fading capabilities that can hopefully be included in later official releases. Let me know what you come up with!!

Glad you saw my crude oneshot125 implementation haha. Definitely not the best way to go about doing that, but it was the fastest I could get something completely working--and the Teensy is so damn fast that it doesn't even really matter how many cycles are wasted. But for now it works just fine until something better shows itself
Last edited by rcjetflyer2; Sep 15, 2020 at 12:52 PM.
Sep 15, 2020, 04:10 PM
Registered User
Well if Amazon had sent me the right board, I could test the following enhancements:

1)Cleaned up MPU6050 handling, with selectable full scale gyro and accel values
2)MPU9250. Connected via SPI2, reads gyro/accel/mag. Full scale values selectable too.
3)MPU6050/MPU9250 selectable via #define statements
4)SBUS receiver inputs

Once the MPU9250 is proven, the Madgwick attitude estimator can be changed to use the mag readings too.

In theory, the correct Teensy board should be here Thursday.......
Sep 15, 2020, 10:01 PM
Certified Nerd
rcjetflyer2's Avatar
Thread OP
I have the code for the 9DOF madgwick filter on hand, just need to tune it well once I find time to get my 9250 talking to Teensy... Any way to keep the 9250 on I2C? I want to (try to) keep things simple and standardized and don't care so much about speed, since the unregulated code already runs at above 3.5kHz

Anyways, first few tutorial videos will be coming this weekend I think--I'll start with the hardware setup, then probably speak on radio setup and calibration. Then I'd like to focus my time toward getting the next version rolled out, which includes necessary updates to the documentation as we go along. In the next 4-5 weeks I'll be building a simple bicopter tailsitter and showing the full process setting that up from default quadcopter code to flying and transitioning VTOL
Sep 16, 2020, 02:33 AM
Registered User
Ordered a Teensy and IMU
Just want to thank you for all you work on this project.
Regards,
Nick.
Sep 16, 2020, 09:51 AM
Certified Nerd
rcjetflyer2's Avatar
Thread OP
Really excited to see what you all start building and flying with the code! I look forward to helping get things set up, and would love if you all sent me your videos (here or email) to include in the docs

I want to just set a reminder here, that the code is still pretty early in development and will most likely never compare in performance to something like betaflight for a racing quad, simply because the code wasn't built for that. We'll be doing what we can to get it closer to that point, but for now, VTOLs has been and is the goal
Sep 16, 2020, 04:00 PM
Registered User
MGeo's Avatar
Test rig pics attached. First is Teensy 4.0 with a MPU-6050 (GY-521). In the foreground is an MPU-9250, waiting to test jihlein's code

Also attached is a screen cap of test code running, printing out PirthRollYaw filter data. Looks to be responding as expected to pitch/roll/yaw motions.
Sep 16, 2020, 06:02 PM
Registered User
" Any way to keep the 9250 on I2C?"

Yes, but there's a good reason not to. I've had trouble with overclocking I2C devices in the past, and currently the MPU6050 is overclocked 2.5 times the spec sheet max, 1MHz compared to 400 kHz. It may work for some MPU6050's, but not all, and if it locks up in flight, well........

That's just my opinion, FWIW. We could see what loop rate could be maintained moving the I2C clock back to 400 kHz.

SPI is a much better choice, again in my opinion. And keep in mind that the MPU9250 will be reading about half again as much data once the magnetometer reads are implemented (I'm currently just getting the gyro and accel working. The device setup is using a 1 MHz SPI clock, the device reads are using a 20 MHz SPI clock.

The SPI connection is more wires, and a little more difficult to solder since it's using the small pads on the bottom of the board. This was to prevent messing around with any of the current pin definitions.

Amazon sent me a Teensy 4 with pins, not want I wanted/needed in the end. I don't want to solder to it, so can't test the MPU9250 yet. But I've tested the MPU6050 mods, and they work. I got my issues with PPM sorted out (my mistake), so that works. I will try sBus later tonight.
Sep 16, 2020, 07:07 PM
Certified Nerd
rcjetflyer2's Avatar
Thread OP
Just checked, 400 kHz i2c is too slow for 2khz loop rate, ughh... I've used two different gy-521 breakouts from two different manufacturers and no issues yet with the 1MHz read speed though

Let's keep the 9250 on SPI then, and I will add a special section in the docs for setting that up as an option (including hardware and necessary uncomments/comments in the code to select the 9250 over 6050), but not as part of the default recommended setup
Sep 16, 2020, 08:09 PM
Registered User
That works, best of both worlds.

Raw SBUS checks out. I need to do some scaling work on both my TX program and the code to get the channels in the correct order and the range scaled properly. The SBUS code requires the sbus library from:

https://github.com/bolderflight/SBUS
Sep 17, 2020, 01:50 PM
Certified Nerd
rcjetflyer2's Avatar
Thread OP
First tutorial video showing the recommended default hardware setup, hopefully this gets some of you started with your build as parts start arriving:

Building the Flight Controller Hardware - dRehmFlight VTOL (10 min 52 sec)
Sep 17, 2020, 02:16 PM
Registered User
Quote:
Originally Posted by rcjetflyer2
the Teensy is so damn fast that it doesn't even really matter how many cycles are wasted. But for now it works just fine until something better shows itself
Well, I am kind of drooling over what could be done with all those processor cycles if they were not wasted! ;-)

But first things first! 1) get it working and flying in a quad and 2) get transitional mixers working

Thanks
Bob


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
New Product Radiolink-Byme-A-D Flight Stabiliser Flight Controller Gyroscope Self-stabilization Merch Banggood.com 0 Aug 13, 2019 09:45 PM
Discussion 3 Axis-A AUX Control System Gyro Flight Controller Stabilizer For FPV Flying Wing EDF scousethief Banggood.com 0 Aug 05, 2018 06:58 AM
Discussion Is there a fixed wing flight stabilizer that can control yaw by thrust vectoring? jamieFL FPV Equipment 23 Apr 01, 2018 11:46 PM
Discussion OpenAero-VTOL Flight Controller Introduction Ran D. St. Clair 3D Foamies 0 Oct 05, 2015 03:34 PM