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

    ESC Calibration Error Voxl2

    ESCs
    3
    3
    280
    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.
    • A
      AP123
      last edited by AP123

      I'm trying to Calibrate my 4 in 1 ESCs. I run the command listed here https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/master/voxl-esc-tools/calibration.md. At the end, no calibration parameters file is printed, only error. How can i fix this to get the parameters file so i may upload it through the Voxl with this command ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/<params_file>.xml to successfully calibrate the ESCs?

      Thank You

      ERROR IS BELOW:

      ./voxl-esc-calibrate.py --id 0 --pwm-min 10 --pwm-max 95 --pwm-step 3 --pwm-step-duration 0.7
      Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
      [GCC 8.4.0]
      Found voxl-esc tools bin version: 1.4
      VOXL Platform: M0054
      Detected RB5 Flight, VOXL2 M0054 or M0104!
      INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 2000000
      Sending library name request: libslpi_qrb5165_io.so
      Received standard error event 2
      Sending initialization request
      INFO: ESC(s) detected on port: /dev/slpi-uart-2, baud rate: 2000000
      WARNING:
      This test requires motors to spin at high speeds with
      propellers attached. Please ensure that appropriate
      protective equipment is being worn at all times and
      that the motor and propeller are adequately isolated
      from all persons.

      For best results, please perform this test at the
      nominal voltage for the battery used.

      Type "Yes" to continue: yes

      POW: 0, RPM: 1353.00, Voltage: 15.79V, Current: 0.05A
      POW: 0, RPM: 1369.00, Voltage: 15.79V, Current: 0.05A
      POW: 0, RPM: 1385.00, Voltage: 15.79V, Current: 0.02A
      POW: 0, RPM: 1419.00, Voltage: 15.79V, Current: 0.07A
      POW: 0, RPM: 1419.00, Voltage: 15.79V, Current: 0.07A
      POW: 0, RPM: 1453.00, Voltage: 15.79V, Current: 0.02A
      POW: 0, RPM: 1453.00, Voltage: 15.79V, Current: 0.02A
      POW: 0, RPM: 1486.00, Voltage: 15.79V, Current: 0.17A
      POW: 0, RPM: 1486.00, Voltage: 15.79V, Current: 0.17A
      POW: 0, RPM: 1499.00, Voltage: 15.79V, Current: 0.02A
      POW: 5, RPM: 1569.00, Voltage: 15.79V, Current: -0.23A
      POW: 10, RPM: 969.00, Voltage: 15.79V, Current: -0.02A
      POW: 10, RPM: 969.00, Voltage: 15.79V, Current: -0.02A
      POW: 10, RPM: 928.00, Voltage: 15.79V, Current: 0.12A
      POW: 10, RPM: 913.00, Voltage: 15.79V, Current: 0.01A

      ...

      POW: 46, RPM: 4759.00, Voltage: 15.77V, Current: 0.23A
      POW: 46, RPM: 4759.00, Voltage: 15.77V, Current: 0.26A
      ...

      POW: 79, RPM: 8226.00, Voltage: 15.75V, Current: 0.38A
      POW: 79, RPM: 8162.00, Voltage: 15.75V, Current: 0.39A
      ...

      POW: 94, RPM: 9683.00, Voltage: 15.74V, Current: 0.45A
      POW: 94, RPM: 9691.00, Voltage: 15.74V, Current: 0.42A

      INFO: Test took 20.56 seconds
      Quadratic fit: motor_voltage = a2rpm_desired^2 + a1rpm_desired + a0
      a0 = -177.472309779
      a1 = 1.57805489295
      a2 = -3.72938840838e-06
      ESC Params (after scaling):
      pwm_vs_rpm_curve_a0 = -177.472309779
      pwm_vs_rpm_curve_a1 = 1.57805489295
      pwm_vs_rpm_curve_a2 = -3.72938840838e-06
      Traceback (most recent call last):
      File "./voxl-esc-calibrate.py", line 194, in <module>
      plt.plot(rpms, motor_voltages, 'bo')
      File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 3250, in plot
      ax = gca()
      File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 962, in gca
      return gcf().gca(**kwargs)
      File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 592, in gcf
      return figure()
      File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 539, in figure
      **kwargs)
      File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 171, in new_figure_manager
      return cls.new_figure_manager_given_figure(num, fig)
      File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 1049, in new_figure_manager_given_figure
      window = Tk.Tk(className="matplotlib")
      File "/usr/lib/python3.6/tkinter/init.py", line 2023, in init
      self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
      _tkinter.TclError: no display name and no $DISPLAY environment variable

      Abdullah01A 1 Reply Last reply Reply Quote 0
      • Abdullah01A
        Abdullah01 @AP123
        last edited by

        @AP123

        Same question here,

        Did you solve the this?

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

          @Abdullah01 , the original issue was that ESC calibration was actually done without propellers mounted, you can see the current at 94% power was very small, 0.4A

          However, the script still produced the a0, a1, a2 parameters (which would have been wrong to use because calibration was done without a propeller..)

          The error at the end was a result of attempted plot - since voxl2 does not have a display attached, the plot failed. Since that version, we have transitioned to using plotly for plotting, and calibration plots are saved to disk in addition to attempt to plot it to display. The plot feature was updated after SDK 1.1.2 release, but you can get it directly from gitlab here : https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/dev/voxl-esc-tools/voxl-esc-calibrate.py (just get the whole voxl-esc repo from dev branch on your voxl2 and run the calibration procedure).

          Meanwhile, we will add additional checking of the calibration to catch the conditions that do not look like proper calibration (when propeller is not mounted, etc..).

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