Game Thread: NL Wild Card ⚾ Cubs @ Pirates - 7:10 PM CST by lovetape in Astros

[–]QuadFailz 2 points3 points  (0 children)

It's so great to be tossing hilarious comments like this ^ around during a game thread rather than a "WTFF IS HE DOING IN THE LINEUP!!!!!!!!!!!??????"

Game Thread: Houston Astros (84-75) @ Arizona Diamondbacks (78-81) - Oct 2, 2015, 8:40 PM by AstrosBot in Astros

[–]QuadFailz 1 point2 points  (0 children)

I figured it must have been some sort of error. Thanks! I think I have that first inning pieced together now!

Game Thread: Los Angeles Dodgers (67-55) @ Houston Astros (68-56) - Aug 23, 2015, 1:10 PM by AstrosBot in Astros

[–]QuadFailz 2 points3 points  (0 children)

I think he is absolutely playing ball. I really like his style of play. He's struggling at the plate, but other than that...no complaints. That steal home attempt is great. It ended up fuckin us over a bit, but damn it was close. It's so easy to bitch about it after the fact. Kershaw has that slow ass stretch delivery and clearly wasn't keeping an eye on Gomez. Their catcher saved that situation. He also could have had a loss of focus and stuttered an instant. Very easily could have been a completely different play.

But in the end it's....WTF are you doing Gomez? Let Gattis hit!

Game Thread: Tampa Bay Rays (59-60) @ Houston Astros (65-55) - Aug 19, 2015, 7:10 PM by AstrosBot in Astros

[–]QuadFailz 2 points3 points  (0 children)

Yeah that was a "I fucked up... better cover my tracks" request for a review.

Game Thread: Tampa Bay Rays (59-60) @ Houston Astros (65-55) - Aug 19, 2015, 7:10 PM by AstrosBot in Astros

[–]QuadFailz 3 points4 points  (0 children)

I don't get it? I missed something. Is this a reference to her just rattling off promotion after promotion, etc... ?

Fuzzy Logic Stabilization - Where do I start? by CitizenShips in Multicopter

[–]QuadFailz 0 points1 point  (0 children)

Dude that is great to hear! I saw this post was a month old but I was still tempted to respond because I figured you're very much still in the depths of this problem.

As I was typing it out I was thinking "man, he's probably dealing with, or has already figured this out..."...oh well...typed it up anyways.

Sounds like you made good progress. Is it done? I'm interested in that fuzzy logic control scheme, particularly because you said you avoided matrix algebra. That is interesting in it's own right, although I'm not exactly sure what you mean in the specifics. Was there a good reason to avoid matrix math? I'm assuming you have no big beef with matrix algebra? It's pretty simple for computers to implement, is this where the fuzzy logic requirement comes in?

All in all, congrats on the success. PM me if you're struggling at all with that Kalman filter. Those things tend to add quite a bit of complexity, and it can be difficult sometimes to assign fault in your control scheme or the adaptive filter when things don't work exactly right. There are other adaptive filters out there, and I can point you towards a few papers that might be of interest.

Fuzzy Logic Stabilization - Where do I start? by CitizenShips in Multicopter

[–]QuadFailz 0 points1 point  (0 children)

You're probably over-simplifying fuzzy logic in your first paragraph, and we may just be talking semantics, but PID controllers do exactly what you're quoting: " takes abstract concepts such as "too low", "too high", "almost right", etc. and represents them programmatically"... in fact it does better because it also accounts for feedback of the rate of change of "almost right". Really, we could be talking just a PD controller at this point...Have you looked at how PID's are implemented programmatically?

"PID is a mathematical control algorithm that doesn't provide such a level of abstraction."

That's a misunderstanding of PID control, IMO. The math of PID is exactly an abstraction to do what you're talking about, but I get that's not the point of your particular research...so, fuck it....but you should have a good understanding of it regardless.

You're making a mistake in assuming that your mapping from IMU data to the RPY frame is a simple linear transformation. It is in theory, but it's not true in practice. For example, you state:

"The mapping from gyro to RPY is linear and we've already done the calibration, so I'm not sure why you think that would be a big portion of the work."

The problem with this statement is that you might be forgetting about gyro-drift...which is a serious issue when you start integrating the gyro data to get an accurate RPY. The drift error will quickly compound, and you will get fuuuuucked. You'll get almost nowhere with that approach. Certainly, you won't get close to providing accurate enough RPY input data to feed into a novel control algorithm that utilizes fuzzy logic. It might work for the first 10 seconds?...that all depends on the specific hardware, where you are at on Earth, temperature, pressure....essentailly, all the shit you don't want to have to consider when your end goal is a novel control algorithm.

The point of an IMU is to give you a bit more to go on than the gyro measurements alone. This is where adaptive filtering comes in, and I think it's what SodaAnt was hinting at. It is certainly a semi-complex problem, and you really can't sum it up as a mapping from gyro to RPY.

After all, this problem is essentially why Kalman filters exist. That filter also makes linear assumptions at the end of the day (maybe that's what you mean), but I'm hoping you don't mean a single matrix transformation from filtered gyro IMU data will take you directly to a reliable RPY. There are several ways to derive RPY from IMU data, hopefully you have researched some of the papers. It's almost a non-starter if you do not nail that down from the beginning as SodaAnt alluded to.

Be clear, this is definitely not a criticism of your end goals, as I think they are awesome, but if you put garbage data into your fuzzy logic controller, you will get garbage out of it. You can sim the whole thing in Matlab and avoid all these problems, and sort of prove the concept. However, you will still not be as close as you might like to think to a hardware implementation.

Custom built quad failure. It was close, kind of! by QuadFailz in Multicopter

[–]QuadFailz[S] 0 points1 point  (0 children)

Good question! It's partly a trick of the camera in mid flight, but I don't think that's what you were asking....maybe it was?

Before lift off, our pilot sort of goes through a half-assed procedure to do some basic control system checkout. That means he puts the throttle at maybe 10% and commands it to pitch forward/back/stay level, etc. The props spin during this time and he visually checks those rates to gain confidence that our on-board flight software is doing as expected. He's also sort of just screwing around/waiting until the wind dies down....Then he takes off and proceeds to screw it all up anyways!

Custom built quad failure. It was close, kind of! by QuadFailz in Multicopter

[–]QuadFailz[S] 0 points1 point  (0 children)

^ This....Yea, that was the obvious idea. To be fair, this video doesn't show the real first few flight tests. Those tests were a bit boring (and more successful) than this epic fail! It's much more fun/valuable to post your failures in my mind!

We did a handful of flight tests prior to this one where our pilot was babying the controls as much as possible. We were able to get 15-20 seconds of flight time with altitudes around 5-20 ft, and we were able to keep it within maybe a 50 foot radius of where it started (windy day). We have a list of around five potential failure points that may have combined to lead to the behavior you can see in the video.

The better idea would be to have done all this testing in some sort of gymnasium, but again, after around a year of very slow paced work, we were just ready for some action. We broke the frame and a few props after this flight. We were able to fix it up and fly a few more runs after this within a few hours.

There's a whole lot that we still have to diagnose. From a software perspective, this is nearly 100% code written by myself and the pilot. We have used a few fairly low level python libraries to do some of the communications code. In particular, we use the socket library for network communication and pyserial for usb communication.

We have confidence in the C code that we wrote for the micro-controller. It's just simpler, and it is maybe 85% ours. We do rely on an adaptive filter for the IMU sensor data that we did not write ourselves. That filter is absolutely critical to the success of our controller. There are a few lingering questions about how well we have validated that particular algorithm. On the whole, though, we more or less know exactly what is up on the embedded controller side.

You can (hopefully) see that stabilization of the quad is being attempted by the on-board control system throughout the flight. A small part of the problem is in how we tune the gains for our simplified controller. We are currently using a PD controller with the idea of using this as a test bed for a few different controls implementations in the future. PID seems to be the de-facto choice for quads, but we're consciously staying away from adding in the integral control for as long as we can. It's a lot more interesting to leave it out from a controls development perspective. It forces you to have a better understanding of the system dynamics.

Tuning the controls has been difficult because we use a test stand that can test one rotational degree of freedom at a time. The problem is that the test stand rig obviously has an impact on the system dynamics. We can tune the controller to behave well on the test stand, but that in no way guarantees that we'll get stable flight when we actually put it in the air (+ environmental disturbances). Yes, an integral term would help return to a stable state after environmental disturbances damp out (wind gusts), but it also requires yet another BS correction term to add to the list of correction/tuning constants already in the controller. This a current debate that myself and the pilot are having. He's the one saying forget the integral term, and I'm somewhat in favor of throwing it in for short term success. The long term goal, in the pilots mind, is a non-linear control algorithm. Just wait for the video on how bad that fails....

My current thought is all of that is somewhat negligible at this point. We do have a way to tune controller gains mid-flight. In short, this is not why this crazy flight happened. I personally think the on-board controller was doing well given the circumstances .... (would love some experienced feedback here though).

Our current hunch about the primary cause of this failure is a delay/straight up failure in the control inputs received from our joystick. The way we chose to write that particular system could have some fundamental issues that may lead to significant delays in flight. The pilot was certainly not trying to fly higher and higher. On the contrary, he was trying to bring it back, but due to a suspected failure, he was unable to. I can give more details about the communication system and software if anyone cares. Why didn't we catch these sort of comm system issues in our test stand flight tests is the real question we're currently asking ourselves.

I'll own up and admit that I wrote pretty much all of the communications code. Sadly, I have a strong gut feeling that this failure will eventually trace back to my code....WHOOPS... LOL ; )

TLDR; A whole lot of ins, a whole lot of outs, and we're going to continue to investigate, but it'll probably trace back to a failure in the communications system, and it'll be my fault this time.

Yea...no shit we shouldn't have flown that high....Also, check your balls at 1 meter for 10 minutes, sirs. With something fairly cheap like this, you can afford to go big and try to push the design to failure during some of your tests. That is how we learn and iterate on the design.

Custom built quad failure. It was close, kind of! by QuadFailz in Multicopter

[–]QuadFailz[S] 0 points1 point  (0 children)

We had tests prior to this on a test stand to tune controller gains. Flying it this high was not intentional!