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

ModalAI Forum

  1. ModalAI Support Forum
  2. ESCs
  3. VOXL 2 Mini & VOXL Mini 4-in-1 ESC Configuration for PWM Motor Control

VOXL 2 Mini & VOXL Mini 4-in-1 ESC Configuration for PWM Motor Control

Scheduled Pinned Locked Moved ESCs
18 Posts 3 Posters 3.5k Views 1 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.
  • JP DroneJ JP Drone

    I am in the process of assembling a drone using the VOXL 2 Mini in conjunction with the VOXL Mini 4-in-1 ESC and an external FC. I selected the VOXL Mini 4-in-1 ESC due to its features of PWM control and power output capabilities.

    Through the voxl-esc utility, I have successfully executed scan and spin commands, confirming that the motors are operational. However, when attempting to test the motors via PWM signals from the external FC, there is no response.

    Could you please guide me on whether there is any additional setup required to enable motor movement via PWM through the VOXL Mini 4-in-1 ESC? Are there specific parameters or configurations that need to be adjusted on the ESC to facilitate this?
    I would like to mention that I have not yet performed the ESC calibration. Could the lack of calibration be a factor in the motors not responding to PWM inputs from the external FC?

    I'm looking forward to your suggestions and advice to resolve this issue.

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

    Hello, @JP-Drone,

    The mini ESC is designed to communicate with VOXL2 and VOXL2-mini using the UART interface. Flight controller communicates with the ESC and sends desired RPM commands (for closed loop RPM control) and receives feedback from the ESC, which provides information for flight diagnostics. Before using the UART interface in flight, the ESC must be calibrated to work with a specific motor/propeller in order to achieve correct RPM control (or an existing calibration loaded, if you are using a motor, which we provided calibration for). Please note that this calibration is not the same as PWM pulse calibration for a typical ESC.

    Can you please confirm where you are trying to connect the PWM input to (on the mini-esc board)? Are you using the test points labeled A0, A1, A2, A3 ?

    The PWM input is currently disabled in the firmware because we strongly recommend using the UART protocol and over time there was lack of interest in the PWM input.

    Please note that we do not advertise the PWM input in our specifications https://docs.modalai.com/voxl-mini-esc-datasheet/ . However, if you feel that you REALLY need this feature, please let me know and we can re-enable it. We can support either 1-2ms pulse or 125-250us pulse (oneShot125), but not auto detect. Also please note that we do not actively test PWM input, as our focus is on UART communication.

    Alex

    JP DroneJ 1 Reply Last reply
    0
    • Alex KushleyevA Alex Kushleyev

      Hello, @JP-Drone,

      The mini ESC is designed to communicate with VOXL2 and VOXL2-mini using the UART interface. Flight controller communicates with the ESC and sends desired RPM commands (for closed loop RPM control) and receives feedback from the ESC, which provides information for flight diagnostics. Before using the UART interface in flight, the ESC must be calibrated to work with a specific motor/propeller in order to achieve correct RPM control (or an existing calibration loaded, if you are using a motor, which we provided calibration for). Please note that this calibration is not the same as PWM pulse calibration for a typical ESC.

      Can you please confirm where you are trying to connect the PWM input to (on the mini-esc board)? Are you using the test points labeled A0, A1, A2, A3 ?

      The PWM input is currently disabled in the firmware because we strongly recommend using the UART protocol and over time there was lack of interest in the PWM input.

      Please note that we do not advertise the PWM input in our specifications https://docs.modalai.com/voxl-mini-esc-datasheet/ . However, if you feel that you REALLY need this feature, please let me know and we can re-enable it. We can support either 1-2ms pulse or 125-250us pulse (oneShot125), but not auto detect. Also please note that we do not actively test PWM input, as our focus is on UART communication.

      Alex

      JP DroneJ Offline
      JP DroneJ Offline
      JP Drone
      Contributor
      wrote on last edited by
      #3

      @Alex-Kushleyev
      Thank you for reply.
      We understood the circumstances in which RPM control is recommended.
      However, I would like to continue testing PWM control as well.

      Yes, we are connecting the PWM input to A0 - A3 and try to using with 1-2ms pulse.
      Please let me know when it's enabled.

      Alex KushleyevA 1 Reply Last reply
      0
      • JP DroneJ JP Drone

        @Alex-Kushleyev
        Thank you for reply.
        We understood the circumstances in which RPM control is recommended.
        However, I would like to continue testing PWM control as well.

        Yes, we are connecting the PWM input to A0 - A3 and try to using with 1-2ms pulse.
        Please let me know when it's enabled.

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

        @JP-Drone , I can help you with this. However, I am currently out of office until next Wednesday and I can prepare the firmware for you at that time. I hope it is not a big issue for you. Without the firmware update, there is no way to make it work.

        JP DroneJ 1 Reply Last reply
        0
        • Alex KushleyevA Alex Kushleyev

          @JP-Drone , I can help you with this. However, I am currently out of office until next Wednesday and I can prepare the firmware for you at that time. I hope it is not a big issue for you. Without the firmware update, there is no way to make it work.

          JP DroneJ Offline
          JP DroneJ Offline
          JP Drone
          Contributor
          wrote on last edited by
          #5

          @Alex-Kushleyev
          Thank you for your response. I understand your availability and appreciate your willingness to assist. I'll await your firmware update next Wednesday.

          I attempted to upgrade the ESC firmware before, but encountered an error:
          ERROR: Bus 12 is already initialized. To reinitialize, please close it first.

          Besides enabling bridge (disabling voxl-px4), are there any other services I should stop or additional steps I should take to free up the serial bus before attempting the ESC firmware upgrade?

          $ voxl-esc
          Starting Wizard
          
          What do you want to do?
          1) scan              3) spin              5) upload_params
          2) detect            4) upgrade_firmware
          #? 4
          enabling bridge
          bridge enabled
          [INFO] Setting CPU to performance mode
          [INFO] Scanning for ESC...
          Received standard error event 2
          [INFO] M0129-3 detected
          [INFO] has for most recent firmware: eb6fb500
          [INFO] Expected ESC firmware info:
                  Firmware: modalai_esc_firmware_m0129_3_v0_39_RC10_eb6fb500.bin
                  Firmware hash: eb6fb500
          
          [INFO] Number of ESCs with correct FW: 0
          
          [INFO] 0 of the ESCs do not have the current firmware
          [INFO] Uploading current ESC firmware...
          Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
          [GCC 8.4.0]
          Found voxl-esc tools bin version: 1.6
          
          INFO: Firmware file name : firmware/modalai_esc_firmware_m0129_3_v0_39_RC10_eb6fb500.bin
          INFO: Firmware file size : 22672 bytes
          
          
          VOXL Platform: M0104
          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: Unable to detect ESCs in order to reset them..:
          'NoneType' object has no attribute 'get_detected'
          WARGING: Attempting to continue
          ERROR:   Bus 12 is already initialized. To reinitialize, please close it first.
          Updated baud rate to 230400
          INFO: Installing firmware to ESC ID 0 : firmware/modalai_esc_firmware_m0129_3_v0_39_RC10_eb6fb500.bin
          
          ERROR: An error occured during the write process.
          [ERROR] failed to upload firmware to ESC0
          disabling bridge
          bridge disabled
          EXITING VOXL-ESC WITH ERROR
          
          Alex KushleyevA 1 Reply Last reply
          0
          • JP DroneJ JP Drone

            @Alex-Kushleyev
            Thank you for your response. I understand your availability and appreciate your willingness to assist. I'll await your firmware update next Wednesday.

            I attempted to upgrade the ESC firmware before, but encountered an error:
            ERROR: Bus 12 is already initialized. To reinitialize, please close it first.

            Besides enabling bridge (disabling voxl-px4), are there any other services I should stop or additional steps I should take to free up the serial bus before attempting the ESC firmware upgrade?

            $ voxl-esc
            Starting Wizard
            
            What do you want to do?
            1) scan              3) spin              5) upload_params
            2) detect            4) upgrade_firmware
            #? 4
            enabling bridge
            bridge enabled
            [INFO] Setting CPU to performance mode
            [INFO] Scanning for ESC...
            Received standard error event 2
            [INFO] M0129-3 detected
            [INFO] has for most recent firmware: eb6fb500
            [INFO] Expected ESC firmware info:
                    Firmware: modalai_esc_firmware_m0129_3_v0_39_RC10_eb6fb500.bin
                    Firmware hash: eb6fb500
            
            [INFO] Number of ESCs with correct FW: 0
            
            [INFO] 0 of the ESCs do not have the current firmware
            [INFO] Uploading current ESC firmware...
            Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
            [GCC 8.4.0]
            Found voxl-esc tools bin version: 1.6
            
            INFO: Firmware file name : firmware/modalai_esc_firmware_m0129_3_v0_39_RC10_eb6fb500.bin
            INFO: Firmware file size : 22672 bytes
            
            
            VOXL Platform: M0104
            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: Unable to detect ESCs in order to reset them..:
            'NoneType' object has no attribute 'get_detected'
            WARGING: Attempting to continue
            ERROR:   Bus 12 is already initialized. To reinitialize, please close it first.
            Updated baud rate to 230400
            INFO: Installing firmware to ESC ID 0 : firmware/modalai_esc_firmware_m0129_3_v0_39_RC10_eb6fb500.bin
            
            ERROR: An error occured during the write process.
            [ERROR] failed to upload firmware to ESC0
            disabling bridge
            bridge disabled
            EXITING VOXL-ESC WITH ERROR
            
            Alex KushleyevA Offline
            Alex KushleyevA Offline
            Alex Kushleyev
            ModalAI Team
            wrote on last edited by
            #6

            @JP-Drone, i am not sure why this is happening - does it happen every time you try to update the firmware this way?

            Can you please try another way:

            get the latest dev branch of voxl-esc to voxl2 mini:

            git clone https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc -b dev /home/root/voxl-esc
            

            then go to /home/root/voxl-esc/voxl-esc-tools and try:

            stop px4:

            systemctl stop voxl-px4
            

            scan to make sure all 4 ESC channels are detected:

            ./voxl-esc-scan.py
            

            Then update firmware and see if that is successful (it should re-upload the current firmware, since it seems that you do have the latest installed already)

            ./voxl-esc-upload-firmware-all.sh
            
            Alex KushleyevA 1 Reply Last reply
            0
            • Alex KushleyevA Alex Kushleyev

              @JP-Drone, i am not sure why this is happening - does it happen every time you try to update the firmware this way?

              Can you please try another way:

              get the latest dev branch of voxl-esc to voxl2 mini:

              git clone https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc -b dev /home/root/voxl-esc
              

              then go to /home/root/voxl-esc/voxl-esc-tools and try:

              stop px4:

              systemctl stop voxl-px4
              

              scan to make sure all 4 ESC channels are detected:

              ./voxl-esc-scan.py
              

              Then update firmware and see if that is successful (it should re-upload the current firmware, since it seems that you do have the latest installed already)

              ./voxl-esc-upload-firmware-all.sh
              
              Alex KushleyevA Offline
              Alex KushleyevA Offline
              Alex Kushleyev
              ModalAI Team
              wrote on last edited by Alex Kushleyev
              #7

              Hello @JP-Drone ,

              I have added firmware that supports pwm inputs using the aux IO pins. Mini ESC (M0129) is one of the boards that does support this feature (using the inputs labeled A0,A1,A2,A3, also make sure to connect GND between the flight controller and ESC).

              You can find the firmware located here https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/tree/enable-pwm-input-in-firmware/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin - you can install it using the standard firmware flashing procedure. Note that the firmware for other ESCs (M0049, M0117, M0134) in this location also supports PWM input (except for M0138 ESC, which has no pwm input connector / pads).

              Some notes about this functionality:

              • the acceptable pulse is 1000-2000us
              • suggested minimum for use in flight controller is 1050 when armed, 950 when disarmed
              • 2000us is mapped to 100% power
              • the pwm input signal is mapped to % output power, not RPM
              • if there is any valid packets received by the ESC via UART, the pwm input interface is disabled until the ESC is rebooted. This should not happen unless you are actually communicating with the ESC via UART. This is done to avoid any possible interference between UART-based control and PWM-based control while in flight. UART protocol is still fully functional.
              • there is no filtering on of the PWM input signal (sometimes done using a Resistor + Capacitor circuit to reduce signal noise). If wires between flight controller and ESC are long, the input signal could be noisy.

              Even if you don't use UART for sending real-time commands, I still suggest that you update the ESC parameters for your motor / propeller / battery and spin-up parameters for smooth sinusoidal spin-up. You can start with the following param file and update the following :https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/enable-pwm-input-in-firmware/voxl-esc-params/boards/esc_params_generic_m0129.xml

              • vbat_nominal_mv
              • num_cycles_per_rev
              • pwm_vs_rpm_curve_a0, a1, a2 (set to zero)
              • max_rpm_delta (set to zero)
              • protection_stall_check_rpm (set to min_rpm/2 or min_rpm/3 - this will trigger stall protection and stop motor if motor is spinning slower than this rpm)

              if you want to use smooth sinusoidal spinup, update the following ( you could choose not to use sinusoidal spinup as well)

              • spinup_type (set to 1)
              • motor_kv
              • spinup_bemf_comp (set to 1)
              • spinup_rpm_target and spinup_time_ms (according to desired)
              • tune spinup_power (increase from 70 to 80, 90, or 100 if the motor has trouble spinning up), but avoid setting too high, otherwise motor will draw higher current during spinup (not very critical)

              As I mentioned before, this feature is not thoroughly tested, but it does work. Please test with caution and build up your confidence using bench testing before you start flying. Let me know if you have any further questions.

              Alex

              JP DroneJ Jeremy FrederickJ 3 Replies Last reply
              0
              • Alex KushleyevA Alex Kushleyev

                Hello @JP-Drone ,

                I have added firmware that supports pwm inputs using the aux IO pins. Mini ESC (M0129) is one of the boards that does support this feature (using the inputs labeled A0,A1,A2,A3, also make sure to connect GND between the flight controller and ESC).

                You can find the firmware located here https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/tree/enable-pwm-input-in-firmware/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin - you can install it using the standard firmware flashing procedure. Note that the firmware for other ESCs (M0049, M0117, M0134) in this location also supports PWM input (except for M0138 ESC, which has no pwm input connector / pads).

                Some notes about this functionality:

                • the acceptable pulse is 1000-2000us
                • suggested minimum for use in flight controller is 1050 when armed, 950 when disarmed
                • 2000us is mapped to 100% power
                • the pwm input signal is mapped to % output power, not RPM
                • if there is any valid packets received by the ESC via UART, the pwm input interface is disabled until the ESC is rebooted. This should not happen unless you are actually communicating with the ESC via UART. This is done to avoid any possible interference between UART-based control and PWM-based control while in flight. UART protocol is still fully functional.
                • there is no filtering on of the PWM input signal (sometimes done using a Resistor + Capacitor circuit to reduce signal noise). If wires between flight controller and ESC are long, the input signal could be noisy.

                Even if you don't use UART for sending real-time commands, I still suggest that you update the ESC parameters for your motor / propeller / battery and spin-up parameters for smooth sinusoidal spin-up. You can start with the following param file and update the following :https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/enable-pwm-input-in-firmware/voxl-esc-params/boards/esc_params_generic_m0129.xml

                • vbat_nominal_mv
                • num_cycles_per_rev
                • pwm_vs_rpm_curve_a0, a1, a2 (set to zero)
                • max_rpm_delta (set to zero)
                • protection_stall_check_rpm (set to min_rpm/2 or min_rpm/3 - this will trigger stall protection and stop motor if motor is spinning slower than this rpm)

                if you want to use smooth sinusoidal spinup, update the following ( you could choose not to use sinusoidal spinup as well)

                • spinup_type (set to 1)
                • motor_kv
                • spinup_bemf_comp (set to 1)
                • spinup_rpm_target and spinup_time_ms (according to desired)
                • tune spinup_power (increase from 70 to 80, 90, or 100 if the motor has trouble spinning up), but avoid setting too high, otherwise motor will draw higher current during spinup (not very critical)

                As I mentioned before, this feature is not thoroughly tested, but it does work. Please test with caution and build up your confidence using bench testing before you start flying. Let me know if you have any further questions.

                Alex

                JP DroneJ Offline
                JP DroneJ Offline
                JP Drone
                Contributor
                wrote on last edited by
                #8

                @Alex-Kushleyev Thank you! I will check it works.

                1 Reply Last reply
                0
                • Alex KushleyevA Alex Kushleyev

                  Hello @JP-Drone ,

                  I have added firmware that supports pwm inputs using the aux IO pins. Mini ESC (M0129) is one of the boards that does support this feature (using the inputs labeled A0,A1,A2,A3, also make sure to connect GND between the flight controller and ESC).

                  You can find the firmware located here https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/tree/enable-pwm-input-in-firmware/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin - you can install it using the standard firmware flashing procedure. Note that the firmware for other ESCs (M0049, M0117, M0134) in this location also supports PWM input (except for M0138 ESC, which has no pwm input connector / pads).

                  Some notes about this functionality:

                  • the acceptable pulse is 1000-2000us
                  • suggested minimum for use in flight controller is 1050 when armed, 950 when disarmed
                  • 2000us is mapped to 100% power
                  • the pwm input signal is mapped to % output power, not RPM
                  • if there is any valid packets received by the ESC via UART, the pwm input interface is disabled until the ESC is rebooted. This should not happen unless you are actually communicating with the ESC via UART. This is done to avoid any possible interference between UART-based control and PWM-based control while in flight. UART protocol is still fully functional.
                  • there is no filtering on of the PWM input signal (sometimes done using a Resistor + Capacitor circuit to reduce signal noise). If wires between flight controller and ESC are long, the input signal could be noisy.

                  Even if you don't use UART for sending real-time commands, I still suggest that you update the ESC parameters for your motor / propeller / battery and spin-up parameters for smooth sinusoidal spin-up. You can start with the following param file and update the following :https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/enable-pwm-input-in-firmware/voxl-esc-params/boards/esc_params_generic_m0129.xml

                  • vbat_nominal_mv
                  • num_cycles_per_rev
                  • pwm_vs_rpm_curve_a0, a1, a2 (set to zero)
                  • max_rpm_delta (set to zero)
                  • protection_stall_check_rpm (set to min_rpm/2 or min_rpm/3 - this will trigger stall protection and stop motor if motor is spinning slower than this rpm)

                  if you want to use smooth sinusoidal spinup, update the following ( you could choose not to use sinusoidal spinup as well)

                  • spinup_type (set to 1)
                  • motor_kv
                  • spinup_bemf_comp (set to 1)
                  • spinup_rpm_target and spinup_time_ms (according to desired)
                  • tune spinup_power (increase from 70 to 80, 90, or 100 if the motor has trouble spinning up), but avoid setting too high, otherwise motor will draw higher current during spinup (not very critical)

                  As I mentioned before, this feature is not thoroughly tested, but it does work. Please test with caution and build up your confidence using bench testing before you start flying. Let me know if you have any further questions.

                  Alex

                  JP DroneJ Offline
                  JP DroneJ Offline
                  JP Drone
                  Contributor
                  wrote on last edited by
                  #9

                  @Alex-Kushleyev
                  I updated to the new firmware.
                  However, ESC ID 3 doesn't work now.

                  ESC ID 3 is set as the fallback from this message.

                  WARNING: 57600 baud rate is the fallback baud rate if ESC params are not valid
                  

                  I then attempted to rewrite the parameter using this command, but it failed.

                  ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml --device /dev/slpi-uart-2 --baud-rate 57600
                  

                  In light of this situation, could you advise if it's possible to fix the configuration issue with ESC ID 3 for proper functionality?

                  Logs:

                  Here is the log of the firmware update, and it's successful.

                  voxl2-mini:~/voxl-esc/voxl-esc-tools(enable-pwm-input-in-firmware)$ ./voxl-esc-scan.py
                  Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                  [GCC 8.4.0]
                  Found voxl-esc tools bin version: 1.6
                  VOXL Platform: M0104
                  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, protocol: firmware
                  
                  
                  INFO: ESC Information:
                  INFO: ---------------------
                          ID         : 0
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0036
                          Firmware   : version   37, hash a0ca0a86
                          Bootloader : version  184, hash 10bf24c8
                  
                          ID         : 1
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0032
                          Firmware   : version   37, hash a0ca0a86
                          Bootloader : version  184, hash 10bf24c8
                  
                          ID         : 2
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0034
                          Firmware   : version   37, hash a0ca0a86
                          Bootloader : version  184, hash 10bf24c8
                  
                          ID         : 3
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0038
                          Firmware   : version   37, hash a0ca0a86
                          Bootloader : version  184, hash 10bf24c8
                  
                  ---------------------
                  
                  
                  
                  
                  voxl2-mini:~/voxl-esc/voxl-esc-tools(enable-pwm-input-in-firmware)$ ./voxl-esc-upload-firmware-all.sh
                  Usage:
                  - Autodetect board and upload latest firmware to all ESCs:
                      ./voxl-esc-upload-firmware-all.sh
                  - Autodetect board and upload latest firmware to a single ESC ID <esc_id>:
                      ./voxl-esc-upload-firmware-all.sh <esc_id>
                  
                  Detecting ESCs...
                  Received standard error event 2
                  [INFO] M0129-3 detected
                  ESC Firmware:  modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                  Flashing all ESCs
                  Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                  [GCC 8.4.0]
                  Found voxl-esc tools bin version: 1.6
                  
                  INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                  INFO: Firmware file size : 23024 bytes
                  
                  
                  VOXL Platform: M0104
                  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
                  INFO: ESC(s) detected: [0, 1, 2, 3]
                  INFO: Sending reset command to ESC ID 0
                  Updated baud rate to 230400
                  INFO: Installing firmware to ESC ID 0 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                          Progress: 100% [##################################################]
                  
                  INFO: Firmware successfully updated for ESC id 0
                  Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                  [GCC 8.4.0]
                  Found voxl-esc tools bin version: 1.6
                  
                  INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                  INFO: Firmware file size : 23024 bytes
                  
                  
                  VOXL Platform: M0104
                  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
                  INFO: ESC(s) detected: [1, 2, 3]
                  INFO: Sending reset command to ESC ID 1
                  Updated baud rate to 230400
                  INFO: Installing firmware to ESC ID 1 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                          Progress: 100% [##################################################]
                  
                  INFO: Firmware successfully updated for ESC id 1
                  Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                  [GCC 8.4.0]
                  Found voxl-esc tools bin version: 1.6
                  
                  INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                  INFO: Firmware file size : 23024 bytes
                  
                  
                  VOXL Platform: M0104
                  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
                  INFO: ESC(s) detected: [2, 3]
                  INFO: Sending reset command to ESC ID 2
                  Updated baud rate to 230400
                  INFO: Installing firmware to ESC ID 2 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                          Progress: 100% [##################################################]
                  
                  INFO: Firmware successfully updated for ESC id 2
                  Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                  [GCC 8.4.0]
                  Found voxl-esc tools bin version: 1.6
                  
                  INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                  INFO: Firmware file size : 23024 bytes
                  
                  
                  VOXL Platform: M0104
                  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
                  INFO: ESC(s) detected: [3]
                  INFO: Sending reset command to ESC ID 3
                  Updated baud rate to 230400
                  INFO: Installing firmware to ESC ID 3 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                          Progress: 100% [##################################################]
                  
                  INFO: Firmware successfully updated for ESC id 3
                  

                  And then I uploaded the parameters. It seems to write IDs 0, 1, and 2, but it fails for ID 3.

                  voxl2-mini:~/voxl-esc/voxl-esc-tools(enable-pwm-input-in-firmware)$ ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml
                  Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                  [GCC 8.4.0]
                  Found voxl-esc tools bin version: 1.6
                  
                  INFO: Params file name : ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml
                  INFO: Params file size : 7419 bytes
                  
                  
                  VOXL Platform: M0104
                  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
                  INFO: ESCs detected:
                  INFO: ---------------------
                  ID: 1, SW: 39, HW: 40: ModalAi 4-in-1 ESC (M0129-3)
                  ID: 2, SW: 39, HW: 40: ModalAi 4-in-1 ESC (M0129-3)
                  ---------------------
                  INFO: Loading XML config file...
                  INFO: Uploading params for ESC ID 255...
                  -- board config
                  -- id config
                  -- uart config
                  -- tune config
                      DONE
                  INFO: Resetting ESCs...
                      DONE
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 250000
                  INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                  Updated baud rate to 230400
                  ERROR: No ESC(s) detected
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 921600
                  INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                  Updated baud rate to 230400
                  ERROR: No ESC(s) detected
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 230400
                  INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                  Updated baud rate to 230400
                  ERROR: No ESC(s) detected
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 57600
                  INFO: ESC(s) detected on port: /dev/slpi-uart-2, baud rate: 57600
                  INFO: ESCs detected:
                  INFO: ---------------------
                  ID: 0, SW: 39, HW: 40: ModalAi 4-in-1 ESC (M0129-3)
                  ---------------------
                  INFO: Loading XML config file...
                  INFO: Uploading params for ESC ID 255...
                  -- board config
                  -- id config
                  -- uart config
                  -- tune config
                      DONE
                  INFO: Resetting ESCs...
                      DONE
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 115200
                  INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                  ERROR:   voxl_uart_read_bytes: Bus '12' is not initialized
                  Updated baud rate to 230400
                  ERROR: No ESC(s) detected
                  

                  Scan command says ID 3 is fallback mode.

                  voxl2-mini:/$ voxl-esc
                  Starting Wizard
                  
                  What do you want to do?
                  1) scan              3) spin              5) upload_params
                  2) detect            4) upgrade_firmware
                  #? 1
                  enabling bridge
                  bridge enabled
                  Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                  [GCC 8.4.0]
                  Found voxl-esc tools bin version: 1.6
                  VOXL Platform: M0104
                  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, protocol: firmware
                  
                  
                  INFO: ESC Information:
                  INFO: ---------------------
                          ID         : 0
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0036
                          Firmware   : version   39, hash eef79926
                          Bootloader : version  184, hash 10bf24c8
                  
                          ID         : 1
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0032
                          Firmware   : version   39, hash eef79926
                          Bootloader : version  184, hash 10bf24c8
                  
                          ID         : 2
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0034
                          Firmware   : version   39, hash eef79926
                          Bootloader : version  184, hash 10bf24c8
                  
                  ---------------------
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 250000
                  INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                  Updated baud rate to 230400
                  WARNING: No ESC(s) detected
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 921600
                  INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                  ERROR:   voxl_uart_read_bytes: Bus '12' is not initialized
                  Updated baud rate to 230400
                  WARNING: No ESC(s) detected
                  VOXL Platform: M0104
                  Detected RB5 Flight, VOXL2 M0054 or M0104!
                  INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 57600
                  INFO: ESC(s) detected on port: /dev/slpi-uart-2, baud rate: 57600, protocol: firmware
                  
                  
                  INFO: ESC Information:
                  INFO: ---------------------
                          ID         : 3
                          Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                          UID        : 0x2039333557555304003D0038
                          Firmware   : version   39, hash eef79926
                          Bootloader : version  184, hash 10bf24c8
                  
                  ---------------------
                  
                  WARNING: 57600 baud rate is the fallback baud rate if ESC params are not valid
                  WARNING: Please verify params using voxl-esc-verify-params.py
                  WARNING: Motors will not spin unless valid params are present
                  ---------------------
                  
                  Found ESCs:
                  id: 0, port: /dev/slpi-uart-2, baud rate: 2000000
                  id: 1, port: /dev/slpi-uart-2, baud rate: 2000000
                  id: 2, port: /dev/slpi-uart-2, baud rate: 2000000
                  id: 3, port: /dev/slpi-uart-2, baud rate: 57600
                  successfully pinged ESCs
                  disabling bridge
                  bridge disabled
                  DONE
                  
                  ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml --device /dev/slpi-uart-2 --baud-rate 57600
                  

                  6c300ae2-0fbd-447b-894d-a3fe34902dc6-image.png

                  esc_params_generic_m0129_pwm.xml

                  <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>
                  
                    <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="2000000"/>     <!-- 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="7"/>      <!-- number of pole pairs in the motor. used for converting electrical frequency to mechanical rpm -->
                      <param name="min_rpm"             value="4000"/>   <!-- minimum RPM that will be attempted, otherwise capped -->
                      <param name="max_rpm"             value="29344"/>  <!-- maximum RPM that will be attempted, otherwise capped -->
                      <param name="min_pwm"             value="70"/>     <!-- 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="0"/>  <!-- this is actually motor_voltage vs rpm curve.. using legacy naming -->
                      <param name="pwm_vs_rpm_curve_a1" value="0"/> <!-- Emax RS1306 3300KV with tri-blade 3x3x3 -->
                      <param name="pwm_vs_rpm_curve_a2" value="0"/>
                      <param name="kp"                  value="0"/>    <!-- RPM controller proportional gain -->
                      <param name="ki"                  value="0"/>     <!-- RPM controller proportional gain -->
                      <param name="max_kpe"             value="0"/>    <!-- maximum proportional erorr term (max is 999) -->
                      <param name="max_kie"             value="0"/>    <!-- maximum integral error term (max is 999) -->
                      <param name="max_rpm_delta"       value="0"/>    <!-- cap for maximum rpm error used in RPM controller -->
                      
                      <param name="spinup_type"         value="0"/>      <!-- 0: traditional, 1: sinusoidal -->
                      <param name="spinup_power"        value="70"/>     <!-- power used to during spin-up procedure -->
                      <param name="latch_power"         value="80"/>     <!-- power used during latching stage of spin-up (out of 999)-->
                      <param name="spinup_power_ramp"   value="8"/>      <!-- it will take ( 4096 / (spinup_power_ramp*10000) ) seconds to ramp sinusoidal start-up power from 0 to spinup_power -->
                      <param name="spinup_rpm_target"   value="1000"/>   <!-- Desired RPM at the end of the sinusoidal spin-up procedure -->
                      <param name="spinup_time_ms"      value="1000"/>   <!-- Duration of the sinusoidal spin-up procedure -->
                      <param name="spinup_bemf_comp"    value="0"/>      <!-- 0: disable, 1:enable back-emf compensation in sinusoidal spin-up procedure -->
                      <param name="motor_kv"            value="2850 "/>    <!-- kV value of the motor. used in back-emf compensation during spin-up -->
                  
                      <param name="min_num_cross_for_closed_loop" value="100"/>  <!-- exit latching mode of fixed power after this number of zero crossings -->
                      <param name="protection_stall_check_rpm" value="1000"/> <!-- if motor spins below this RPM, stall check will trigger and stop / restart the motor -->
                  
                      <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"          value="[200, 215, 225, 250, 0,0,0,0, 0,0,0,0]"/> <!-- 200 is 2000Hz, max 255 -->
                      <param name="tone_durations"      value="[10,  10,  10,  10,  0,0,0,0, 0,0,0,0]"/> <!-- duration of each tone in units of 10 milli-seconds. Poor naming!!! -->
                      <param name="tone_powers"         value="[60,  60,  60,  60,  0,0,0,0, 0,0,0,0]"/> <!-- 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="alignment_time_ns"     value="0"/>           <!-- alignment time before spin-up -->
                      <param name="timing_advance"        value="0"/>
                      <param name="sense_advance"         value="0"/>
                  
                      <param name="demag_timing"          value="0"/>    <!-- unused -->
                  
                    </TuneParams>
                  </EscParameters>
                  
                  Alex KushleyevA 1 Reply Last reply
                  0
                  • JP DroneJ JP Drone

                    @Alex-Kushleyev
                    I updated to the new firmware.
                    However, ESC ID 3 doesn't work now.

                    ESC ID 3 is set as the fallback from this message.

                    WARNING: 57600 baud rate is the fallback baud rate if ESC params are not valid
                    

                    I then attempted to rewrite the parameter using this command, but it failed.

                    ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml --device /dev/slpi-uart-2 --baud-rate 57600
                    

                    In light of this situation, could you advise if it's possible to fix the configuration issue with ESC ID 3 for proper functionality?

                    Logs:

                    Here is the log of the firmware update, and it's successful.

                    voxl2-mini:~/voxl-esc/voxl-esc-tools(enable-pwm-input-in-firmware)$ ./voxl-esc-scan.py
                    Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                    [GCC 8.4.0]
                    Found voxl-esc tools bin version: 1.6
                    VOXL Platform: M0104
                    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, protocol: firmware
                    
                    
                    INFO: ESC Information:
                    INFO: ---------------------
                            ID         : 0
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0036
                            Firmware   : version   37, hash a0ca0a86
                            Bootloader : version  184, hash 10bf24c8
                    
                            ID         : 1
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0032
                            Firmware   : version   37, hash a0ca0a86
                            Bootloader : version  184, hash 10bf24c8
                    
                            ID         : 2
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0034
                            Firmware   : version   37, hash a0ca0a86
                            Bootloader : version  184, hash 10bf24c8
                    
                            ID         : 3
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0038
                            Firmware   : version   37, hash a0ca0a86
                            Bootloader : version  184, hash 10bf24c8
                    
                    ---------------------
                    
                    
                    
                    
                    voxl2-mini:~/voxl-esc/voxl-esc-tools(enable-pwm-input-in-firmware)$ ./voxl-esc-upload-firmware-all.sh
                    Usage:
                    - Autodetect board and upload latest firmware to all ESCs:
                        ./voxl-esc-upload-firmware-all.sh
                    - Autodetect board and upload latest firmware to a single ESC ID <esc_id>:
                        ./voxl-esc-upload-firmware-all.sh <esc_id>
                    
                    Detecting ESCs...
                    Received standard error event 2
                    [INFO] M0129-3 detected
                    ESC Firmware:  modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                    Flashing all ESCs
                    Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                    [GCC 8.4.0]
                    Found voxl-esc tools bin version: 1.6
                    
                    INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                    INFO: Firmware file size : 23024 bytes
                    
                    
                    VOXL Platform: M0104
                    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
                    INFO: ESC(s) detected: [0, 1, 2, 3]
                    INFO: Sending reset command to ESC ID 0
                    Updated baud rate to 230400
                    INFO: Installing firmware to ESC ID 0 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                            Progress: 100% [##################################################]
                    
                    INFO: Firmware successfully updated for ESC id 0
                    Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                    [GCC 8.4.0]
                    Found voxl-esc tools bin version: 1.6
                    
                    INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                    INFO: Firmware file size : 23024 bytes
                    
                    
                    VOXL Platform: M0104
                    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
                    INFO: ESC(s) detected: [1, 2, 3]
                    INFO: Sending reset command to ESC ID 1
                    Updated baud rate to 230400
                    INFO: Installing firmware to ESC ID 1 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                            Progress: 100% [##################################################]
                    
                    INFO: Firmware successfully updated for ESC id 1
                    Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                    [GCC 8.4.0]
                    Found voxl-esc tools bin version: 1.6
                    
                    INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                    INFO: Firmware file size : 23024 bytes
                    
                    
                    VOXL Platform: M0104
                    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
                    INFO: ESC(s) detected: [2, 3]
                    INFO: Sending reset command to ESC ID 2
                    Updated baud rate to 230400
                    INFO: Installing firmware to ESC ID 2 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                            Progress: 100% [##################################################]
                    
                    INFO: Firmware successfully updated for ESC id 2
                    Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                    [GCC 8.4.0]
                    Found voxl-esc tools bin version: 1.6
                    
                    INFO: Firmware file name : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                    INFO: Firmware file size : 23024 bytes
                    
                    
                    VOXL Platform: M0104
                    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
                    INFO: ESC(s) detected: [3]
                    INFO: Sending reset command to ESC ID 3
                    Updated baud rate to 230400
                    INFO: Installing firmware to ESC ID 3 : /home/root/voxl-esc/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin
                            Progress: 100% [##################################################]
                    
                    INFO: Firmware successfully updated for ESC id 3
                    

                    And then I uploaded the parameters. It seems to write IDs 0, 1, and 2, but it fails for ID 3.

                    voxl2-mini:~/voxl-esc/voxl-esc-tools(enable-pwm-input-in-firmware)$ ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml
                    Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                    [GCC 8.4.0]
                    Found voxl-esc tools bin version: 1.6
                    
                    INFO: Params file name : ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml
                    INFO: Params file size : 7419 bytes
                    
                    
                    VOXL Platform: M0104
                    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
                    INFO: ESCs detected:
                    INFO: ---------------------
                    ID: 1, SW: 39, HW: 40: ModalAi 4-in-1 ESC (M0129-3)
                    ID: 2, SW: 39, HW: 40: ModalAi 4-in-1 ESC (M0129-3)
                    ---------------------
                    INFO: Loading XML config file...
                    INFO: Uploading params for ESC ID 255...
                    -- board config
                    -- id config
                    -- uart config
                    -- tune config
                        DONE
                    INFO: Resetting ESCs...
                        DONE
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 250000
                    INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                    Updated baud rate to 230400
                    ERROR: No ESC(s) detected
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 921600
                    INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                    Updated baud rate to 230400
                    ERROR: No ESC(s) detected
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 230400
                    INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                    Updated baud rate to 230400
                    ERROR: No ESC(s) detected
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 57600
                    INFO: ESC(s) detected on port: /dev/slpi-uart-2, baud rate: 57600
                    INFO: ESCs detected:
                    INFO: ---------------------
                    ID: 0, SW: 39, HW: 40: ModalAi 4-in-1 ESC (M0129-3)
                    ---------------------
                    INFO: Loading XML config file...
                    INFO: Uploading params for ESC ID 255...
                    -- board config
                    -- id config
                    -- uart config
                    -- tune config
                        DONE
                    INFO: Resetting ESCs...
                        DONE
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 115200
                    INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                    ERROR:   voxl_uart_read_bytes: Bus '12' is not initialized
                    Updated baud rate to 230400
                    ERROR: No ESC(s) detected
                    

                    Scan command says ID 3 is fallback mode.

                    voxl2-mini:/$ voxl-esc
                    Starting Wizard
                    
                    What do you want to do?
                    1) scan              3) spin              5) upload_params
                    2) detect            4) upgrade_firmware
                    #? 1
                    enabling bridge
                    bridge enabled
                    Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00)
                    [GCC 8.4.0]
                    Found voxl-esc tools bin version: 1.6
                    VOXL Platform: M0104
                    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, protocol: firmware
                    
                    
                    INFO: ESC Information:
                    INFO: ---------------------
                            ID         : 0
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0036
                            Firmware   : version   39, hash eef79926
                            Bootloader : version  184, hash 10bf24c8
                    
                            ID         : 1
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0032
                            Firmware   : version   39, hash eef79926
                            Bootloader : version  184, hash 10bf24c8
                    
                            ID         : 2
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0034
                            Firmware   : version   39, hash eef79926
                            Bootloader : version  184, hash 10bf24c8
                    
                    ---------------------
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 250000
                    INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                    Updated baud rate to 230400
                    WARNING: No ESC(s) detected
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 921600
                    INFO: Scanning for ESC bootloader: /dev/slpi-uart-2, baud: 230400
                    ERROR:   voxl_uart_read_bytes: Bus '12' is not initialized
                    Updated baud rate to 230400
                    WARNING: No ESC(s) detected
                    VOXL Platform: M0104
                    Detected RB5 Flight, VOXL2 M0054 or M0104!
                    INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 57600
                    INFO: ESC(s) detected on port: /dev/slpi-uart-2, baud rate: 57600, protocol: firmware
                    
                    
                    INFO: ESC Information:
                    INFO: ---------------------
                            ID         : 3
                            Board      : version 40: ModalAi 4-in-1 ESC (M0129-3)
                            UID        : 0x2039333557555304003D0038
                            Firmware   : version   39, hash eef79926
                            Bootloader : version  184, hash 10bf24c8
                    
                    ---------------------
                    
                    WARNING: 57600 baud rate is the fallback baud rate if ESC params are not valid
                    WARNING: Please verify params using voxl-esc-verify-params.py
                    WARNING: Motors will not spin unless valid params are present
                    ---------------------
                    
                    Found ESCs:
                    id: 0, port: /dev/slpi-uart-2, baud rate: 2000000
                    id: 1, port: /dev/slpi-uart-2, baud rate: 2000000
                    id: 2, port: /dev/slpi-uart-2, baud rate: 2000000
                    id: 3, port: /dev/slpi-uart-2, baud rate: 57600
                    successfully pinged ESCs
                    disabling bridge
                    bridge disabled
                    DONE
                    
                    ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml --device /dev/slpi-uart-2 --baud-rate 57600
                    

                    6c300ae2-0fbd-447b-894d-a3fe34902dc6-image.png

                    esc_params_generic_m0129_pwm.xml

                    <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>
                    
                      <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="2000000"/>     <!-- 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="7"/>      <!-- number of pole pairs in the motor. used for converting electrical frequency to mechanical rpm -->
                        <param name="min_rpm"             value="4000"/>   <!-- minimum RPM that will be attempted, otherwise capped -->
                        <param name="max_rpm"             value="29344"/>  <!-- maximum RPM that will be attempted, otherwise capped -->
                        <param name="min_pwm"             value="70"/>     <!-- 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="0"/>  <!-- this is actually motor_voltage vs rpm curve.. using legacy naming -->
                        <param name="pwm_vs_rpm_curve_a1" value="0"/> <!-- Emax RS1306 3300KV with tri-blade 3x3x3 -->
                        <param name="pwm_vs_rpm_curve_a2" value="0"/>
                        <param name="kp"                  value="0"/>    <!-- RPM controller proportional gain -->
                        <param name="ki"                  value="0"/>     <!-- RPM controller proportional gain -->
                        <param name="max_kpe"             value="0"/>    <!-- maximum proportional erorr term (max is 999) -->
                        <param name="max_kie"             value="0"/>    <!-- maximum integral error term (max is 999) -->
                        <param name="max_rpm_delta"       value="0"/>    <!-- cap for maximum rpm error used in RPM controller -->
                        
                        <param name="spinup_type"         value="0"/>      <!-- 0: traditional, 1: sinusoidal -->
                        <param name="spinup_power"        value="70"/>     <!-- power used to during spin-up procedure -->
                        <param name="latch_power"         value="80"/>     <!-- power used during latching stage of spin-up (out of 999)-->
                        <param name="spinup_power_ramp"   value="8"/>      <!-- it will take ( 4096 / (spinup_power_ramp*10000) ) seconds to ramp sinusoidal start-up power from 0 to spinup_power -->
                        <param name="spinup_rpm_target"   value="1000"/>   <!-- Desired RPM at the end of the sinusoidal spin-up procedure -->
                        <param name="spinup_time_ms"      value="1000"/>   <!-- Duration of the sinusoidal spin-up procedure -->
                        <param name="spinup_bemf_comp"    value="0"/>      <!-- 0: disable, 1:enable back-emf compensation in sinusoidal spin-up procedure -->
                        <param name="motor_kv"            value="2850 "/>    <!-- kV value of the motor. used in back-emf compensation during spin-up -->
                    
                        <param name="min_num_cross_for_closed_loop" value="100"/>  <!-- exit latching mode of fixed power after this number of zero crossings -->
                        <param name="protection_stall_check_rpm" value="1000"/> <!-- if motor spins below this RPM, stall check will trigger and stop / restart the motor -->
                    
                        <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"          value="[200, 215, 225, 250, 0,0,0,0, 0,0,0,0]"/> <!-- 200 is 2000Hz, max 255 -->
                        <param name="tone_durations"      value="[10,  10,  10,  10,  0,0,0,0, 0,0,0,0]"/> <!-- duration of each tone in units of 10 milli-seconds. Poor naming!!! -->
                        <param name="tone_powers"         value="[60,  60,  60,  60,  0,0,0,0, 0,0,0,0]"/> <!-- 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="alignment_time_ns"     value="0"/>           <!-- alignment time before spin-up -->
                        <param name="timing_advance"        value="0"/>
                        <param name="sense_advance"         value="0"/>
                    
                        <param name="demag_timing"          value="0"/>    <!-- unused -->
                    
                      </TuneParams>
                    </EscParameters>
                    
                    Alex KushleyevA Offline
                    Alex KushleyevA Offline
                    Alex Kushleyev
                    ModalAI Team
                    wrote on last edited by
                    #10

                    @JP-Drone , sorry this happened to you. Sometimes from updating from much older firmware, this happens.

                    Can you please try the command you already tried with a small modification. try it several times if ti does not work:

                    ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml --device /dev/slpi-uart-2 --baud-rate 57600 --id 3
                    

                    Also maybe try to power cycle voxl2 mini and the ESC and try the above command again.

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

                      @JP-Drone , sorry this happened to you. Sometimes from updating from much older firmware, this happens.

                      Can you please try the command you already tried with a small modification. try it several times if ti does not work:

                      ./voxl-esc-upload-params.py --params-file ../voxl-esc-params/boards/esc_params_generic_m0129_pwm.xml --device /dev/slpi-uart-2 --baud-rate 57600 --id 3
                      

                      Also maybe try to power cycle voxl2 mini and the ESC and try the above command again.

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

                      also please try voxl-set-cpu-mode perf to set cpu to perf mode to avoid long sleeps, maybe that causes the voxl-esc tool to time out.

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

                        also please try voxl-set-cpu-mode perf to set cpu to perf mode to avoid long sleeps, maybe that causes the voxl-esc tool to time out.

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

                        Additionally, do you have a USB to serial adapter that you could use to connect to the ESC directly from a linux PC? Then you could run the voxl-esc tools on the PC and that is a good backup option if running the tools on VOXL2 is not working reliably. We are working to make this more reliable, but using a PC for ESC configuration is a good option as well.

                        JP DroneJ 1 Reply Last reply
                        0
                        • Alex KushleyevA Alex Kushleyev

                          Additionally, do you have a USB to serial adapter that you could use to connect to the ESC directly from a linux PC? Then you could run the voxl-esc tools on the PC and that is a good backup option if running the tools on VOXL2 is not working reliably. We are working to make this more reliable, but using a PC for ESC configuration is a good option as well.

                          JP DroneJ Offline
                          JP DroneJ Offline
                          JP Drone
                          Contributor
                          wrote on last edited by
                          #13

                          @Alex-Kushleyev Thank you very much.
                          I was able to set the parameter for ID 3 from the information you provided.

                          And, I also confirmed that the motor spins via PWM by motor tests.
                          However, after the motor test was completed, some motors continued to spin even after the FC set the PWM to 1000.
                          Some motors will stop rotating once the motor test is complete.
                          I don't know if this is a parameter issue or an ESC firmware issue.
                          I modified min_rpm and min_pwm, but did not solve the problem.

                          <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>
                          
                            <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="2000000"/>     <!-- 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="7"/>      <!-- number of pole pairs in the motor. used for converting electrical frequency to mechanical rpm -->
                              <param name="min_rpm"             value="500"/>   <!-- minimum RPM that will be attempted, otherwise capped -->
                              <param name="max_rpm"             value="29344"/>  <!-- maximum RPM that will be attempted, otherwise capped -->
                              <param name="min_pwm"             value="30"/>     <!-- 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="0"/>  <!-- this is actually motor_voltage vs rpm curve.. using legacy naming -->
                              <param name="pwm_vs_rpm_curve_a1" value="0"/> <!-- Emax RS1306 3300KV with tri-blade 3x3x3 -->
                              <param name="pwm_vs_rpm_curve_a2" value="0"/>
                              <param name="kp"                  value="250"/>    <!-- 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="0"/>    <!-- cap for maximum rpm error used in RPM controller -->
                              
                              <param name="spinup_type"         value="1"/>      <!-- 0: traditional, 1: sinusoidal -->
                              <param name="spinup_power"        value="70"/>     <!-- power used to during spin-up procedure -->
                              <param name="latch_power"         value="70"/>     <!-- power used during latching stage of spin-up (out of 999)-->
                              <param name="spinup_power_ramp"   value="8"/>      <!-- it will take ( 4096 / (spinup_power_ramp*10000) ) seconds to ramp sinusoidal start-up power from 0 to spinup_power -->
                              <param name="spinup_rpm_target"   value="1000"/>   <!-- Desired RPM at the end of the sinusoidal spin-up procedure -->
                              <param name="spinup_time_ms"      value="1000"/>   <!-- Duration of the sinusoidal spin-up procedure -->
                              <param name="spinup_bemf_comp"    value="1"/>      <!-- 0: disable, 1:enable back-emf compensation in sinusoidal spin-up procedure -->
                              <param name="motor_kv"            value="2850 "/>    <!-- kV value of the motor. used in back-emf compensation during spin-up -->
                          
                              <param name="min_num_cross_for_closed_loop" value="50"/>  <!-- exit latching mode of fixed power after this number of zero crossings -->
                              <param name="protection_stall_check_rpm" value="1000"/> <!-- if motor spins below this RPM, stall check will trigger and stop / restart the motor -->
                          
                              <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"          value="[200, 215, 225, 250, 0,0,0,0, 0,0,0,0]"/> <!-- 200 is 2000Hz, max 255 -->
                              <param name="tone_durations"      value="[10,  10,  10,  10,  0,0,0,0, 0,0,0,0]"/> <!-- duration of each tone in units of 10 milli-seconds. Poor naming!!! -->
                              <param name="tone_powers"         value="[60,  60,  60,  60,  0,0,0,0, 0,0,0,0]"/> <!-- 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="alignment_time_ns"     value="0"/>           <!-- alignment time before spin-up -->
                              <param name="timing_advance"        value="0"/>
                              <param name="sense_advance"         value="0"/>
                          
                              <param name="demag_timing"          value="0"/>    <!-- unused -->
                          
                            </TuneParams>
                          </EscParameters>
                          
                          JP DroneJ 1 Reply Last reply
                          0
                          • JP DroneJ JP Drone

                            @Alex-Kushleyev Thank you very much.
                            I was able to set the parameter for ID 3 from the information you provided.

                            And, I also confirmed that the motor spins via PWM by motor tests.
                            However, after the motor test was completed, some motors continued to spin even after the FC set the PWM to 1000.
                            Some motors will stop rotating once the motor test is complete.
                            I don't know if this is a parameter issue or an ESC firmware issue.
                            I modified min_rpm and min_pwm, but did not solve the problem.

                            <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>
                            
                              <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="2000000"/>     <!-- 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="7"/>      <!-- number of pole pairs in the motor. used for converting electrical frequency to mechanical rpm -->
                                <param name="min_rpm"             value="500"/>   <!-- minimum RPM that will be attempted, otherwise capped -->
                                <param name="max_rpm"             value="29344"/>  <!-- maximum RPM that will be attempted, otherwise capped -->
                                <param name="min_pwm"             value="30"/>     <!-- 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="0"/>  <!-- this is actually motor_voltage vs rpm curve.. using legacy naming -->
                                <param name="pwm_vs_rpm_curve_a1" value="0"/> <!-- Emax RS1306 3300KV with tri-blade 3x3x3 -->
                                <param name="pwm_vs_rpm_curve_a2" value="0"/>
                                <param name="kp"                  value="250"/>    <!-- 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="0"/>    <!-- cap for maximum rpm error used in RPM controller -->
                                
                                <param name="spinup_type"         value="1"/>      <!-- 0: traditional, 1: sinusoidal -->
                                <param name="spinup_power"        value="70"/>     <!-- power used to during spin-up procedure -->
                                <param name="latch_power"         value="70"/>     <!-- power used during latching stage of spin-up (out of 999)-->
                                <param name="spinup_power_ramp"   value="8"/>      <!-- it will take ( 4096 / (spinup_power_ramp*10000) ) seconds to ramp sinusoidal start-up power from 0 to spinup_power -->
                                <param name="spinup_rpm_target"   value="1000"/>   <!-- Desired RPM at the end of the sinusoidal spin-up procedure -->
                                <param name="spinup_time_ms"      value="1000"/>   <!-- Duration of the sinusoidal spin-up procedure -->
                                <param name="spinup_bemf_comp"    value="1"/>      <!-- 0: disable, 1:enable back-emf compensation in sinusoidal spin-up procedure -->
                                <param name="motor_kv"            value="2850 "/>    <!-- kV value of the motor. used in back-emf compensation during spin-up -->
                            
                                <param name="min_num_cross_for_closed_loop" value="50"/>  <!-- exit latching mode of fixed power after this number of zero crossings -->
                                <param name="protection_stall_check_rpm" value="1000"/> <!-- if motor spins below this RPM, stall check will trigger and stop / restart the motor -->
                            
                                <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"          value="[200, 215, 225, 250, 0,0,0,0, 0,0,0,0]"/> <!-- 200 is 2000Hz, max 255 -->
                                <param name="tone_durations"      value="[10,  10,  10,  10,  0,0,0,0, 0,0,0,0]"/> <!-- duration of each tone in units of 10 milli-seconds. Poor naming!!! -->
                                <param name="tone_powers"         value="[60,  60,  60,  60,  0,0,0,0, 0,0,0,0]"/> <!-- 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="alignment_time_ns"     value="0"/>           <!-- alignment time before spin-up -->
                                <param name="timing_advance"        value="0"/>
                                <param name="sense_advance"         value="0"/>
                            
                                <param name="demag_timing"          value="0"/>    <!-- unused -->
                            
                              </TuneParams>
                            </EscParameters>
                            
                            JP DroneJ Offline
                            JP DroneJ Offline
                            JP Drone
                            Contributor
                            wrote on last edited by
                            #14

                            We are planning to fly only in PWM.
                            Can PWM based control always be enabled as we want to avoid crashing due to the PWM to be disabled in flight?

                            if there is any valid packets received by the ESC via UART, the pwm input interface is disabled until the ESC is rebooted. This should not happen unless you are actually communicating with the ESC via UART. This is done to avoid any possible interference between UART-based control and PWM-based control while in flight. UART protocol is still fully functional.

                            Also, the flight is PWM based control, but I would like to get the ESC telemetry (RPM, voltage and current) via UART.
                            Could you make it possible?

                            Alex KushleyevA 1 Reply Last reply
                            0
                            • JP DroneJ JP Drone

                              We are planning to fly only in PWM.
                              Can PWM based control always be enabled as we want to avoid crashing due to the PWM to be disabled in flight?

                              if there is any valid packets received by the ESC via UART, the pwm input interface is disabled until the ESC is rebooted. This should not happen unless you are actually communicating with the ESC via UART. This is done to avoid any possible interference between UART-based control and PWM-based control while in flight. UART protocol is still fully functional.

                              Also, the flight is PWM based control, but I would like to get the ESC telemetry (RPM, voltage and current) via UART.
                              Could you make it possible?

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

                              @JP-Drone,

                              You should change your px4 params to send out pulse less than 1000us (900 or 950) when in disarmed mode or you can just stop sending the pulses. Please note that pwm calibration is not supported, it should not be needed.

                              Please do not change the pwm_min and max values, they are not for this purpose. These parameters limit the power that is applied to the motor, not the input pwm signal.

                              The pwm mode will not be disabled unless the esc receives a valid packet via uart (which includes correct checksum), which is virtually impossible if you do not actually have uart signals connected to flight controller.

                              Standard PWM protocol does not support requesting telemetry, so there is no way to tell ESC to send it. If you would like to make use of the full feature set of the esc, you should use our UART communication protocol, which offers the benefits that you are looking for.

                              Are you able to tell me what flight controller software you are using? Our ESC uart protocol is open and can be included into any flight controller.

                              Alex

                              JP DroneJ 1 Reply Last reply
                              0
                              • Alex KushleyevA Alex Kushleyev

                                @JP-Drone,

                                You should change your px4 params to send out pulse less than 1000us (900 or 950) when in disarmed mode or you can just stop sending the pulses. Please note that pwm calibration is not supported, it should not be needed.

                                Please do not change the pwm_min and max values, they are not for this purpose. These parameters limit the power that is applied to the motor, not the input pwm signal.

                                The pwm mode will not be disabled unless the esc receives a valid packet via uart (which includes correct checksum), which is virtually impossible if you do not actually have uart signals connected to flight controller.

                                Standard PWM protocol does not support requesting telemetry, so there is no way to tell ESC to send it. If you would like to make use of the full feature set of the esc, you should use our UART communication protocol, which offers the benefits that you are looking for.

                                Are you able to tell me what flight controller software you are using? Our ESC uart protocol is open and can be included into any flight controller.

                                Alex

                                JP DroneJ Offline
                                JP DroneJ Offline
                                JP Drone
                                Contributor
                                wrote on last edited by
                                #16

                                @Alex-Kushleyev
                                I try reducing the pulse next.

                                We use ArduPilot with an external flight controller.
                                It would be nice to use the ESC UART protocol directly from the FC.
                                Having ArduPilot work on the VOXL 2 mini would be even better.

                                1 Reply Last reply
                                0
                                • Alex KushleyevA Alex Kushleyev

                                  Hello @JP-Drone ,

                                  I have added firmware that supports pwm inputs using the aux IO pins. Mini ESC (M0129) is one of the boards that does support this feature (using the inputs labeled A0,A1,A2,A3, also make sure to connect GND between the flight controller and ESC).

                                  You can find the firmware located here https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/tree/enable-pwm-input-in-firmware/voxl-esc-tools/firmware/modalai_esc_firmware_m0129_3_v0_39_RC13_eef79926.bin - you can install it using the standard firmware flashing procedure. Note that the firmware for other ESCs (M0049, M0117, M0134) in this location also supports PWM input (except for M0138 ESC, which has no pwm input connector / pads).

                                  Some notes about this functionality:

                                  • the acceptable pulse is 1000-2000us
                                  • suggested minimum for use in flight controller is 1050 when armed, 950 when disarmed
                                  • 2000us is mapped to 100% power
                                  • the pwm input signal is mapped to % output power, not RPM
                                  • if there is any valid packets received by the ESC via UART, the pwm input interface is disabled until the ESC is rebooted. This should not happen unless you are actually communicating with the ESC via UART. This is done to avoid any possible interference between UART-based control and PWM-based control while in flight. UART protocol is still fully functional.
                                  • there is no filtering on of the PWM input signal (sometimes done using a Resistor + Capacitor circuit to reduce signal noise). If wires between flight controller and ESC are long, the input signal could be noisy.

                                  Even if you don't use UART for sending real-time commands, I still suggest that you update the ESC parameters for your motor / propeller / battery and spin-up parameters for smooth sinusoidal spin-up. You can start with the following param file and update the following :https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/enable-pwm-input-in-firmware/voxl-esc-params/boards/esc_params_generic_m0129.xml

                                  • vbat_nominal_mv
                                  • num_cycles_per_rev
                                  • pwm_vs_rpm_curve_a0, a1, a2 (set to zero)
                                  • max_rpm_delta (set to zero)
                                  • protection_stall_check_rpm (set to min_rpm/2 or min_rpm/3 - this will trigger stall protection and stop motor if motor is spinning slower than this rpm)

                                  if you want to use smooth sinusoidal spinup, update the following ( you could choose not to use sinusoidal spinup as well)

                                  • spinup_type (set to 1)
                                  • motor_kv
                                  • spinup_bemf_comp (set to 1)
                                  • spinup_rpm_target and spinup_time_ms (according to desired)
                                  • tune spinup_power (increase from 70 to 80, 90, or 100 if the motor has trouble spinning up), but avoid setting too high, otherwise motor will draw higher current during spinup (not very critical)

                                  As I mentioned before, this feature is not thoroughly tested, but it does work. Please test with caution and build up your confidence using bench testing before you start flying. Let me know if you have any further questions.

                                  Alex

                                  Jeremy FrederickJ Offline
                                  Jeremy FrederickJ Offline
                                  Jeremy Frederick
                                  Regular
                                  wrote on last edited by
                                  #17

                                  @Alex-Kushleyev Reading through this thread and access to the PWM output without using the VOXL IO board would definitely be of interest for my team, any chance the full sized VOXL ESC would have a similar capability using its AUX outputs?

                                  Alex KushleyevA 1 Reply Last reply
                                  0
                                  • Jeremy FrederickJ Jeremy Frederick

                                    @Alex-Kushleyev Reading through this thread and access to the PWM output without using the VOXL IO board would definitely be of interest for my team, any chance the full sized VOXL ESC would have a similar capability using its AUX outputs?

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

                                    @Jeremy-Frederick, can you specify which ESC you are asking about?

                                    The PWM pins on the ModalAI ESCs (which have the pwm signals on a connector or test pads) are bi-directional, and yes they could be used as PWM output. However, a firmware change is required and enabling PX4 to send out PWM signals is another change

                                    We were considering enabling this feature but it is not yet implemented. Can you please provide more information about your requirements?

                                    • what type of PWM signal are you trying to send ? min/max range, update frequency, (is it one shot, or just preriodic)
                                    • how often are you planning to update the value of this PWM signal?
                                    • how many PWM signals do you need?
                                    • what is the source for the control of PWM signal in your application (RC or something else?). The reason why I am asking, the ESC would need to receive a serial data packet from voxl_esc driver in px4, so somehow that pwm output information would need to enter the voxl_esc driver.

                                    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

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