EN CN
serial protocol specification receive data
  • hi,
    i will receive gimbal ANGLE_PITCH data from sbgc board. i read the serial protocol specification rev. 2.3. and found an arduino sketch example. but this example only send data to gimbal controller. i am not a real programmer, maybe some body can give me an example how i can generally receive and filter data to read only needed values. in my case "ANGLE_PITCH".

    thx in advanced
    wolke
  • hi again,
    need some help here.
    i try to move my gimbal a given angel via arduino. my problem is that all angle values are absolute. currently i drive crazy because yaw and pitch angle. this angles have a range of 7200 ore 720°. if i drive the gimbal some times around i don't know what is my absolute yaw angle. if i switch to my arduino controller to drive to an absolute angle it will spinning around without a know direction and sometimes more than one circle.
    my idea is to get the current angle to decide what is to do. and my problem is that i cannot receive data from sbgc controller. i found some example code in old rev 1.0 simple bgc gui ino file. but it will not work here. the second problem here, i can not debug this because i use my arduino rx and tx to connect the sbgc board. i have simple no serial console here. arrrrgrrr:). any hints.

    thx wolke
  • hi again,
    no answer :(. maybe i describe a little bit more what i try to build. i am working on an simple panorama controller based on an arduino pro mini. it works simple and bridge simplebgc, lanc-ctrl and your rc- receiver. so it will be possible to perform 360° equirectangular panorama shots fully automatically with only one switch.

    currently i solved this with simple bgc serial api in alex defined example code mode (SBGC_CONTROL_MODE_SPEED). the problem here is that this do not allow to optimise yaw and pitch speed. it performed with a fixed speed which is save enough to prevent motor jerks. mixed speed and angle mode need a known position. but this is not given. even if you first fly around a little bit to find your optimal copter position. this is my problem at all to optimise the arduino .

    also important. this is no commercial idea. only a nice give away for this super gimbal controller. so i hope it is ok for you (alex) if i post the arduino code here.

    the current working ino file. allows relative positioning the gimbal with a fixed speed. not exact and fast i will get it:).
    http://popez.org/~wolke/arduino/panoctrl/panoramacontroller2.ino

    thx wolke
  • I just got the C command example working and would be interested also for an exactable code for reading.

    But for the panorama, I do not see why you need to read anything. Why not use the SBGC_CONTROL_MODE_SPEED_ANGLE, just like in the demo 4.?
  • because you need an absolute angle start position. else it will not work correctly. if you fly around a little bit with your copter to find a good position to start panorama mostly you also have move the gimbal around. in this case you don not know the current angle value. on this point it is not possible to start with speed angle mode. second problem is that SBGC_CONTROL_MODE_ANGLE mode produce massive jerks here. else it would possible to center the gimbal first to 0.0.0 by using this mode. and begin panorama with SBGC_CONTROL_MODE_SPEED_ANGLE but because the jerks this will not work.
    /g
    wolke
  • I am controlling in speed mode, no problems, just make sure to start with slow enough speed.
  • i do the same here. with a static speed in an calculated time to drive the right angle. it works... but for a panorama with five 360° circles in 45° yaw steps and each circle with 25° difference and one image directly down -90° i need ~6.30 minutes. with starting, climbing up to target altitude, finding the right position, do the panorama and at least landing you need around 8-9 minutes. i have ~10 minutes flight time under good conditions. no wind and so on. it would be cool to speed up the gimbal movements. than you can use this time for camera focus or to shot hdr photos. time is a real problem here.

    but i do a first 360° photo with panoctrl and simplebgc.
    here http://popez.org/~wolke/pano/build/
    flying was not nice on this day. it was gusting over 30 km/h. loiter mode was really restless and it circles over 3 meters around while this first panorama shooting.
    /g
    wolke
  • But why do you need such a long time. You can rotate fast, speed just need to be started slow and stepped up. I have tried up to 180 deg/s.
  • i also try this. but in real flying situation with wind and shaking copter i get motor jerks in speed mode if i use the same method as in example 4, but without angle settings. only for speed mode. the result is loosing right angel. some steps are correct as expected other are shorter or longer. in my case i rotate the gimbal 5 times with 360°. on each circle i need nearly the same yaw positions. because best results with hugin imagesticher for multi row panorama need this to find good reference points on images for calculating. currently only a static speed on speed mode give me nearly the same yaw position. at least it would be super helpfully if i can receive data from gimbal. i try something but have no success. maybe the nex rev. from the serial api documentation contains an receive data example:). that would be cool.
  • hello,

    I have small problem with control SBGC by serial protocol. If I send command for example: reset, motor on, calib_acc, get_angles, this command working perfect. I receive correct angles, but, if I want control gimbal by protocol (control_mode_angles), SGBC doing nothing. Why? I have SimpleBGC 32-bit and newest firmware. my code:

    SBGCdata.mode = SBGC_CONTROL_MODE_ANGLE;
    SBGCdata.angleROLL = SBGC_DEGREE_TO_ANGLE(roll);
    SBGCdata.anglePITCH = SBGC_DEGREE_TO_ANGLE(pitch);
    SBGCdata.angleYAW = SBGC_DEGREE_TO_ANGLE(yaw);

    SBGC_sendCommand(SBGC_CMD_CONTROL, &SBGCdata, sizeof(SBGCdata));

    This code is the same like example. Could you write what I am doing wrong?