More crazy homebrew FC experiments

jhitesma

Some guy in the desert
Mentor
I got to fly another half a pack through it this evening during my wife's lunch break. I'd have flown a full pack but it was dark and the neighbor kid kept getting close after I repeatedly warned him to back up. I'm glad he's curious but he doesn't take my warnings about the props very serious even after I showed him my scars from the warp attack. I think someone already convinced him that girls like scars and he's almost old enough to care what they think ;)

Just the elevator was backwards, and I'm really not sure why. I still haven't got the widget in GCS working to see my stick inputs - and the setup wizard does goofy things when I try to setup my RX with it. On the manual setup the elevator seems correct so I'm really at a loss as to why I had to reverse that channel.

The evening flight I got to try all 3 flight modes I had setup: Leveling, Rate, and Horizon. They all felt pretty good, a little sluggish but I was on stock PID's. They all felt VERY stable, noticeably more stable than MW 2.3 feels.

From what I can tell "leveling" is basically like MW's Angle mode. Tau supports a lot of flight modes and I'm curious to try them out:
https://github.com/TauLabs/TauLabs/wiki/Flightmode-Settings

It also lets you setup custom modes where you can mix and match, so you could have Horizon on roll and leveling on pitch if you wanted to for some reason. It's a remarkably flexible system.

That antenna is for my 440mhz openLRS, but it's not in use right now and is just kind of hanging back there. I had to add a male/male barrel connector and an angle connector to get it attached to the module since I couldn't find a male male angle connector. But I worry about the stress it puts on the SMA connector on the module sticking out that far so I had to tape it to the handle on the back of my TX for support (I'd like to make a little printed plastic clamp to replace the tape, but don't have a 3D printer yet...one is in the works but not sure how long it will take.) I'm too lazy to retape it every time I switch modules so when I'm using one of my 2.4mhz modules I just leave it flopping around on there. I'm actually using the stock FlySky module that came with my 9x since my homemade FS RX is the only PPM RX I had on hand and I didn't want to deal with hooking up 8 wires.

I'm probably going to replace that antenna with a moxon one of these days...just need to order that coax and connectors I've been needing for a few weeks but things keep coming up and claiming the money I set aside just before I can order :(

BTW - Found out that Peabody124 the lead developer behind Tau is aware of this thread and seems excited about my experiments as well. So that was a nice little surprise tonight :)

Debating whether to deal with mounting the board properly tonight or working on the BMP code some more. Probably going to stick to code, don't feel like doing mechanical stuff right now and I'll feel a lot better about sealing the sensors up in the frame once they're all working.
 

Balu

Lurker
Staff member
Admin
Moderator
BTW - Found out that Peabody124 the lead developer behind Tau is aware of this thread and seems excited about my experiments as well. So that was a nice little surprise tonight :)

I might have something to do with that :)

https://twitter.com/peabody124/status/519982439918104577

I'm really looking forward to that board since I'm also having problems with the Naze32 for a more "laid back" type of copter I'm building for a colleague.

What you are writing about Tau looks very promising.
 

Twitchity

Senior Member
Very nice, jhitesma. So once you get this flying nice, are you going to look into making your own FC with TL installed?
 

jhitesma

Some guy in the desert
Mentor

Ah ha :D And I agree with peabody - I'm very much enjoying the journey this way even if it might be the long way :) I'd love to get my hands on a Sparky2...but I'm not in a big rush. I'll let those more familiar with Tau deal with testing while I bootstrap myself ;)

I am kind of tempted to pickup a sparky1 though. I want to get some more stick time with my setup first though to see how the acro/rate mode feels once I get it tuned. The default PID's only have P terms set no I or D but I was still impressed with just how well it flew. At lunch today I'm probably going to give autotune a go and am very curious to see how it does.

Honestly for the price and based on my initial test flights I would have no problem suggesting the Sparky to someone who wants something more capable than MW/KK/Naze but doesn't want to go APM. (I'd still like to get my hands on an APM to try someday to see just how valid the criticisms I've heard about it are.)

I'd still recommend a Naze for an acro machine. But for anyone who wants more than just rate mode I'm really thinking I'd suggest the Sparky over the options out there right now. The GCS is a bit overwhelming, but the wizards make setup so much easier than any other FC I've tried yet and you can learn the rest of the GCS as you go.

Twitchity said:
Very nice, jhitesma. So once you get this flying nice, are you going to look into making your own FC with TL installed?

I'm not ruling it out, and x0054 is itching to try routing a board if I do a circuit...so it could well happen.

Right now my big plan is to cleanup my repo and the changes I made to the code so I'll be in better shape to share things back to the official repo if I make any changes worth sharing. Right now I've just been working in the main 'next' branch which really isn't the best way to do things. I need to make my own branch and make my changes there. Once that's done I'm going to take the flyingf4 target and try to make my own customized target in my own branch based off the flyingf4 to get a feel for how to add a new board to the project. Once I've got that under my belt I'll start trying to draw up my own board. We're a pretty long way off from that though. I wouldn't get too excited about seeing me make progress on my own board for a few months at the absolute soonest. Like Peabody in his tweet I'm not one to set deadlines on myself for my hobby since that kind of takes the fun away :D

I've also been trying to get HITL simulation working but think windows is getting in my way. HITL is "Hardware In the Loop" and basically lets you "fly" the hardware/firmware in a simulator. I haven't got it working yet though and even if I did I suspect my computer isn't powerful enough to actually pull it off. My good computer probably can, but it's on Windows 7 and I've seen a number of posts about HITL not working right on Win7.

Maybe this weekend I'll try and find time to get a VM setup on my good computer and get GCS and Flight gear on there and give HITL a try on that setup. OpenPilot has more details about HITL on their wiki:
http://wiki.openpilot.org/display/Doc/HITL+and+SITL+Simulation
 

jhitesma

Some guy in the desert
Mentor
So over lunch I did a bit more testing. First just a quick shakedown to see if my tweaks last night had the intended results. Looks good, motors now spin when armed like I like (I used the vehicle setup wizard to set the min values - one interesting twist here is that TL uses a separate value for each motor instead of a single mincommand value.) And I found a checkbox I had missed to enable "motors spin at idle" which I thought was the default setup, but maybe that varies from board to baord and flyingf4 doesn't enable it by default.

With that done I went into the backyard for a little test flight. It had been dead calm all morning but of course by the time I got a chance to fly we had a nice gusty breeze that kept shifting directions. But for a test flight on stock settings I was very impressed with how it felt:


It was a bit sluggish on the sticks, felt kind of heavy and slow to respond. But with stock P's and no I/D set I'm not shocked by that at all. And I haven't even begun to look at the rate settings, the yaw is way slow for my taste still. And despite me questioning myself in the video I did confirm that I flew in Attitude then Horizon and then virtual flybar. Horizon felt a bit off though - it seemed to be more rateish than horizonish and wasn't really trying to self level very much. I still found it easier to fly than rate on MW/Naze but it didn't really feel like Horizon either. Virtual Flybar felt kind of odd. The description of it is:

This is an advanced variant of rate that has a lot more flexibility to change the feel. The roll and pitch axis are both set to Virtual Bar (see below for details and tuning) and the yaw axis is assigned to Axis Lock.

Also described as:

This mode is released in the upcoming firmware, for helis it can be compared to a standard flybarless controller and for multi rotors a much more aggressive roll and flip rate can be achieved. More information can be found here.

Though there is no link to that additional information :( And I couldn't find anything about the additional flexibility alluded to in the first description. Might be something that can be tweaked through the UAVObjects and not the GUI. Not sure. It felt "interesting" in the air. Not bad, not great. It did compare to rate but just felt a little...I don't know...different.


So, with that quick test flight confirming it was flyable I decided to toss caution to the wind and give this autotune thing a try:

(At the time I'm posting this the video still shows as processing so it may not work right away.)

Probably wasn't the greatest idea to try this with the shifting breeze we had today, but I just had to give it a go. Keeping it in the air while it was dancing wasn't hard but did take some concentration. It sure doesn't sound happy with the motors pulsing like that though! I'm not sure if I actually saved the new settings to the FC or not, I'm pretty sure they were active because it felt a LOT better after the tuning - but I never went back to the stabilization tab and confirmed that the new settings really were set.

And this is on the default autotune settings, I'll play around later with adjusting the settings for smoother vs. responsive flight and see how it feels with different tunes.

But after that round of tuning I definitely felt a BIG improvement in how it handled. I only had attitude and horizon modes configured and while horizon still didn't feel like MW horizon (more like a rate mode as it didn't seem to be leveling) it really did feel both more responsive when moving and more stable when hovering. I'm impressed.

Might get to do another test flight this evening before dark. Will try and bump the rates up a bit more and see if I can go for a flip or two as well as getting rate mode back as an option to see how it feels with this tune.

The one thing I've noticed about Tau that I'm not big on is that it seems much more reliant on it's GCS than MW/Naze are on their config programs. There don't seem to be stick commands for anything, it all has to be done through the GCS or android app. And so far I haven't found a use for the aux switches at all. I'm feeling really limited by my 3 pos mode switch as a result. On MW/naze you can use an aux switch to turn on the baro for altitude hold in any mode. On Tau altitude hold is a mode and while I haven't tried it yet it sounds more like a Naza type of "vario" setup where your throttle sets climb/descent rate instead of throttle. If I get the BMP working I'll be interested to see how that feels in the air.

My impression of Tau just continues to improve, I'm very curious to see how the rate mode feels now that I have the autotune working.
 

jhitesma

Some guy in the desert
Mentor
Here's a bit more on VirtualBar from the OpenPilot wiki (Since Tau is a fork of OP when docs on Tau are slim OP sometimes can come to the rescue.):
http://wiki.openpilot.org/display/Doc/Virtual+Flybar+Mode

Looks like I was right about having to tweak the UAVObjects directly to tune it.

Interesting that it's MW inspired, I wonder which mode on MW it's inspired by....
 

jhitesma

Some guy in the desert
Mentor
Got to fly two packs through it after work and compare attitude/rate/horizon/flybar modes a bit more. Gotta say, I'm loving this thing. I've only been flying on the low default rates, but it just feels so much smoother in how it responds I'm blown away. This quad never felt this good on MW.

Even in rate mode it flies easier than it did in Horizon with MW.

I haven't gone for any flips yet since I'm still on the default rates. But I just bumped up the rates and gave it a quick test fly and am pretty sure it will flip no problem tomorrow.

Only problem is my Zippy packs are definitely toast. Flew one that was freshly charged and only got about 2 minutes of flight before the quad suddenly fell out of the sky. Pack was hot to the touch and mighty puffy. After resting it was reading about 3.4v per cell. Figured it wasn't doing so hot when I noticed my LED's dimming on throttle punches. For a 40c 2200 I'd expect more.

So right now I have exactly 1 good pack to fly this on :(

I don't know that I'd replace a Naze on an acro quad...but on just about anything else I'd gladly swap to this as I'm loving how it feels. Really excited to try and get my bmp085 working now and then wire up a GPS and see how it does. Just not sure how long it will take me to get the 085 going :(
 

x0054

Senior Member
Just got a chance to look at your vids. Autotune on TL is really interesting. It looks like it's doing both roll and pitch at the same time. On cleanflight and APM it does first the roll and then the pitch, as 2 separate tuning sessions. I think in general it's a good idea to do both at the same time, makes it a little more organic.

I tried to get my head around the VirtualBar, but without flying it, it's hard to really get it. Ok, so now I want to get a TL setup on my next tricopter! :)
 

Twitchity

Senior Member
I am extremely impressed with that board. I have three Naze32 boards now, so I think I'll be giving TL a try next. I'm going to have to start reading up on how to work with the software to program that board.
 

jhitesma

Some guy in the desert
Mentor
Yeah the autotune is pretty crazy to see do it's thing. Oh and I was mistaken in my description of how it works earlier - the calculations are NOT done in GCS they're all done on the board. Apparently I got mixed up when I was reading the discussions about how they were going to implement. The original plan was apparently to do the heavy lifting in the GCS but apparently they later found that wasn't necessary. As it stands you don't need to connect back up to the GCS to try the new settings - but you would have to connect back up to review them (which is a good idea to do before trying them!) and to save them as the new settings. But after doing a test flight like I did you can land and disarm then take off again and try the new settings immediately if you're brave.

Twitchity, I really am impressed with it. There are some things that I'm still getting used to and like I said it relies on the GCS a lot more than MW/Naze. It's more like APM in that way it seems. I miss profiles, and being able to force a recalibration with the sticks...not that I've had to recalibrate. And the rate mode does feel different than naze - but still feels VERY locked in to me. And last night I noticed they started doing nightly builds of a branch that has MW's rate mode added in. So in the future it should have a rate mode that's basically identical to MW/Naze. (the PID loops may be a bit different but the control scheme will be identical.)

I really want to get this baro working...but I've got a lot of stuff to cram into my head to pull that off. Probably going to be a few weeks before I have visible progress on it. But at least I have the board flying so I can enjoy it while I toil on that :D Just need to pick up a new pack or two so I can fly it more :D
 

jhitesma

Some guy in the desert
Mentor
Sorry about the double posts, for some reason today when I try to hit "post quick rely" chrome is giving me the "you still have unsaved stuff do you really want to leave this page" message - but apparently still posting my comment whether I say yet or no :(
 

Craftydan

Hostage Taker of Quads
Staff member
Moderator
Mentor
Perhaps you shouldn't have said "Yet" ;)

Yeah, I've seen the site do this before. annoying. totally out of my power to fix the disease, but I can deal with the symptoms . . . Viola! no more double post!

(BTW, you can edit and/or delete your own posts, if you so care to )
 

jhitesma

Some guy in the desert
Mentor
Thanks, Dan. I know I can edit but always forget that delete is enabled on here as well :) And yeah, I really gotta stop yetting :D

Don't think it's a site issue though, think it was a Chrome hiccup as I've had it happen on a few other sites the past few days.


C0d3M0nk3y - I don't actually own a APM or Pixhawk (yet) I've just looked at the documentation, the software and watched a few videos/read a lot of forums. I'd love to get my hands on one to compare...but I'm not a big fan of 3DR in general and as everyone on here probably knows by now my budget is awfully strained. I did look at putting megapirate which is a port of APM for MW onto my mega board...but their code was such a mess I quickly abandoned that idea. A few times I've looked at what it would take to put APM on my mega board since that's what they developed things on...but that whole community just seems to push "just buy the 3DR stuff why would you waste your time trying to figure out how to do it yourself" which really turns me off. Especially considering if it wasn't for someone just wanting to do it themselves none of their stuff would exist in the first place. Honestly to me it's almost as bad as the DJI mindset when I wander into the DIYDrones site and start looking into APM. If someone were to give me an APM or Pixhawk to try I'd gladly give it a try...but I just don't see myself spending my money on their gear (or even knockoffs) anytime soon.


Here's the test flips from this morning...though my hatcam was a bit out of alignment so it's not the greatest video:

 

x0054

Senior Member
C0d3M0nk3y, I have an APM clone on my tricopter. I think all of 3DR's, and as a result, the Ardupilot community's effort is now concentrated on the Pixhawk, so maybe Pixhawk is completely different. But I find APM to be a little sloppy on a small craft. It flies well, but I don't get the same locked in feeling I get from the Naze board. I am going to build my own TL setup, so I'll be able to compare directly. But jhitesma says that TL is as locked in as Naze. If that's the case, then it's a grate combination. You get most of the APM features with the Naze stability.

I think on a larger craft the APM is as good as anything, and has all the features you can ever wish for. My problem with 3DR is what jhitesma pointed out. They are open-source-ish. They are really not at all happy about you running Ardupilot on anything but there own hardware. Now, I have no problem with DJI for instance. They make stuff that works. It's closed source, and they make no pretenses to be anything other then a producer of closed source products that work, and work very well for the task they are designed for, arial video.

3DR want's to compete with DJI on one hand, but also to have the "moral superiority" of open source on the other. It's a little annoying. But my biggest problem with them is the "follow me" feature they are touting so much. The follow me feature works well, I am sure, but what doesn't work is there detect and avoid system. Because they don't have one, as far as I can tell. It's ridiculously reckless to release a follow me feature without a proper detect and avoid system.

I am not saying that they should limit progress on one feature just because they have yet to develop another. But the problem is that they intend to develop the visual follow me feature and sell it as part of one of their packages to the public. Now we have a bunch of videos of people doing stupid things with DJI Phantoms. Soon we will have 3DR drones flying full speed into cars, trucks, and people, while they are following their owner. And then we will have hearings, and next thing you know, I can't fly my quad.

Of course there are already at least 3 follow me kickstarter projects. AirDog, Hexo+, and Pocket Drone. All are extremely popular. Most of those are going to be preordered by people who have never even held a remote control in their hands. Just wait for the news stories when those start hitting the streets, literally.

Ok, enough of a rent. Time to sleep :)

- Bogdan
 

Balu

Lurker
Staff member
Admin
Moderator
@jhitesma I wonder if that "picoC scripting" of TL allows to make it less dependend on GCS.

Thanks for testing all this. It looks really interesting and I'm definitely trying that on my colleagues copter which he wants to have a more sophisticated "GPS & stuff" setup.
 

jhitesma

Some guy in the desert
Mentor
To be fair, I haven't tried Tau on a smaller quad yet. On my Knuckle it feels as or more locked in than MW did and I'd say as locked or more than Naze on my 250's has felt.

But. I haven't even got this up to the park to really push it in acro mode since the way it's setup right so I'd probably knock the FC board or my RX off if I tried that :D

So remember these are early initial impressions I'm sharing at this point and while extremely positive there's still a lot of unknowns. I've still got a LOT of experimentation to do with this and I really want to pickup a Sparky to try on one of my 250's.

Balu - That's a good point. picoC brings a ridiculous amount of flexibility to this board. Heck the guy who added picoC even made a segway style balancing robot using a sparky board and picoC - using picoC's built in PID loops instead of leveraging what Tau already has. So you can do some pretty crazy things in picoC. I wouldn't be surprised if it would be possible to setup something in picoC that listens for stick commands while disarmed and can load different settings based on that similar to the MW/Naze profiles. In fact...I may have to investigate that option as I'd love to be able to switch between slower rates for FPV/filming/teaching noobs and higher rates for really having fun.


Last night I spent 4 hours hacking the bmp085 code. I managed to the the old code I found in peabody124's repo to compile but it gives an error when testing the sensor. So I'm kind of stuck on the bmp stuff right now. I can get the current "next" branch to build flyingf4 with bmp085 support and it makes it through compilation and flys...but I only get 0 back from the bmp...which is odd since the sensor pretty much has to return something other than 0 to get past initilization/testing which it seems to be doing. So I think there may be issues with the bmp driver in next and how it communicates with the core of PiOS (Pilot operating system - Tau runs FreeRTOS as the base operating system with it's own PiOS setup on top of that which provides hardware abstraction...at least from what I've learned so far that seems to be the case.)

On the other hand I can get the old code which communicates with PiOS differently (in a way I can understand easier than the way the current code is communicating) but the board won't boot because when it tries to init the baro sensor it just gets a 0 back for temp.

To debug further I'm going to have to setup proper debugging tools which is going to take me some time...at least I've got it flying in the meantime and can have some fun with it ;)
 

Balu

Lurker
Staff member
Admin
Moderator
Sorry for a quick off topic question. I never got the differences between the rates in the FC and the rates I can program in my transmitter. Of course if I have the rates on my transmitter maxed out I can make the copter move faster if I increate the FC rates too, but is there a difference between those?

I'm wondering because why can't you dial in the high rates on FC and transmitter and then dampen it for the newbies just on the transmitter?
 

jhitesma

Some guy in the desert
Mentor
Not sure how best to explain that Balu...but I'll give it a try :D

Note: this isn't specific to Tau but is generic to all FC's as far as I know...at least it applies to KK/MW/Naze/Tau in my experience.

In general due to how the math happens setting expo on the FC will give better resolution than doing it on the TX. Rate however isn't something you can really set on the TX. You can pull your endpoints in to limit the rate - but the "rate" setting on the FC works more like a multiplier than a change in endpoints. So when you have rates of 1 on Naze/MW that means you get a 1:1 mapping from what your TX sends and what the FC reacts to. If you have rates above 1 then your stick inputs get multiplied by the FC rate setting giving quicker responses while rates lower than 1 dampen the inputs.

Tau is a little different here. Instead of setting a multiplier in Tau rates are set as either "maximum degrees" for angle mode limiting the degree of tilt the multi will attain or for acro modes the rates are set in deg/s for both the rate at full stick and the maximum rate the FC will attain. Though the maximum rate you can set is limited by the rate at which the FC is setup to read the gyro - to get higher rates you have to increase the gyro rate first. (at least with the flyingf4 setup, I'm not sure what the default gyro rates are on the other boards since I haven't tried them.)

So right now I'm using a full stick rate of 360 degrees per second and a max rate attitude of 425 degrees per second. This is fast enough to do flips but still a bit slower than what I'd like but I'm working on slowly pushing them up.

Hope that helps explain it a bit. But basically changing rates/expo in the TX you just don't get the same "quality" of adjustment as you do making the changes through the FC.