MultiWii 2.3 Camera Stabilization and Camera pitch control.

Billbo911

Member
Hello FT community!
Let me start with a brief introduction. I am fairly new to RC, and even newer to multi rotors. I just built my first multi, an RCExplorer style Tri. At it's heart is a Flip 1.5 MultiWii controller. I am still learning to fly, but am improving. My goal is to get it fully FPV when my skills are ready. Right now I can record and broadcast to a ground station, but I am not flying it FPV.....yet.
Here is a quick video of where my skills are thus far.

What I am seeking help on is how to rig the camera to be stabilized in the pitch direction and yet be able to remotely set the angle of the camera to be stabilized to. For example, when I am over an object of interest, I want to pitch the camera forward and have it stabilized in that position. This would also come in handy when descending for a landing, to be able to see where I intend to land.

I use an FrSky D4R-II receiver set to PPM mode.

What I already know about the MultiWii and this application:
Tilt Servo on output A0.
Roll servo on output A1.
(Shutter release servo on A2, if needed.)
Un-comment either of the following to enable in Config.h:
//#define SERVO_MIX_TILT
//#define SERVO_TILT

Assign an AUX channel in GUI to "Enable Cam Stabilization".

What I would like to know:
How can I assign an AUX channel that can be used to set the stabilized pitch angle?

Additionally, if possible, how can I access any remaining AUX channels to control things like lights and servos. Who knows, I might want to put a "Bomb Drop" on it!:black_eyed:
 

Billbo911

Member
No reply's, no surprise

This is by no means a comment against the FT community.
I have posted this same question on both the MultiWii forum and on RC Groups. I have the same result on both of them as well. 30+ reads and 0 reply's.
I guess this is a testament to the lack of documentation for MultiWii and/or the fact that I am trying to do something that is a little far out there. But, I will not give up.

Fortunately I have another Flip 1.5 board on order as well as a few other bits. Before I do a build with it, I will investigate this use case. If there is a way to do what I am looking for, I will find it and post the results here.
 

Mustang7302

Senior Member
MultiWii is intimidating for most people and diving further into its features and configuration just isn't well documented further perpetuating the cycle. The scope of this community is mostly to getting people acclimated to the hobby and technologies involved and not as much on pushing further down the rabbit hole.

I all but skipped over MultiWii in favor of a Naze32 and its Baseflight configuration software. The Naze32 is a 32 bit port of the Multiwii code, but Baseflight simplifies a lot of things and parameter changes are made through a command line versus Arduino code. I currently have a FPV camera mounted to a servo, the servo connected to the Naze32, have a aux channel mapped to control the servo, and use both a manual adjustment as well as a mix to help keep the horizon in the view during extreme angles of attack for high speed runs. For this setup it doesn't auto-stabilize the pitch of the camera, but there is a bit of pilot aid from the mix with pitch input. If you decide to go to a Naze32, I would be happy to help show more detail of the setup.

Great to see that you've made such great strides so far, but I cringe seeing you fly over the houses and cars in your neighborhood. In light of recent political turmoil, I suggest finding more remote locations to fly.
 

RoyBro

Senior Member
Mentor
Great to see that you've made such great strides so far, but I cringe seeing you fly over the houses and cars in your neighborhood. In light of recent political turmoil, I suggest finding more remote locations to fly.

Agreed. I saw those backyard swimming pools there and could just imagine a sunbather seeing your Tri, and calling in a "peeping drone" sighting.
 

Billbo911

Member
.... If you decide to go to a Naze32, I would be happy to help show more detail of the setup.

Great to see that you've made such great strides so far, but I cringe seeing you fly over the houses and cars in your neighborhood. In light of recent political turmoil, I suggest finding more remote locations to fly.

Thanks for the offer, I will definitely keep it in mind. For now though, I think I will take on this challenge with MultiWii. It isn't too difficult, but it does require a bit of understanding how the code works to make it do EXACTLY what you want ;).

I can't argue with your comments regarding my flying space thus far. It is a bit too "private", and though I have only received compliments from my neighbors, I'm sure someone will not appreciate it. So, I need to start looking for more open spaces in lieu of the convenience of my front yard. I like my neighbors and want to keep it friendly!
 

Billbo911

Member
Agreed. I saw those backyard swimming pools there and could just imagine a sunbather seeing your Tri, and calling in a "peeping drone" sighting.

Agreed. Time to find more open space.
I don't want to be "That Guy". It will do NOTHING to help the perception of our hobby if I continue to buzz their homes and yards.
 

jhitesma

Some guy in the desert
Mentor
I hadn't replied earlier because while this is something I'm also interested in...my lack of a suitable camera has kept me from fully exploring it.

However from what I have read I'm not sure what you're trying to do is possible without modifying the MW code. I've seen a few threads on the MW forums about people mapping a channel to control pan/tilt servos...but they've either just taken the channel right from the RX to the servo - or they've modified the MW code to allow them to use the input form a channel to override what MW is trying to do with it's control over the camera servos.

As for enabling/disabling stabilization...again I don't think there's a current way to just set that up...but I haven't played with it enough to know for sure. I may try doing some experiments the next few nights but I'm really busy right now and messing with the quad is low on my priorities list due to weather right now.
 

Billbo911

Member
However from what I have read I'm not sure what you're trying to do is possible without modifying the MW code. ....

Exactly!
Editing the MW code is not an issue for me, I like doing it if it gets me what I'm after. I was just hoping I could get some direction before I hack into it.

As for enabling/disabling stabilization...again I don't think there's a current way to just set that up...but I haven't played with it enough to know for sure. I may try doing some experiments the next few nights but I'm really busy right now and messing with the quad is low on my priorities list due to weather right now.

Enabling stabilization is done through the GUI.

As for assigning a channel to use as "center" position, that might be in the GUI as well, but I need to look into that a bit further. If it is not, I think I know where in the MW code to edit it in.
Stay tuned for more discoveries.
 

Billbo911

Member
Got it!

As I figured, getting Camera Stabilization working and being able to control the center around which the camera stabilizes was quite easy.
It just took one edit in the "Output.cpp" file.

Here is the edit I made. I will make the edit RED.

Code:
  /****************************                Cam stabilize Servos             ****************************/

  #if defined(SERVO_TILT)
   [B] [COLOR="#FF0000"]//servo[0] = get_middle(0);
    servo[0] = rcData[AUX3];[/COLOR][/B]
    servo[1] = get_middle(1);
    if (rcOptions[BOXCAMSTAB]) {
      servo[0] -= ((int32_t)conf.servoConf[0].rate * att.angle[PITCH]) /50L;
      servo[1] += ((int32_t)conf.servoConf[1].rate * att.angle[ROLL])  /50L;
    }

All I really did was replace the "middle" value with a value taken from an AUX channel that had a pot assigned to it.

Here it is in action.

OK, now for the next question.
As you see in the video, the calibration is not completely accurate, but close.
My understanding is, the GAIN adjustment for this needs to be done in the GUI on the "SERVO" tab. But no matter what I try, it makes no difference.
I know I can tweak the gain in the code, but that is a pain, and not really the correct way to do it.
So, has anyone dealt with this in the GUI and can tell me how to do it correctly?
 
Last edited:

Billbo911

Member
MultiWii Conf not working correctly......or it might be me!

As it turns out, in the GUI you can actually set which AUX channel is used to center the gimbal.
On the SERVO tab, if you slide the MID position slider all the way to the left, then start sliding back, it will display all the input channels one by one. Nice! This precludes my need to hack the Output.cpp file.

Well, maybe not so fast. There is a MAJOR issue I am having with MultiWiiConf. When I use the SERVO tab for anything, it really changes nothing! Yes, I do go to "Live" mode to make adjustments, but none have any effect. Not limits, not Middle, not Prop(Gain). Even if I hit "Write", nothing. As soon as I hit "Read" to verify, it reloads the default values.

So, calibrating the Tilt servo simply does not work.

Some specs to help you help me.

MS Win 8 64bit
MultiWiiconf 2.3 32 bit version. (Not sure of the actual build.)

Any clue why the Servo Tab is not allowing "Live" operation, nor accessing the eeprom?

***************** EDIT **************************

I've tried this on three different computers with different OS's on them.
All three had the same result, nothing.
It's as though the FC is not getting the settings from the GUI.

Any ideas?
 
Last edited:

ztoon

Gone with the Mistral
Hi,
I've done some tests with cam stab.
My experience is that you have to erase the eeprom each time you upload a new firmware or the "old or default" parameters are still loaded. But you must already know that.
I wasted some time with that...