Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. VOXL Compute & Autopilot
  3. VOXL 2
  4. How to control PWM using VOXL2 IO expander ?

How to control PWM using VOXL2 IO expander ?

Scheduled Pinned Locked Moved VOXL 2
8 Posts 3 Posters 1.1k Views 2 Watching
  • 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.
  • W Offline
    W Offline
    winnie.tsai
    wrote on last edited by
    #1

    Hi
    I use voxl2 board to connect voxl2 io expander board at J19.
    I would like to control PWM signal by "qshell pwm" command first. How to do it ?

    I use below command to do it, but there is no any PWM signal change.

    qshell px4io detect
    After this command, PWM output 50Hz signal
    qshell px4io start
    qshell mixer load /dev/px4io quad_x_io.main.mix
    qshell pwm rate -c 1234 -r 400
    I try the -c <pwm_ouput>, there is no any PWM signal change.

    W 1 Reply Last reply
    0
    • W winnie.tsai

      Hi
      I use voxl2 board to connect voxl2 io expander board at J19.
      I would like to control PWM signal by "qshell pwm" command first. How to do it ?

      I use below command to do it, but there is no any PWM signal change.

      qshell px4io detect
      After this command, PWM output 50Hz signal
      qshell px4io start
      qshell mixer load /dev/px4io quad_x_io.main.mix
      qshell pwm rate -c 1234 -r 400
      I try the -c <pwm_ouput>, there is no any PWM signal change.

      W Offline
      W Offline
      winnie.tsai
      wrote on last edited by
      #2

      @winnie-tsai
      I can change the frequency by the qshell command

      qshell pwm -a -r <rate>

      another, I would like to know how to change the PWM duty cycle.

      Thanks

      Gary HolmgrenG 1 Reply Last reply
      0
      • W winnie.tsai

        @winnie-tsai
        I can change the frequency by the qshell command

        qshell pwm -a -r <rate>

        another, I would like to know how to change the PWM duty cycle.

        Thanks

        Gary HolmgrenG Offline
        Gary HolmgrenG Offline
        Gary Holmgren
        Regular
        wrote on last edited by
        #3

        @winnie-tsai hi, did you figure this out?

        Alex KushleyevA 1 Reply Last reply
        0
        • Gary HolmgrenG Gary Holmgren

          @winnie-tsai hi, did you figure this out?

          Alex KushleyevA Offline
          Alex KushleyevA Offline
          Alex Kushleyev
          ModalAI Team
          wrote on last edited by
          #4

          @Gary-Holmgren , this is an old post.. just wanted to clarify.. the VOXL 2 IO (M0065) board software used to run standard px4io firmware, but we moved away from it in order to add flexibility. So px4io module is no longer used.

          However, there may be something interesting here regarding loading the correct mixer, if you are looking to experiment with that.

          Alex

          Gary HolmgrenG 1 Reply Last reply
          0
          • Alex KushleyevA Alex Kushleyev

            @Gary-Holmgren , this is an old post.. just wanted to clarify.. the VOXL 2 IO (M0065) board software used to run standard px4io firmware, but we moved away from it in order to add flexibility. So px4io module is no longer used.

            However, there may be something interesting here regarding loading the correct mixer, if you are looking to experiment with that.

            Alex

            Gary HolmgrenG Offline
            Gary HolmgrenG Offline
            Gary Holmgren
            Regular
            wrote on last edited by Gary Holmgren
            #5

            @Alex-Kushleyev So I am trying to do soething very similar to https://gitlab.com/voxl-public/voxl-sdk/services/voxl-io-server where I can make a script that controls motors that are configured to auxiliary or off board motors in px4. I can send actuator commands using mavsdk and the M0065, but I feel the voxl-io server would be a more robust way of doing this. Is there any idea how to implement it for the M0065 yet?

            Alex KushleyevA 1 Reply Last reply
            0
            • Gary HolmgrenG Gary Holmgren

              @Alex-Kushleyev So I am trying to do soething very similar to https://gitlab.com/voxl-public/voxl-sdk/services/voxl-io-server where I can make a script that controls motors that are configured to auxiliary or off board motors in px4. I can send actuator commands using mavsdk and the M0065, but I feel the voxl-io server would be a more robust way of doing this. Is there any idea how to implement it for the M0065 yet?

              Alex KushleyevA Offline
              Alex KushleyevA Offline
              Alex Kushleyev
              ModalAI Team
              wrote on last edited by Alex Kushleyev
              #6

              @Gary-Holmgren , I see what you are saying.

              voxl-io-server works by packaging the UART data that needs to be sent to the ESC using a special channel that bypasses PX4 processing. The data from voxl-io-server is sent to the voxl-px4 process via MPA and then forwarded to the DSP, where voxl-esc driver is running. voxl-esc receives the data and just pushes it out to the UART port where ESC communication is already establised.

              This works well for aux functions that we enable without modifying PX4 code, such as pwm output control or Neopixel LED control (this is in addition to normal RPM commands that are sent by voxl-esc, which go through the standard PX4 control pipeline).

              voxl-io-server does not currently support sending commands to VOXL2_IO. It seems like it would be an overkill to put in this functionality for your application.

              Just a thought, If you want to just move the PWM control out of PX4 completely, this is very easy and I can tell you how to control M0065 pwm output using python or C/C++. I don't know what your SW architecture looks like, but if you don't need to control the motors using PX4, this would be the best approach.

              Alex

              Gary HolmgrenG 1 Reply Last reply
              0
              • Alex KushleyevA Alex Kushleyev

                @Gary-Holmgren , I see what you are saying.

                voxl-io-server works by packaging the UART data that needs to be sent to the ESC using a special channel that bypasses PX4 processing. The data from voxl-io-server is sent to the voxl-px4 process via MPA and then forwarded to the DSP, where voxl-esc driver is running. voxl-esc receives the data and just pushes it out to the UART port where ESC communication is already establised.

                This works well for aux functions that we enable without modifying PX4 code, such as pwm output control or Neopixel LED control (this is in addition to normal RPM commands that are sent by voxl-esc, which go through the standard PX4 control pipeline).

                voxl-io-server does not currently support sending commands to VOXL2_IO. It seems like it would be an overkill to put in this functionality for your application.

                Just a thought, If you want to just move the PWM control out of PX4 completely, this is very easy and I can tell you how to control M0065 pwm output using python or C/C++. I don't know what your SW architecture looks like, but if you don't need to control the motors using PX4, this would be the best approach.

                Alex

                Gary HolmgrenG Offline
                Gary HolmgrenG Offline
                Gary Holmgren
                Regular
                wrote on last edited by
                #7

                @Alex-Kushleyev This sounds like what I need. So I am really hoping to have 4 motors set up to work in px4 with the M0065, and then use 4 separate channels of PWM controlling 4 motors outside of px4 just using plain PWM signals to control motors using my RC input. I know you can use the px4-listener topic to see what the values of each RC channel are when binded to a transmitter. Is there any way to use this to simply send PWM to a 4in1 ESC not through PX4?

                I wonder where the signal wires would be connected to for the 4 PWM channels not being used by PX4, can the M0065 work for channels 5-8 for external control whereas channels 1-4 are just used normally by PX4?

                I am under the impression that when PX4 is bridged to the M0065 that it has to be stopped in order for voxl-esc tools to access it.

                Maybe there is an alternative solution for VOXL2 to send PWM to 4, or at the very least 2 channels while 4 channels of PWM are actively being used by PX4.

                Alex KushleyevA 1 Reply Last reply
                0
                • Gary HolmgrenG Gary Holmgren

                  @Alex-Kushleyev This sounds like what I need. So I am really hoping to have 4 motors set up to work in px4 with the M0065, and then use 4 separate channels of PWM controlling 4 motors outside of px4 just using plain PWM signals to control motors using my RC input. I know you can use the px4-listener topic to see what the values of each RC channel are when binded to a transmitter. Is there any way to use this to simply send PWM to a 4in1 ESC not through PX4?

                  I wonder where the signal wires would be connected to for the 4 PWM channels not being used by PX4, can the M0065 work for channels 5-8 for external control whereas channels 1-4 are just used normally by PX4?

                  I am under the impression that when PX4 is bridged to the M0065 that it has to be stopped in order for voxl-esc tools to access it.

                  Maybe there is an alternative solution for VOXL2 to send PWM to 4, or at the very least 2 channels while 4 channels of PWM are actively being used by PX4.

                  Alex KushleyevA Offline
                  Alex KushleyevA Offline
                  Alex Kushleyev
                  ModalAI Team
                  wrote on last edited by
                  #8

                  @Gary-Holmgren , oh yeah, I almost forgot about the issue of not being able to use the DSP uart ports while PX4 is running.. 🙂

                  To work around that, you could potentially connect M0065 board to one of the UART ports that are actually connected to CPU and access it directly from linux use /dev/ttyHSx devices

                  You can find the linux uart ports here : https://docs.modalai.com/voxl2-linux-user-guide/#uarts - you will need an expansion board, but even something like M0141 or M0151 will do (which is probably the simplest).

                  However, it sounds like maybe you are close to figuring out he pwm output via px4, so perhaps this is not needed, but you can keep it in mind.

                  Alex

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  ModalAI
                  Categories Recent Tags ModalAI.com Docs
                  © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups