EN CN
Simultaneous serial communication control with the use of AS5048A (PWM) encoders
  • I'm using a gimbal with a 32-bit Extended SimpleBGC card. Firmware ver.: 2.63 b0, board ver.:3.6
    The 3 axes use motors with AS5048A encoder (PWM). The GUI monitor shows that the encoders (ENC_RAW_xxx) read values with a correct variation of 16384 pulses / revolution.
    The debug request state show:

    Device s/n: 01238c854e32398cee, MCU s/n: 383131200d5733531d002200
    Firmware ver.: 2.63 b0, board ver.:3.6
    error:0
    assert_line: 0
    assert_file:
    COM errors: 0
    Encoder[ROLL]
    Encoder type: AS5048A,B (PWM)
    read errors: 0
    Encoder[PITCH]
    Encoder type: AS5048A,B (PWM)
    read errors: 0
    Encoder[YAW]
    Encoder type: AS5048A,B (PWM)
    read errors: 0
    DRIVERS STATE: OTW=0, DRV_FAULT=1
    TIME SLOTS FREE (us): 1:693, 2:146, 3:628, 4:633, 5:698, 6:699, 7:699, 8:703, 9:693, 10:706,
    TEMPERATURE (C°): MCU=28, IMU=28, F.IMU=0, DRIVERS=0, ROLL_M=0, PITCH_M=0, YAW_M=0,
    I2C errors: none


    When I control the gimbal by analog signals (joystick on the A1, A2 and A3), the behavior is correct. If I disable / enable the encoders a significant change is seen (the better: the engines consume much less and the response against alterations in the camera is much more stable). Therefore, everything seems correct.

    The problem arises when trying to control the gimbal through serial communication (from a mega arduino).
    The connection is through the normal SERIAL port (and USB not connected).
    - if I disable the encoders, I can control the gimbal without problems sending 50 times / sec the instruction "cmd_control_ext_send" in "MODE_SPEED" for YAW and PITCH and "ANGLE_MODE" for ROLL: the movement is smooth and correct, respecting the limits of angles of travel marked in RC Settings.

    - If I enable the encoders, the movement commands suffer a variable delay and the motors do not rotate regularly, they do jumps. it seems as if the sequence of received orders overflows.

    Any suggestions (especially helpfull ones) would be appreciated a lot!
  • Hello, Alejandro!

    To check is it overflow issue or not, try to set a lower rate of the control command: 20 Hz, 10 Hz.
    Check the "COM errors" diagnostic in the "Debug" - "Request state" - it should grow.

    Other things to check:
    1) When sending control commands, connect to the GUI and check is there all okay with the encoder readings ("Monitoring" - "ENC_RAW_x"). May be UART interfere with the PWM somehow?
    2) Ensure you do not send other commands from your controller.

    Regards, Aleksey.
  • Hello!
    It's solved, but I do not know exactly how ...
    Perform all the calibration process without encoders to later configure them and suddenly, everything worked correctly I am sending at a rate of 66 frames / s the order of "cmd_control_ext_send" without problems.

    Thank you very much!