ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    VOXL2-VOXL2IO-PX4 firmware

    Ask your questions right here!
    2
    7
    85
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      Indra Jaganathan
      last edited by Indra Jaganathan

      I have written Dshot signal generation using FreeRTOS in STM32 using STM Cube IDE. It is working and I can control the motor which is connected to a 4 in 1 ESC. I want to connect this STM32F446RE to VOXL2 board and give the actuator inputs through PX4 firmware. I have written code in my STM32 to parse the inputs from VOXL2. Please explain how to connect. Can I replace the STM32 in place of M0065 and proceed? I tried to connect our own STM32 through J18. But I am not able to get any inputs. Is PX4 VOXL2-IO written such that it configures only M0065?
      @Alex-Kushleyev
      I referred to the below link.
      https://github.com/modalai/px4-firmware/tree/main/src/drivers/voxl2_io

      Alex KushleyevA 1 Reply Last reply Reply Quote 0
      • Alex KushleyevA
        Alex Kushleyev ModalAI Team @Indra Jaganathan
        last edited by

        @Indra-Jaganathan ,

        You were looking at an old version of the voxl2)_io driver. The latest version can be found here : https://github.com/modalai/px4-firmware/blob/voxl-dev/src/drivers/voxl2_io/voxl2_io.cpp

        Voxl2IO::get_version_info() function will query the hardware and software version of the M0065 board before the voxl2_io px4 module will successfully start up and send out control commands.

        The version check will make your testing slightly more complicated because you'd need to implement the extended version reply on your STM. You should also check whether the actual format of the commands that you implemented is correct (not from the old version).

        If you are able to compile the px4 code, you can just disable the version check in the code and the voxl2_io px4 module should let you send out the actuator commands.

        Let me know if you need more assistance.

        Alex

        I 2 Replies Last reply Reply Quote 0
        • I
          Indra Jaganathan @Alex Kushleyev
          last edited by

          @Alex-Kushleyev Thanks for the response. Let me try the newer version and come back

          1 Reply Last reply Reply Quote 0
          • I
            Indra Jaganathan @Alex Kushleyev
            last edited by

            @Alex-Kushleyev . I need some clarifications on the following points:

            1. How the actuator values are passed on to PX4 firmware? Through QGC or some manual method?
            2. Once the PX4 gets the actuator values, the Sbus receives these raw values and converts to PWM packets?
            3. These PWM packets are then sent to VOXL?
            4. VOXL converts these packets to PWM values and controls the motor through ESC?
              I am confused about the format of frames used in Sbus and VOXL PWM packets. Not able to understand fully.
              I am not able to figure out from the code, where Sbus is receiving these raw values. Also where VOXL is receiving these values and and where it is sending it.
              Please clarify how I should send the actuator values. Also please send me the flow of the code, like how it works.
            Alex KushleyevA 1 Reply Last reply Reply Quote 0
            • Alex KushleyevA
              Alex Kushleyev ModalAI Team @Indra Jaganathan
              last edited by Alex Kushleyev

              @Indra-Jaganathan ,

              The voxl2_io driver works as a standard PX4 actuator, supporting up to 8 actuator outputs.

              When voxl2_io driver is enabled, you can select which outputs to assign to the 8 pwm outputs using QGC, just like any actuator setup.

              Then during normal operation, the PX4 mixer will send the standard commands (based on your PWM channel assignment) to the voxl2_io module (the commands typically range between 1000-2000, but the range can be changed).

              voxl2_io driver, will take these values and package them into a special packet, which is then sent out via UART to M0065 board.

              M0065 board will receive the pwm control packet and set its pwm values based on the packet contents.

              There is no SBUS involved in this communication (standard UART between VOXL2 and M0065 board).

              Does that clarify the data flow from PX4 to the M0065 board?

              Alex

              I 1 Reply Last reply Reply Quote 0
              • I
                Indra Jaganathan @Alex Kushleyev
                last edited by

                @Alex-Kushleyev
                Thank you very much for the clear explanation. Now I am able to understand the data flow.

                I have connected my own STM32F446RE to VOXL2. I have written the code for Dshot generation and it works. I have also written code in STM32 to parse the pwm values that are received from VOXL.

                If i skip the version check and run the PX4 code, will it work? That is i am replacing M0065 and using STM32F446RE.

                Is it enough that if we run PX4 firmware, VOXL will send the actuator values automtically?

                Any other modifications to be made?

                Alex KushleyevA 1 Reply Last reply Reply Quote 0
                • Alex KushleyevA
                  Alex Kushleyev ModalAI Team @Indra Jaganathan
                  last edited by Alex Kushleyev

                  @Indra-Jaganathan ,

                  Yes, you can just skip the version check in the voxl2_io px4 driver and just hard code that the correct version of M0065 board has been detected, so that the voxl2_io driver can continue, everything should work. You will need to re-build the px4 firmware and install it on voxl2, and after that you can use GCS to set up your actuators for the voxl2_io driver and use actuator test as well.

                  Please let me know if you have any issues with that.

                  Alex

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB | Contributors