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

    VOXL2 ESC calibration issue

    Ask your questions right here!
    2
    8
    328
    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.
    • yashas katteY
      yashas katte
      last edited by

      I am facing issues with esc calibration.
      Out motor setup is EMAX 1407 3300KV.
      On no load it is pulling 10Amps but the motors are heating till extent of it burning during calibration.
      I ran voxl-esc-tools provided in the website.
      Also , VOXL2 is arming and when we tested VOXL2 drone. After particular throttle input value the motor directions are reversed.
      While doing the spin test we are able to get correct rpm as specified in the command.
      Only during the calibration we are facing motor heating issue.
      The configurtion of the VOXL2 is with TBS crsf reciver and MATEKYS gps/mag.

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

        Hi @yashas-katte

        Can you please provide some more details:

        • what do you mean "on no load" - does that mean without propellers motors are drawing 10A each? please clarify..
        • are you calibrating the ESC using voxl-esc-calibrate.py script?
        • are you doing the calibration procedure without propellers? This calibration procedure needs to run with propellers
        • what propeller do you intend to use with this motor?
        • what is the exact calibration command you are using?
        • what voltage are you using to power the ESC?
        • can you provide the calibration output printout? it will print things like motor rpm, voltage, current, esc temperature

        thank you

        Alex Kushleyev

        1 Reply Last reply Reply Quote 0
        • yashas katteY
          yashas katte
          last edited by

          We calibrated using props again , and we got the following curve
          Here is the calibaration curve
          da6ed83c-aa11-48f2-ab6b-03dceb59e19a-image.png

          Also we uploaded new params file after changing the pwm_rpm curve values in the params file

          esc_params_modalai_4_in_1_reva
          <?xml version="1.0" encoding="UTF-8"?>
          
          <!-- Copyright (c) 2020 ModalAI Inc.
          
          Redistribution and use in source and binary forms, with or without
          modification, are permitted provided that the following conditions are met:
          
          1. Redistributions of source code must retain the above copyright notice,
             this list of conditions and the following disclaimer.
          
          2. Redistributions in binary form must reproduce the above copyright notice,
             this list of conditions and the following disclaimer in the documentation
             and/or other materials provided with the distribution.
          
          3. Neither the name of the copyright holder nor the names of its contributors
             may be used to endorse or promote products derived from this software
             without specific prior written permission.
          
          4. The Software is used solely in conjunction with devices provided by
             ModalAI Inc.
          
          THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
          AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
          IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
          ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
          LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
          CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
          SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
          INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
          CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
          ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
          POSSIBILITY OF SUCH DAMAGE.
          
          For a license to use on non-ModalAI hardware, please contact license@modalai.com -->
          
          <EscParameters>
          
            <IdParams>
              <param name="id"              value="127"/>  <!-- 0-7 .. 127 means use hardware ID pins to read ID-->
              <param name="dir"             value="2"/>    <!-- 0=fwd, 1=rev, 2=fwd id-based, 3=rev id-based -->
            </IdParams>
          
            <BoardParams>
              <param name="id_map"          value="[0, 1, 2, 3, 4, 5, 6, 7]"/> <!-- reserved for future use -->
              <param name="vsense_scale"    value="6.0"/>  <!-- voltage_mv = adc_val_mv * vsense_mult / vsense_ div -->
              <param name="isense_scale"    value="10.35"/> <!-- Ima * 0.002 * 50 = Vmv, so mult is 1 / (0.002 * 50) = 10 . Note that actual gain is a bit off -->
              <param name="isense_zero_mv"  value="550"/>  <!-- voltage offset of current sensor when current is zero (0.55V by design) -->
            </BoardParams>
          
            <UartParams>
              <param name="protocol_version" value="2"/>          <!-- reserved for future use -->
              <param name="input_mode"       value="0"/>          <!-- reserved for future use -->
              <param name="baud_rate"        value="250000"/>    <!-- communication bit rate -->
              <param name="char_timeout_ns"  value="0"/>          <!-- not used -->
              <param name="cmd_timeout_ns"   value="100000000"/>  <!-- timeout for incoming commands before ESC will stop the motor -->
            </UartParams>
          
            <TuneParams>
              <param name="pwm_frequency"       value="48000"/>  <!-- switching freqency of PWM signal going to motors. 24Khz and 48Khz are only options for now -->
              <param name="vbat_nominal_mv"     value="14800"/>  <!-- used for sanity checking and limiting of voltage-dependent funcions -->
              <param name="num_cycles_per_rev"  value="12"/>      <!-- number of pole pairs in the motor. used for converting electrical frequency to mechanical rpm -->
              <param name="min_rpm"             value="2000"/>   <!-- minimum RPM that will be attempted, otherwise capped -->
              <param name="max_rpm"             value="14000"/>  <!-- maximum RPM that will be attempted, otherwise capped -->
              <param name="min_pwm"             value="50"/>     <!-- cap for minimum power to be ever applied. max is 999 -->
              <param name="max_pwm"             value="999"/>    <!-- cap for maximum power to be ever applied. max is 999 -->
              <param name="pwm_vs_rpm_curve_a0" value="820.9319894407308"/>  <!-- this is actually motor_voltage vs rpm curve.. using legacy naming -->
              <param name="pwm_vs_rpm_curve_a1" value="0.32413781010302617"/> <!-- Emax RS1306 3300KV with tri-blade 3x3x3 -->
              <param name="pwm_vs_rpm_curve_a2" value="4.3083453074080803e-05"/>
              <param name="kp"                  value="130"/>    <!-- RPM controller proportional gain -->
              <param name="ki"                  value="30"/>     <!-- RPM controller proportional gain -->
              <param name="max_kpe"             value="300"/>    <!-- maximum proportional erorr term (max is 999) -->
              <param name="max_kie"             value="100"/>    <!-- maximum integral error term (max is 999) -->
              <param name="max_rpm_delta"       value="1200"/>    <!-- cap for maximum rpm error used in RPM controller -->
          
              <param name="alignment_time_ns"   value="0"/>
              <param name="spinup_power"        value="50"/>      <!-- power used to give the motor initial kick (out of 999) -->
              <param name="latch_power"         value="60"/>     <!-- power used during latching stage of spin-up (out of 999)-->
              <param name="min_num_cross_for_closed_loop" value="50"/>  <!-- exit latching mode of fixed power after this number of zero crossings -->
          
              <param name="brake_to_stop"       value="0"/>             <!-- apply brake when stopping motor (or not) -->
              <param name="stall_timeout_ns"    value="20000000"/>      <!-- after spin-up, if no zero crossing is not detected for this amount of time, motor is considered stalled -->
              <param name="require_reset_if_stalled"      value="0"/>   <!-- require sending an array of zero commands to reset before next spin-up, if motor stalled -->
          
              <param name="tone_freqs_10hz"     value="[200, 215, 225, 250]"/> <!-- 200 is 2000Hz, max 255 -->
              <param name="tone_times_ms"       value="[10, 10, 10, 10]"/>     <!-- duration of each tone in units of 10 milli-seconds. Poor naming!!! -->
              <param name="tone_powers"         value="[100, 100, 100, 100]"/> <!-- max is 255 -->
          
              <param name="dt_threshold_ns"       value="150000"/>      <!-- during start up, ignore inter-commutation times less than this val, probably noise -->
              <param name="max_dt_ns"             value="2500000"/>     <!-- min and max values for time between two commutations. these are used as caps -->
              <param name="min_dt_ns"             value="10000"/>
              <param name="dt_bootstrap_ns"       value="2000000"/>     <!-- filter bootstrap value for commutation dt during start up -->
          
              <param name="spinup_stall_dt_ns"    value="6000000"/>     <!-- during spin-up, if no zero crossing is not detected for this amount of time, motor is considered stalled -->
              <param name="spinup_stall_check_ns" value="30000000"/>    <!-- time after beginning of spinup to start checking for spinup stall -->
          
              <param name="timing_advance"        value="0"/>
              <param name="sense_advance"         value="0"/>
          
              <param name="demag_timing"          value="0"/>    <!-- unused -->
          
            </TuneParams>
          </EscParameters>
          

          When we did tried testing with rc (TBS CRSF)
          The motors stated to jerk a after a particular value. But now its able to hover.
          Due to this the motors are getting hot.
          Here is video of the testing https://drive.google.com/file/d/1AI8XXBeXe78EUSjfSondXSTwdiGqmcOd/view?usp=sharing

          Thanks for your help

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

            @yashas-katte , I checked your params and num_cycles_per_rev value should be 6 , not 12 because the value is the number of pole pairs (there are 12 poles but 6 pole pairs). Please change this value to 6 and re-run the calibration.

            I checked the video, thank you for sending. The vibrations you are experiencing are most likely related to Flight Controller tuning, not ESCs. It is also possible that there may be lots of IMU gyro noise. The motors are getting hot because the Flight Controller is sending noisy RPM commands and motors are commanded to accelerate and decelerate very quickly.

            I do have a recommendation for you to try:

            • change the num_cycles_per_rev to 6
            • re-run the calibration and update the ESC params
            • disable the P and I term of RPM controller by setting kp=0, ki=0. this will make the ESC response softer and maybe make tuning of Flight Controller easier.
            • upload these new params to the ESC
            • try flying again
            1 Reply Last reply Reply Quote 0
            • yashas katteY
              yashas katte
              last edited by yashas katte

              Thank you @Alex-Kushleyev , your solution works.
              I changed all the params and calibratied again.
              It worked. I am attaching the video again.

              https://drive.google.com/file/d/1lZ5AZj1xFoN48AhW3gvqxc2g21uIb-cC/view?usp=sharing

              Thanks again!

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

                Very cool!

                So, just to clarify, you just changed the num_cycles_per_rev from 12 to 6 and re-calibrated ESCs and the drone started flying fine? Or did you have to do any other tuning on PX4 side?

                Thanks!

                1 Reply Last reply Reply Quote 0
                • yashas katteY
                  yashas katte
                  last edited by

                  Yes , I just changed num_per_cycle , re calibrated the esc. It flew!
                  Did not do any calibration from PX4 side.
                  Is there any PX4 calibration tool?

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

                    I was not implying that any other calibration needed to be done on the PX4 side. Sometimes you need to tune PX4 control gains, but it seems the default gains worked for you. Thank you for clarifying!

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