Multiwii v2.3 Cam Stabilisation

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
AkaMrBill
Posts: 31
Joined: Tue Jan 14, 2014 5:40 pm
Location: Elk Grove, Ca

Multiwii v2.3 Cam Stabilisation

Post by AkaMrBill »

I'm ready to start using Camera Stabilization on my Tri.
I've seen this section of code in Config.h and understand how to enable it.

/

Code: Select all

***********************          Cam Stabilisation             ***********************/
    /* The following lines apply only for a pitch/roll tilt stabilization system. Uncomment the first or second line to activate it */
    //#define SERVO_MIX_TILT
    //#define SERVO_TILT


Additional searching has shown that a TILT servo attaches to A0, and ROLL to A1.

What I would like to know is:
1)How do I tune it's performance?
2)Where and how can I use an Aux channel(s) to set the center positions for PITCH and ROLL?

What I am trying to do is be able to PITCH the stabilized camera forward to view what is below me, for landing etc. If I can do the same for ROLL, even better.

AkaMrBill
Posts: 31
Joined: Tue Jan 14, 2014 5:40 pm
Location: Elk Grove, Ca

Re: Multiwii v2.3 Cam Stabilisation

Post by AkaMrBill »

This is the nature of MultiWii. 37 reads and no replies.
The documentation for this amazing code is woefully lacking.

So, here is what I found after digging through it on my own.

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.

Code: Select all

  /****************************                Cam stabilize Servos             ****************************/

  #if defined(SERVO_TILT)
    //servo[0] = get_middle(0);
    servo[0] = rcData[AUX3];
    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.
https://www.youtube.com/watch?v=g5FdGI0 ... e=youtu.be

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?

**************************** EDIT ************************************************
I found out after posting this that there actually is a way in the MultiWiiConf GUI to set and AUX channel to control the servo middle position.
Just slide the middle position slider all the way to the left, then back to the right. As you move away from minimum, it lists out the channels to select for middle one by one.
So, this yields my edit to the Output.cpp file unnecessary.

BUT, there is a problem.
For some reason I can't figure out yet, the SERVO tab on my GUI has no effect on the servo(s). Whether I have the tail servo, or the Cam Stabilize servo selected, when I go "LIVE" changing the sliders does nothing to the servo. Writing the adjusted values to eeprom, does nothing. I say it doesn't write because if after Writing, I then "Read" the eeprom, it sets all the sliders back to default.


Has anyone experienced this type of error with MultiWiiConf GUI?

I'm running this on a Windows 8 64bit system and using the 32bit MultiWiiConf version.

nickschaos81
Posts: 7
Joined: Thu Jun 11, 2015 3:33 am

Re: Multiwii v2.3 Cam Stabilisation

Post by nickschaos81 »

Okay I know this is long overdue , but i found a fix for your problem. In the output.cpp where you made the adjustment to be able to move the center. By changing the number before the L you can increase your rate (im assuming l stands for length) and putting a "-" in front of the number you can servo reverse. hope this helps. this was also done in 2.4 btw

Post Reply