Control Via UART from PC
  • Hello,
    I am an absolute beginner.
    Is it possible to send serial commands directly via PC through the UART ports without using the GUI.
    I can connect the PC to the controller via UART ports and run commands via the GUI.
    Can anyone please tell if it possible to send commands without GUI. I want to control the gimbal using scripts.
    I am using SimpleBGC 32 bit controller

    Thank You,
    Best Regards,
  • Yes it is possible but you need some application (developed by you or someone) taking care of the protocol, See the Serial API documentation.
  • Thank you..
    Connected it and getting the status. I am able to turnoff the motors serially. However CMD_CONTROL is not working
    eg : 3e 43 0d 50 01 00 d8 00 48 00 00 00 00 00 00 00 : This does not control the motors. Can anyone suggest if anything is wrong in the hex values above.
    It is same as :
    • CONTROL_MODE – 1u
    • SPEED_ROLL – 2s
    • ANGLE_ROLL – 2s
    • SPEED_PITCH – 2s
    • ANGLE_PITCH – 2s
    • SPEED_YAW – 2s
    • ANGLE_YAW – 2s
  • It was a stupid mistake. I did not add the body checksum at the end. Now its working fine
  • Hello, I know it's an old thread but I just bumped into it.
    I'm trying to communicate to my Gimbal using serialApi and Python.
    I can switch motors on/off, I can read parameters, I can play with beeper... so communication is fine.
    Now I want to control motors using CMD_CONTROL but documentation isn't very clear.
    I tried to enter the raw string used by gows007 ("3e 43 0d 50 01 00 d8 00 48 00 00 00 00 00 00 00 00") and I see that it works, but I simply can't understand how you composed it. :-\
    How can I specify angle, speed and so on?
  • Though the interface is somewhat complicated it is all explained clearly on the Serial API, and there is also excables.
  • Yes... I'm using serialApi within my Python script.
    As I wrote, I can successfully communicate with my gimbal; for example I can play melodies, I can toggle motors, I can read profiles and so on... but still I can't understand how to compose the CMD_CONTROL string.
    The string posted my gows007 works (the gimbal moves on roll, pitch and yaw) but how can I use custom values and "translate" them into hex values?

    For example, let's say that I choose CONTROL_MODE = 3 with CONTROL_FLAG_AUTO_TASK; doc says that I must shift 6 bites to left (1 << 6). So, eventually, what value must I enter?<br />
    Can I find some working example somewhere?
  • What do you want to do, I do not understand. Controlling Pan, Tilt and Roll is easy.

    Just look at the tutorial https://www.basecamelectronics.com/serialapi/

    You need to build the complete message on your code.
  • I guess you are not familiar with the bit arithmetic and its operators >>, <<, |, &, ^. It is not hard, try to google any tutorial about it and you will get things working. Serial API widely uses "flags" and "masks" so you should understand them.
  • Thank you. I found some tutorial and now I'm able to control rotation!
    By the way, now I'm stuck on converting negative values into byte arrays, but I think this problem is on python side. ;)
  • Ok, I'm still here. :))
    I can't understand very well how CONTROL_MODE works... I mean that I'm still not able to correctly compose the data array.
    According to documentation, first item is 1bit unsigned and specifies the control mode. So, let's say, I want MODE_SPEED_ANGLE with CONTROL_FLAG_AUTO, so the correct hex value should be C6. Am I right?
    But, according to documentation, since I'm using 2.63b firmware, I can specify mode independently for 3 axes. But they are optional or mandatory?

    Another question: if I specify MODE_RC with CONTROL_FLAG_AUTO_TASK (5 << 7) I get hex 280, but max acceptable value should be is 255. So, what I am missing?<br />
    Moreover, despite the values I enter as SPEED_ROLL, ANGLE_ROLL, SPEED_PITCH, ANGLE_PITCH, SPEED_YAW, ANGLE_YAW, the gimbal makes a complete rotation on X axis