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

    Starling 2 Max Drone drifting off

    Ask your questions right here!
    3
    7
    257
    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.
    • V
      vamsi
      last edited by vamsi

      Hi Team,

      I am using Starling 2 max, and I was trying to fly the drone in manual mode using the remote controller to do initial basic checks before using Mavsdk to fly the drone.

      When I try to fly the drone, it drifts toward the left instead of vertical take-off.

      I tried to run
      systemctl stop voxl-px4
      ./voxl-esc-spin.py --id 255 --power 60 --ramp-time 3.0 --timeout 4.0 --enable-plot 1 without having any propellers and screws to check if there is any rpm difference in the motors the below are the results

      ed4c6afe-a3ba-411d-9d36-37984d33b0c9-image.png

      c449f4c1-6f30-4d43-a75d-03f7bf563e36-image.png

      43233ca2-fcc0-488a-a9f5-105474c47f75-image.png

      d84f8bcd-bde9-4d0d-86e5-6b1ac1ce2fdd-image.png

      3e8c5536-34e0-4a5e-9ba2-032af504e9a6-image.png

      416fd223-4910-429d-911d-6545731ad5cc-image.png
      ead90dbb-5974-422a-9ab2-642dde6c8fc3-image.png

      9f98fc36-77c0-4a28-b7b8-a8d6827eb428-image.png

      I am unsure if the deviation of 264.00 rpm is causing this issue.

      please find the attached px4 logs -> https://review.px4.io/plot_app?log=23827d44-827c-4f54-897c-b0ccac53c96a

      Can you please help me with this issue?

      ModeratorM 1 Reply Last reply Reply Quote 0
      • ModeratorM
        Moderator ModalAI Team @vamsi
        last edited by

        @vamsi manual mode will have drift, are you sure there is really an issue? Manual mode has no position control

        V 1 Reply Last reply Reply Quote 0
        • V
          vamsi @Moderator
          last edited by vamsi

          @Moderator Thank you for the response; I was going through the https://www.youtube.com/watch?v=Cpbbye3Z6co in that the drone does not have any drift in the manual mode, so I thought I might have missed any configuration changes.

          When I changed my mode to "indoor_vio_missing_gps.params" and when I controlled it with the Remote Controller, I was able to fly it in the position mode, and when I changed it to Off-board mode on RC, it did the figure 8.

          The Drone still drifts off when I run the below code in the Position mode

          #!/usr/bin/env python3

          """
          Caveat when attempting to run the examples in non-gps environments:

          drone.offboard.stop() will return a COMMAND_DENIED result because it
          requires a mode switch to HOLD, something that is currently not supported in a
          non-gps environment.
          """

          import asyncio

          from mavsdk import System
          from mavsdk.offboard import (OffboardError, PositionNedYaw)

          async def run():
          """ Does Offboard control using position NED coordinates. """

          drone = System()
          print("Connecting to vehicle using port 14550")
          await drone.connect(system_address="udp://:14550")
          
          print("Waiting for drone to connect...")
          async for state in drone.core.connection_state():
              if state.is_connected:
                  print(f"-- Connected to drone!")
                  break
          
          
          
          print("-- Arming")
          await drone.action.arm()
          
          max_speed = await drone.action.get_maximum_speed()
          
          
          print(f"Maximum speed: {max_speed} m/s")
          
          await drone.action.set_maximum_speed(0.5)
          await asyncio.sleep(4)
          
          max_speed = await drone.action.get_maximum_speed()
          
          await asyncio.sleep(5)
          
          print("-- Setting initial setpoint")
          await drone.offboard.set_position_ned(PositionNedYaw(0.0, 0.0, 0.0, 0.0))
          
          
          
          
          print("-- Starting offboard")
          try:
              await drone.offboard.start()
          except OffboardError as error:
              print(f"Starting offboard mode failed \
                      with error code: {error._result.result}")
              print("-- Disarming")
              await drone.action.disarm()
              return
          
          await asyncio.sleep(5)
          
          print("-- Go 0m North, 0m East, -0.20m Down \
                  within local coordinate system")
          await drone.offboard.set_position_ned(
                  PositionNedYaw(0.0, 0.0, -0.20, 0.0))
          await asyncio.sleep(3)
          
          #print("-- Go 0m North, 0m East, 0m Down within local coordinate system")
          #await drone.offboard.set_position_ned(PositionNedYaw(0.0, 0.0, 0.0, 0.0)
          #await asyncio.sleep(5)
          
          print("Trying to land")
          try:
              await drone.action.land()
          except:
              print("Failed to land")
          
          print("-- Disarming")
          try:
              await drone.action.disarm()
          except:
              print("Disarming failed")
          

          if name == "main":
          # Run the asyncio loop
          asyncio.run(run())

          I ran the above code and after taking off the drone again drifted off

          here are the attached videos

          Flight video

          Questions:

          1. Is there a configuration or calibration step I may have missed to prevent drifting?
          2. Does the script require any additional commands for better stability ?
          3. Could this be related to parameter tuning or sensor limitations in a non-GPS environment?
            Thank you for your assistance!
          Eric KatzfeyE 1 Reply Last reply Reply Quote 0
          • Eric KatzfeyE
            Eric Katzfey ModalAI Team @vamsi
            last edited by

            @vamsi So it works fine in position mode and offboard (figure 8 mode)? And in manual mode how bad is the drift? Are you able to fly it but just notice it drifting to one side or is it completely unflyable? Is it really just the mavsdk program you are trying to get working now? One thing to be careful of is having voxl-vision-hub sending offboard commands for the figure 8 at the same time that you are sending offboard commands from your mavsdk program.

            V 1 Reply Last reply Reply Quote 0
            • V
              vamsi @Eric Katzfey
              last edited by vamsi

              Hi @Eric-Katzfey, Thank you for your response and for pointing out potential issues.

              1. Yes, when I fly with the RC in Position mode and Offboard mode, it works fine.

              2. In Manual mode, the drone is completely unflyable. When I try to take off, it drifts aggressively to one side. The logs attached in my initial comment were recorded during an attempt to take off from the ground.

              3. Yes, the MAVSDK program I mentioned was the only one I was running at the time.

              4. Oh, is there a way to disable the Offboard figure-8 commands from voxl-vision-hub? (Edit: do I need to update "/etc/modalai/voxl-vision-hub.conf" and set "offboard_mode": "off"? Is this enough to turn off the figure 8 mode?)

              Thank you for your support!

              Eric KatzfeyE 1 Reply Last reply Reply Quote 0
              • Eric KatzfeyE
                Eric Katzfey ModalAI Team @vamsi
                last edited by

                @vamsi Yes, you should change offboard_mode to off if you have another source of offboard commands. Regarding manual mode, can you fly in altitude hold mode? Can you go through the level horizon calibration, accel, compass, gyro, and RC calibration processes again and see if that helps the drift problem at all?

                V 1 Reply Last reply Reply Quote 0
                • V
                  vamsi @Eric Katzfey
                  last edited by

                  @Eric-Katzfey

                  Thank you for your response.

                  For Manual mode, I recalibrated the level horizon, accel, compass, and gyro. However, during the RC calibration, I noticed a small shift in the yaw when all the sticks are in their neutral positions. I’m unsure if this is contributing to the issue. I attempted to recalibrate it several times, but the yaw does not reset to the 0 position. Please find the attached screenshot for your reference:
                  ca3710fa-d00c-4444-b9cf-2fe8d267f7f4-image.png .

                  As you suggested, I tried flying in Altitude Hold mode, and the drone drifted in the direction where the yaw was shifted.

                  Is there a way to fix the yaw offset?

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