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

    VOXL ESC FPV queries

    ESCs
    4
    32
    1187
    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.
    • Jetson NanoJ
      Jetson Nano
      last edited by

      Hello!

      Thanks for the wonderful product of VOXL ESC. I have few doubts regarding the product,

      1. Even though details have been provided in the docs, few pin-outs details seem to be missing. Could you share across the integration and pinouts for all the connectors and testpoints of MDK-M0138-1-01?

      2. LED Integration and coding: As stated here, link the documentation mentions for external Neopixel LEDs as well. I'm planning to use a Neopixel LED strips. Over here, I have a doubt if we can address more than 1 LEDs? If yes, how can it be done?

      Also how do we power the LED array and what pin is used to power?

      1. Payload Connector: Can we connect a external BEC and get the desired power output we need? Since we are planning to power Doodle Labs COMs module from here if requirements are met.

      2. Also, I want to know what type of data is being sent from FC to ESC via UART communication port(J1)?

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

        @Jetson-Nano , the following link shows location of all the connections and test points that are being utilized: https://docs.modalai.com/voxl-fpv-esc-datasheet/#hardware-overview . If there is a test point that is not documented, it means it is not supported in firmware or only used for production testing. If you have a specific question, please let me know.

        The following link describes the Neopixel led support : https://docs.modalai.com/voxl-fpv-esc-datasheet/#neopixel-led-support . A single string with up to 32 LEDs is supported. VAUX regulator is dedicated for this output and can handle 500-600mA. We also have a way to control this output to be 3.3V or 5.0V (3.3V default) but the control feature is disabled at the moment. You can test the Neopixel output while PX4 is not running using voxl-esc tools : https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/master/voxl-esc-tools/voxl-esc-neopixel-test.py (we also have a helper command to use the LED while PX4 is running). https://gitlab.com/voxl-public/voxl-sdk/services/voxl-io-server/-/blob/master/tools/voxl-send-neopixel-cmd.c -- this tool is a command line tool which sends the control data to PX4 and then PX4 forwards it to the ESC. Right now the C example only supports white color, but we will extend it to RGB.

        The payload connector just outputs VBATT, so as long as your desired current is within the JST connector spec, you should be ok. (4Amps per manufacturer's spec).

        J1 is used for UART communication with FC or the voxl-esc test scripts and the data that is send are the ESC commands (rpm or power) and other commands like Neopixel commands, PWM output.. The ESC also sends back the ESC status.

        Let us know if you have any more questions 🙂

        Alex

        1 Reply Last reply Reply Quote 0
        • Jetson NanoJ
          Jetson Nano
          last edited by Jetson Nano

          Thanks @Alex-Kushleyev for reverting. I have few queries,

          Query - I would like too know whether we can control the Neopixel LEDs connected to the voxl-ESC through the voxl-portal. You have mentioned that there is a helper script as well. Can this helper script be used as a service to turn ON and OFF the LEDs?

          Approach - An icon or button on the voxl-portal, which will automatically start the voxl-esc-neopixel-test.py. which will turn ON the LEDs.
          While clicking the icon or button again the script will stop running the LEDs will Turn OFF.

          Is this approach feasible and if yes, please guide me with development

          Thank you

          @James-Strawson

          Jetson NanoJ 1 Reply Last reply Reply Quote 0
          • Jetson NanoJ
            Jetson Nano @Jetson Nano
            last edited by

            @James-Strawson @Alex-Kushleyev

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

              Hi @Jetson-Nano,

              We are currently not planning on integrating the neopixel led test feature into the voxl-portal.

              I am not sure why you would want to do it through the voxl-portal - just for testing? Normally voxl-portal should be used for testing purposes before you can develop your own application or use other applications that were designed for deployment (such as PX4 + QGC, etc).

              If you really wanted to add the functionality to voxl-portal, you would need to modify the front end to add a button that sends a message via a websocket (or other method) with the LED details, and the back-end would need to receive that message and call the neopixel test script. It is technically not very difficult, but the exact use case is not clear.

              Can you please elaborate?

              Alex

              Jetson NanoJ 1 Reply Last reply Reply Quote 0
              • Jetson NanoJ
                Jetson Nano @Alex Kushleyev
                last edited by

                Thanks @Alex-Kushleyev for reverting.

                From the documentation provided on the modalai website, I believe we can control external LEDs through ESC server by running the Python file voxl-esc-neopixel-test.py.

                I would like to control the external LEDs manually through a single button on GCS or on Portal, without needing to run the python file on terminal. So the LEDs can be used as flood light for RGB camera.

                Jetson NanoJ 1 Reply Last reply Reply Quote 0
                • Jetson NanoJ
                  Jetson Nano @Jetson Nano
                  last edited by

                  @Alex-Kushleyev
                  https://forum.modalai.com/topic/3702/neopixel-gpio-control-on-voxl2-spi-port
                  Here in this post you have mentioned integration of LEDs with PX4, can you please elaborate this approach .

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

                    @Jetson-Nano , I see what you mean about the use case. I believe we have considered a similar use case before, let me check how we did it.

                    Will get back to you soon.

                    Alex

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

                      Hi @Jetson-Nano ,

                      I asked around and we currently do not have an official way to do this. In some tests what we have done is read the RC values from mavlink server and pick a RC channel (a switch), so that when the switch is flipped, you send our the command using voxl-send-neopixel-cmd.c. Please note that you cannot run the python test script while PX4 is running (which is your use case).

                      So basically, what is missing is some "glue" that will tie together the RC channel logic with sending out the LED command. Using PX4 for this may be too complicated and it can be done in a simple script. This can be your own app.

                      I can provide an example of achieving this relatively easily using python:

                      • using a python script that calls px4-listener to get RC data packet into python, you can get all the RC channels and decide what channel you want to use for the LED. I don't have the exact script, but i am pasting another script i recently wrote for logging barometer data in the similar way
                      • when you decide that an led command needs to be sent out, you can do a system call / subprocess call to voxl-send-neopixel-cmd to turn the led on / off. This helper tool already has support to just turn the while led on or off. Note that this command will send a message via MPA pipe to PX4 process, which will forward the data packet to the PX4 ESC driver, and the message will go out via UART to the ESC (so that you understand the data flow)

                      So your final python script might look something like this (outline):
                      make sure PX4 is running

                      • loop and periodically read RC channels (lets say at 5-10hz)
                      • if there is transition on a RC channel that is mapped to a switch, call voxl-send-neopixel-cmd

                      In order to modify the barometer reading script for RC data, you can just first print out what the px4-listener returns and then parse the RC channel values.

                      Please let me know if this will work for you, If you need more specific example, I can help but it will take a bit more time (i just wanted to propose a path forward to you).

                      script for logging barometer data:

                      import subprocess
                      import time
                      import numpy as np
                      import argparse
                      
                      # install plotly using    pip3 install plotly --upgrade
                      
                      parser = argparse.ArgumentParser(description='Barometer Test Script')
                      parser.add_argument('-n','--num-samples',   type=int, required=False, default=1000)
                      args = parser.parse_args()
                      
                      max_sample_count = args.num_samples
                      
                      def get_px4_baro():
                          cmd = 'px4-listener sensor_baro'
                      
                          p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
                      
                          timestamp   = None
                          pressure    = None
                          temperature = None
                      
                          for line in p.stdout.readlines():
                              l=str(line)
                              #print(l)
                              if 'timestamp' in l:
                                  ll = l.split(':')[1].split()[0]
                                  timestamp = float(ll)
                              if 'pressure' in l:
                                  ll = l.split(':')[-1][:-3]
                                  pressure = float(ll)
                              if 'temperature' in l:
                                  ll = l.split(':')[-1][:-3]
                                  temperature = float(ll)
                      
                              retval = p.wait()
                      
                          return (timestamp,pressure,temperature)
                      
                      
                      tlast = 0
                      ts = []
                      ps = []
                      temps = []
                      
                      sample_count = 0
                      
                      while (sample_count < max_sample_count):
                          (timestamp, pressure, temperature) = get_px4_baro()
                      
                          #make sure we got new data
                          if timestamp != tlast:
                              sample_count += 1
                              ts.append(timestamp)
                              ps.append(pressure)
                              temps.append(temperature)
                              print(f'({sample_count})[{timestamp}] P: {pressure}, T: {temperature}')
                      
                          tlast=timestamp
                          time.sleep(0.01)
                      
                      print('Finished collecting data')
                      print('Generating plots..')
                          
                      try:
                          import plotly.graph_objects as go
                          from plotly.subplots import make_subplots
                      except:
                          print('WARNING: In order to plot the results, install the Python "plotly" module: pip3 install plotly --upgrade')
                          sys.exit(0)
                      
                      fig = make_subplots(rows=3, cols=1, start_cell="top-left")
                      
                      ts_plot  = np.array(ts)
                      ts_plot -= ts_plot[0]
                      ts_plot *= 0.000001 #convert from us to s
                      
                      # calculate approximate height from start
                      dh       = np.array(ps)
                      dh      -= dh[0] # subtract the first value
                      dh      /= 12.0  # about 12 Pascals per meter at standard pressure and temperature
                      
                      fig.add_trace(go.Scatter(x=ts_plot, y=np.array(ps), name='Pressure (Pa)'), row=1, col=1)
                      fig.add_trace(go.Scatter(x=ts_plot, y=np.array(temps), name='Temperature (deg C)'), row=2, col=1)
                      fig.add_trace(go.Scatter(x=ts_plot, y=dh, name='Approx Height (m)'), row=3, col=1)
                      
                      fig.update_layout(title_text='Barometer Test Results')
                      fig.update_xaxes(title_text='Time (s)',row=1, col=1)
                      fig.update_yaxes(title_text='Pressure (Pa)',row=1, col=1)
                      fig.update_xaxes(title_text='Time (s)',row=2, col=1)
                      fig.update_yaxes(title_text='Temperature (deg C)',row=2, col=1)
                      fig.update_xaxes(title_text='Time (s)',row=3, col=1)
                      fig.update_yaxes(title_text='Approx Height (m)',row=3, col=1)
                      
                      fig.update_xaxes(matches='x')
                      
                      fig.write_html('barometer_test_results.html',include_plotlyjs='cdn')
                      #fig.show()  #the figure will not show on VOXL because there is no display / browser
                      
                      print('done')
                      
                      Jetson NanoJ 2 Replies Last reply Reply Quote 0
                      • Jetson NanoJ
                        Jetson Nano @Alex Kushleyev
                        last edited by Jetson Nano

                        Thanks @Alex-Kushleyev for reverting back, I will test it out. It might some time but I will get back to you.

                        I had an additional query, where will the python file be running, inside any server or docker. Theoretically this should work, and if it works i want the python file to start when the system is booted.

                        1 Reply Last reply Reply Quote 0
                        • Jetson NanoJ
                          Jetson Nano @Alex Kushleyev
                          last edited by

                          @Alex-Kushleyev I am using flight core v2 as external FC. Due to which i am getting error message when i run the command px4-listener.Screenshot from 2025-01-11 12-48-02.png

                          Can you help me out here. how to get the data when we use external FC.

                          tomT 1 Reply Last reply Reply Quote 0
                          • tomT
                            tom admin @Jetson Nano
                            last edited by

                            @Jetson-Nano Try out voxl-inspect-mavlink, if you hit tab a couple times it should populate with the various pipes you can read from

                            Jetson NanoJ 1 Reply Last reply Reply Quote 0
                            • Jetson NanoJ
                              Jetson Nano @tom
                              last edited by

                              thanks @tom for reverting back. I had already tried it and I was not able to see any RC channel data. listener function was not working.
                              The issue is I am not able to see the RC channel changes. Can you help me out how am I supposed to get the RC changes.

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

                                Hi @Jetson-Nano, sorry i originally did not realize that you are running PX4 outside VOXL2. In this case px4-listener approach will not work.

                                However, in the case of PX4 running on flight core (v1 or v2), there is still communication between Flight Core and VOXL2. voxl-mavlink-server should be communicating with the Flight Core via UART and passing messages back and forth. Depending whether the forwarding of RC topic is enabled or not, voxl-mavlink-server would receive those messages (if enabled) and in that case they would be accessible on VOXL2.

                                @tom , can you please elaborate on how to double check if the RC message is set up to forward to voxl-mavlink-server from Flight Core (if not, how to enable it) and how to actually read that message?

                                Thanks!

                                Alex

                                tomT 1 Reply Last reply Reply Quote 0
                                • tomT
                                  tom admin @Alex Kushleyev
                                  last edited by

                                  @Alex-Kushleyev @Jetson-Nano You'll want to make sure that in /etc/modalai/voxl-mavlink-server.conf that en_external_uart_ap is set to true

                                  Once you restart the service you should be able to run voxl-inspect-mavlink mavlink_offboard to view the generated messages from FC

                                  Jetson NanoJ 2 Replies Last reply Reply Quote 0
                                  • Jetson NanoJ
                                    Jetson Nano @tom
                                    last edited by

                                    @tom @Alex-Kushleyev thanks guys. I will check it and get back to you with the result.

                                    Jetson NanoJ 1 Reply Last reply Reply Quote 0
                                    • Jetson NanoJ
                                      Jetson Nano @Jetson Nano
                                      last edited by Jetson Nano

                                      @Alex-Kushleyev @tom
                                      Guys I checked what you guys mentioned.
                                      Screenshot from 2025-01-14 09-47-51.png
                                      Screenshot from 2025-01-14 09-46-54.png
                                      The en_external_uart_ap is set to True, but when I run the command voxl-inspect-mavlink mavlink_offboard , the terminal is showing waiting for pipe to connect and not showing anything else.

                                      Adding to the previous point there is no mavlink_offboard showing up.

                                      Screenshot from 2025-01-14 09-58-47.png

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

                                        @Jetson-Nano , is voxl-mavlink-server actually running? you can check using voxl-inspect-services.

                                        Also, are you sure that your Flight Core V2 is connected to /dev/ttyHS1 , which would be implied by using autopilot_uart_bus: 1 . How exactly are you connecting it to VOXL2?

                                        Alex

                                        Jetson NanoJ 1 Reply Last reply Reply Quote 0
                                        • Jetson NanoJ
                                          Jetson Nano @Alex Kushleyev
                                          last edited by

                                          @Alex-Kushleyev
                                          yes the voxl-mavlink-server is running, I had checked it.

                                          I am following this documentation for FC connections.

                                          [link](https://docs.modalai.com/flight-core-connections/#:~:text=Using the MCBL-00010](%2F,which can lead to issues.)

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

                                            @Jetson-Nano , can you please clarify which connector on VOXL2 is your Flight Core connected to (for uart communication) and whether you have any indication that the communication is established? Have you previously been able to connect to VOXL2 from QGC and access the Flight Core V2 while it has been connected to VOXL2?

                                            Alex

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