Tag Archives: firmware

Flashing SimonK with Arduino through the signal wire (1-wire)

In this article I will show you how to flash the SimonK firmware with your Arduino through the ESC´s signal wire without removing the shrink tube and using an ISP Programmer.

Important: to flash the firmware through the signal wire, the bootloader of the ESC must be enabled. This is the case if you have bought a SimonK preflashed ESC (like the Afro Series ESC) or you have already flashed the ESC with an ISP Programmer and have enabled the bootloader by yourself.

Needed parts:

  • Arduino board
  • ESC with enabled bootloader

Making ArduinoUSBLinker:

First we need to flash the ArduinoUSBLinker code on the Arduino. If you want to upload it through the Arduino Software, download the source code from github. Open the ArduinoUSBLinker.ino file in the Arduino Software, select the right COM port and upload it to the Arduino board.

ArduinoUSB.Linker.Pic3

You can also use the KKmulticopter Flash Tool for making the ArduinoUSBLinker. Go to the “Tools”-menu and click on “Upload Arduino USB Linker” and select your Arduino board. Wait for the message, that you should connect the Arduino to the PC. Then plug it in and click “Ok”. The Arduino should be detected by the system. If the flashing is successful, the Arduino board is ready.

ArduinoUSB.Linker.Pic1

How-To connect:

Connect the orange wire (signal wire) from the ESC to Digital Pin2 on the Arduino and the brown wire (ground) to the GND Pin on the Arduino. Connect the ESC to an external power.

Flashing the firmware:

Flashing the SimonK firmware through the signal wire is almost like flashing the firmware with an ISP Programmer. The only difference is, you choose as an Programmer the ArduinoUSBLinker. Choose the right controller (without bootloader, as it is already enabled), the right firmware and firmware version and click on the green button on the right to flash it.

ArduinoUSB.Linker.Pic2

If you wish to enable the comp_pwm (aka damped light) function, check how to do it in the article mentioned above.

You can also flash the SimonK firmware using the RapidFlash App for Google Chrome. It looks very similar to the Baseflight/Cleanflight Configurator for the Naze32/CC3D boards. Select the Programmer, COM Port, Firmware and the Firmware version and click flash. On the ”Advanced”-Tab you can enable the comp_pwm function much easier than with KKmulticopter Flash Tool.

RapidFlash.Pic1

If you have any problems, feel free to comment.

How to flash SimonK and enable comp_pwm

Many of the ESCs on the market have their own firmware and are not optimized for using in multicopters. The solution to this problem is to flash a special firmware on these. Note: Not all of the ESCs can be flashed with these firmwares. Check this list to see which ESCs are supported.

Two of the most used firmwares are the SimonK and BLHeli. Which one is better is hardly to say, especially when using different type of motors. Here I will show you, how to flash the SimonK firmware on an HK BlueSeries 12a ESC and more importantly how to enable the comp_pwm function on it.

But what is comp_pwm? It is not exact the same thing as damped light on BLHeli, but it performs a bit like an ESC with damped light function enabled. On the KISS ESCs it is called active freewheeling. It switches the passive MOSFET on your ESC “ON” during the freewheeling phases and by this reducing the power loss. If you want to learn more about PWM and active freewheeling, watch this video here.

Back to damped light or regenerative braking: what does it do? When you reduce the throttle the motor does not stop immediately. When comp_pwm is enabled, it also helps the ESC to stop the motor faster. This allows faster response of your copter. This video shows it very clear. Note: I am not sure if the guy in the video has enabled the comp_pwm feature on the ESC with the SimonK 2014-09-30 firmware. On SimonK firmware the alternative of damped light is called “MOTOR_BRAKE” and can also be enabled.

You will need the following tools to flash the SimonK or BLHeli firmware on your ESC:

  • An ISP Programmer – USBasp AVR Programming Device for ATMEL; you can also use an Arduino as ISP device, but it is easier with the USBasp. If you still want to use the Arduino check how to do it on this page. You will need to install the drivers for it too.
  • Atmel Atmega Socket Firmware Flashing Tool. On some ESCs, that have pads on the PCB board you can even do it without this tool. I have done it once on my HK BlueSeries 30A, but it is much much easier with that tool. It is worth every penny and saved me so much time.

There are several software applications you use to flash the firmware. I have always used the KKmulticopter Flash Tool. If you want to enable the comp_pwm function you will need the latest version 0.80 beta 6.

I will show you how to do the flashing with the KKmulticopter Flash Tool. Plug the USBasp into your PCs USB-port. If you are using the Atmega Socket Firmware Flashing Tool connect it to the USBasp device.

IMG_9914

If you have decided to do it without the tool, connect the pins of your USBasp device with cables to the pads of your ESC (you need to identify the MISO, MOSI, GND, VCC, SCK and RESET pads on your ESC).

IMAG0295IMAG0297

Once everything is connected you need to supply power to the ESC. It is not recommended to use a LiPo battery as a external power supply, so do it on your own risk.

Start the KKmulticopter Flash Tool. Choose the USBasp as a programmer. Then choose your ESC type. As said I will be flashing my HK BlueSeries 12a, which has an atmega8 (note: most of the ESCs on the market has this one or a Silabs-chip). Be sure to choose the one “+ enable Bootloader”, so you can later flash new firmware easily trough the servo-cable of the ESC.

It is very important to flash the right firmware on the ESC or you can damage it. The list with the supported ESCs on top of this page tells you, which one is the right for you. Last but not least you can define the firmware version. The latest one SimonK from 2015-04-19 support another useful function called “OneShot125”. It is a modification on how the flight controller and the ESC communicate between each other. It should give us a more responsive system, but there could be issues with some ESCs and motors.

KKmulticopter.Pic1

If you don’t want to enable comp_pwm, you need only to click on the green button and the firmware will be flashed to the ESC. You should get the “Flashing of firmware was successful” message.

If you want to get use of the feature click on the “SimonK Firmware Compiler”-Tab. Select the version, click Download on the right and choose again the right one for your ESC. Then on the tgy.asm-Tab scroll down to the line where COMP_PWM is defined. To use enable it replace the “0” with “1”, click “Save” and then “Compile”. The newly created file is ready to flash and you can click on the green button to flash it on the ESC. That’s it 🙂

KKmulticopter.Pic2