Flight Controller without RC receiver
« on: April 27, 2016, 11:53:19 am »
I am hoping this knowledgeable community can assist me.
My application is a bit different than usual and I am struggling to find the info I need to choose a suitable flight controller.
 
I would like to build a simple autopilot system that gets activated by a simple on/off switch whilst the aircraft is airborne (fixed wing).
 
The must haves are:
 
1.       Must be able to function without a radio control receiver
2.       Must be able to control a single aileron trim tab servo (standard RC type servo)
3.       Must be able to maintain wings level and magnetic heading
4.       Must be as simple as possible to create, program and operate
 
The nice to haves are:
 
1.       Interface to a GPS with NMEA GPS output string to follow GPS target waypoint bearing
2.       Maintain altitude by controlling elevator trim servo (this is NOT a standard RC type servo but a linear actuator currently operating via simple up/down pushbutton with position feedback on simple LED bargraph display)
3.       Flight tracklog for later download, ideally stored directly onto USB flashdrive or datacard
4.       Datalogging of other user defined variables eg. engine temperatures, vibration, rpm etc.
5.       Display various bits of data on an onboard LCD display for diagnostics.
 
My research have come up with the OpenPilot Revo Flight Controller but I really need a bit of expert opinion. I am not sure if it can function without an RC receiver and do what I need? I am just trying to get it working ASAP and hopefully in a neat robust and reliable way that I can keep tinkering with later and add more cool features.
I hope to hear from you soon!

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Flight Controller without RC receiver
« Reply #1 on: April 27, 2016, 12:08:58 pm »
HI, welcome

Looks like a Santa Claus list :)

All is possible, but this may need to do many changes inside current code source to allow arming and operate without Rc radio.

Do you have some knowledge about programming ?
https://bitbucket.org/librepilot/librepilot/src

Removed cross post


Re: Flight Controller without RC receiver
« Reply #2 on: April 27, 2016, 12:12:10 pm »
Hi and thank you for the reply.

Yes I do have some programming knowledge but was hoping there is a relatively simple way around the requirement for a receiver.

Or perhaps I need a different board other than a Revo?

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Flight Controller without RC receiver
« Reply #3 on: April 27, 2016, 12:51:59 pm »
Revolution board is the only that can do all you want here + big work inside firmware.

Re: Flight Controller without RC receiver
« Reply #4 on: April 28, 2016, 02:03:48 am »
What about if I only needed the "must haves" that I have listed. It seems very simple, just one servo and follow magnetic heading but function autonomously i.e. without any failsafes or arming preventing operation without radio controller and/or receiver.

I just don't want to reinvent the wheel.

How do I bypass the requirement to need the receiver? Am I better off going with APM?

jbarchuk

  • ***
  • 129
Re: Flight Controller without RC receiver
« Reply #5 on: April 28, 2016, 03:45:14 am »
Second, what you want to do is already possible. BUT it will require some sort of electronics to tell the FC what to do. More about that later.

First, what you describe may be potentially illegal in the US. (And if it is here it'll be illegal in many places.) Now that the FAA has declared that RC aircraft over (I think) 5oz (or whatever number) are under their domain (which they always have been but with fewer restrictions) those restrictions come with much more oversight and review and PENALTIES for violation. The longtime agreement between FAA and the hobby crowd has been about remote CONTROL. What you describe is remote-no-control. Meaning once the vehicle's programmed action is started there is NO WAY TO STOP IT. That's verrrry scary. What I'm saying is that remote-no-control *may* be a violation. Only your lawyer knows for sure. You have a lawyer, right? If not I strongly suggest you get one.

OK, back to 'second.' :) This exercise is actually quite trivial. The FC responds and is commanded by PWM or PPM inputs. One or more inputs control the flight mode. If the FC is programmed such that '1300ms PWM on pin 'x' means execute an autonomous flight plan,' then program an Arduino or whatever other microcontroller to output the 1300ms signal when button 'y' on -that- other control board is pressed. So, the aircraft is sitting on the runway. The batteries are plugged in, the FC and ESCs are hot, and it sits there and waits doing nothing. There's a button mounted on the outside of the aircraft. Push that button and whooosh off it goes. But back to 'First' (see above,) whatever that flight plan is will be executed and NOTHING CAN STOP IT.  Verrrry very scary.

I half thought about not writing this post because it describes how to do something that is 'out of bounds' by AMA and probably FAA policies. However I'm sure you or someone else would eventually think it up so here it is.

You need a lawyer. If he says 'go' then you need LOTS of insurance. Not kidding.

Re: Flight Controller without RC receiver
« Reply #6 on: April 28, 2016, 04:42:09 am »
No wait, I apologize for the confusion!
I am not building some sort of autonomous missile or something or trying to do anything illegal.
I am trying to build a DIY autopilot for my real life manned aircraft in which I am the pilot myself. It is an experimental homebuilt aircraft and I am allowed to modify it etc.
I retain control and will always be the pilot, the autopilot does not control primary flight surfaces, only a trim tab on the aileron. Even at maximum deflection it is easy to overcome any force that the autopilot may exert through this small trim tab by simple manual manipulation of the real control stick which I have in my hand. The idea is simply to enable long distance high altitude cruising without needing to hold the stick all the time.

There are many commercially available systems for this but I just want to make my own. A commercial example is for instance here:
http://www.eaa.org/eaa/eaa-news-and-aviation-news/bits-and-pieces-newsletter/09-2015-innovative-eco-autopilot-for-homebuilt-aircraft

Another advantage of building it myself other than the cost saving and personal satisfaction is that then I can do more than just autopilot functions like engine data log and monitor etc.

Sorry for the confusion, I can see now how you misunderstood. I just didn't want to start from scratch with a uController and invent my own PID loops and sort out all the sensor stuff etc. etc. since I know the UAV systems can allready do so much more than I never need.

Again any help appreciated to shallow out my learning curve here.

Re: Flight Controller without RC receiver
« Reply #7 on: April 28, 2016, 07:11:36 am »
I talked to someone a while back (I don't remember if it was here or back in the OP days) that wanted to do this.  I told him that I had considered something similar at one time...  :)

Then I went through some of the issues I could remember that I would have to work out before starting.  One of which was how are you going to prepare for a servo that goes dead or locks full to one side, while in the air?  Quick release?  Servo with a spring in the linkage that you can overpower?  Trim tab only for control?  Full servo can certainly happen if the wrong wire breaks due to vibration fatigue, spilled coffee, rain...  For safety, the autopilot must be in a disengaged state any time you are under say 2000 feet AGL (or whatever) or you may not be able to recover quickly enough from a low altitude servo failure.

Ahh, I see that you are considering using a trim tab which can be overpowered if there is a failure.

This post assumes you know what you can legally do.  I am not going there.  And that you will take great care for safety.

LP assisted / autonomous flight is GPS based, so you would have to have a GPS with a good view of the sky, unobstructed by metal, unless you want to write some code.  The mags on the FC also need to be usable and that means no strong fields or large ferro metal close by.  It would be possible to set what you want up as a ReturnToBase that automatically figures out the direction to fly ... or as a VelocityRoam or PositionRoam flight mode (I don't know the fixed wing details without reading up) that will continue in the same direction you start it in (with no gyro drift issues).

Be aware that our GPS control code does, assumes, requires, automatic levelling.  Also be aware that a coded turn is bank and yank (so you really need elevator too), so if you started out pointing the wrong way for whatever reason, you would get full configured bank angle for a long time to get it all the way around and pointed in the correct direction.

With a very stable, nose heavy airplane, and a shallow max bank angle configuration, and starting out pointing in about the right direction, you might reasonably do it with just an aileron trim tab (no elevator), like a single channel RC airplane (but with throttle control for altitude).

There is a "ground vehicle" mode that is "rudder only" if you must set it up maybe on rudder and do the levelling yourself.  I wouldn't do it that way.

RTB would require something electronic that acts a bit like an RC transmitter and receiver and generates "centered" stick signals for all the controls you want to have controlled (ail / ele) with the FC set up to fly in manual mode.  In manual mode, the servos exactly follow the sticks and the sticks are "centered".  This "something electronic" is where you would have a switch to switch from this "manual mode with center sticks" to RTB.  A transmitter shaped joystick would work and would be good for testing too.  It would also be a good place to trim the trim servos to achieve level flight during testing.  You would want to do mechanical trim adjustments to remove the testing trim.  This joystick would be good for manual testing of servos / trims to see how well it controls the aircraft.

How are you handling real trim changes if the trims are used for FC control.  Make sure that the trims have enough authority to handle actual trim changes plus course correction.  Maybe you need a manual trim adjustment as well.

You can't just fall asleep at the wheel or it could gently fly you into the ground or a near by mountain due to reduction of GPS accuracy (e.g. from 3D to 2D).  And any set of functions that tries to maintain altitude (RTB does) should be aware of minimum airspeed and know how to handle the case where the motor looses power.  With trim tabs only, and a pilot who is always watching ...

I would want to fly a model with similar handling characteristics as the full scale plane to play with settings and tune Rate mode and Attitude mode response times.  Your response time will be very very slow on a full scale, and much slower even than that because you are only using trim tabs.  What would normally be seen as a oscillation with a frequency of several times per second could be as slow as once a minute or so for you.  I would guess this would be OK, but nothing that slow has been tested.  You might want to reduce your max gyro rate from 2000 degrees per second to something less to get more accuracy, and that alone would need testing (it's not tested regularly).

Our FC doesn't require an RC receiver, but if I were doing it, I would want at least a transmitter shaped joystick in my lap for air testing manual control of the FC before using the autonomous functions.  RC receivers and some joysticks can output signals that the FC can read.  Is having an RC receiver connected a legal issue?  If not, then an RC receiver that has failsafe would be perfect and no code would be required.  You take the transmitter with you for testing and it talks to the receiver and acts like the joystick I described.  Once you get testing complete, you set the RC receiver failsafe to have the values that you need for centered servos and fly without a transmitter with centered servos.  Disconnecting the receiver from the FC with a switch causes the FC to go into FC failsafe which can be programmed for any mode you want; RTB, VelocityRoam, PositionRoam including the stick positions.

I would definitely use the transmitter shaped joystick or transmitter / receiver to get it working.  If you don't want a receiver on board, and you can do some code once you get it working (fairly simple if you already know the code), you can remove the joystick, and hard code the "centered" control sticks and make it think there is a valid joystick / receiver connected when there isn't and use a port (e.g. Flexi or Main) to connect a single switch to force FC failsafe mode.

Have you looked at the code?  There is a learning curve.  :)  That is unless you actively want to dive in and understand it.  There is a good bit to learn just to make any changes.
« Last Edit: April 28, 2016, 08:49:04 am by TheOtherCliff »

jbarchuk

  • ***
  • 129
Re: Flight Controller without RC receiver
« Reply #8 on: April 28, 2016, 07:17:44 am »
No wait, I apologize for the confusion!
I am not building some sort of autonomous missile or something or trying to do anything illegal.

I knew that. I would have not replied at -all- if I thought so. I would have forwarded your post to the local FBI and clicked [next]. :) We did had an incident where people showed up at the field and asked questions that sounded a little... hinky. They didn't get much cooperation or information and never came back.

Quote
I am trying to build a DIY autopilot for my real life manned aircraft in which I am the pilot myself. It is an experimental homebuilt aircraft and I am allowed to modify it etc.
I retain control and will always be the pilot, the autopilot does not control primary flight surfaces, only a trim tab on the aileron. Even at maximum deflection it is easy to overcome any force that the autopilot may exert through this small trim tab by simple manual manipulation of the real control stick which I have in my hand. The idea is simply to enable long distance high altitude cruising without needing to hold the stick all the time.



Quote
I just didn't want to start from scratch with a uController and invent my own PID loops and sort out all the sensor stuff etc. etc. since I know the UAV systems can allready do so much more than I never need.

Exactly. No point in reinventing the wheel. Find the best wheel available and use it.

Quote
Again any help appreciated to shallow out my learning curve here.

What I said still applies. I've never done it myself maybe someone who has can talk about it. PWM in is not rocket science. The signal that your linear actuator requires is the next Q. Heck it might be as simple as PWM which will make things drastically easier because that's what these FCs output. If it's some other signal then you may need another converter.

The recent SpaceX barge landing of the 1st stage rocket WAS rocket science!!! Literally and figuratively!!! I was friggin stunned. I'm still not 100% sure if it wasn't a faked hologram CGI of some sort. ;)