ARM

Quadcopter BeeRotor Victory210

This is a bit of a leisurely post. After attending Maker Fair 2016 my son wanted to build a racing quad-copter. He did not want to buy a Ready To Fly (RTF) copter but rather a kit based on some recommendations from a pilot of the said show. Anyway, eventually we settled on the BeeRotor Victory210 from RCTimer.2016-11-24-14-27-47-editThere are a few guides that show step-by-step how to assemble the copter. The most helpful is certainly the one from the Blog of Nathan Vertile.
However as a total newbie to the field of quad-copters and RC models We went through a bit of troubles to get everything working. So here are some notes that eventually got us to a flying model.
Note, that I will not cover the assembly of the copter in details as we did not have much trouble to follow the guides available on-line. I will mostly focus on the software and configuration part.
Besides the copter kit we used the following components:

  1. Radio Controler: FlySky FS-i6 with iA6B Receiver
  2. Eachine VR D2 Video Goggles
  3. LiPo Battery with an XT-60 Plug, 11.1V (3s), 1800mAh

To assemble the copter, follow the assembly instruction at:

  • RCGroups Forum: https://www.rcgroups.com/forums/showthread.php?t=2631690

The only thing note worthy is that the four motor controllers (ESCs) are not all connected the same. Pay attention to the direction the motors turn.
Connect the Receiver: Once the kit is assembled the receiver needs to be connected to the BRF3 flight controller.  We use FlySky IBUS port of the iA6B receiver and connect it to UART3 pin 1-3 (S.BUS) of the connector SB on the BRF3 board. IBUS is a FlySky proprietary interface using a UART channel to forward the control to the flight controller. It replaces the traditional PWM ports.
Flash Flight Controller with Firmware: 

  1. In your Chrome browser click this link: Google Chrome App Store  and click the green “LAUNCH APP” button.
    Launch Betaflight
  2. Download the BetaFlight Firmware from here https://github.com/betaflight/betaflight/releases look out for the file: betaflight_x.x.x_SPRACINGF3.hex . I used Firmware Version 3.0.1.
  3. Click the “Load Firmware [Local]” button and load the betaflight_x.x.x_SPRACINGF3.hex file.
  4. Click “Flash Firmware”
    FW Update
  5. Connect  your computer to the micro USB port of the BRF3 while holding the boot button next to the micro USB connector down. Do not connect the battery to the Victory230 the controller will get powered over the USB cable..
  6. The flash process should now start. Wait until completed successfully.

Note 1: you can also simply select “SPRACINGF3” in the firmware pull-down menu and click the “Load Firmware [Online]” button.
So now that we have flashed the correct firmware we do the same thing for the motor controllers (ESCs). The nice thing is we can use the BRF3 in pass-through to program the ESCs.
Update ESC Firmware: this is an optional step and I believe not really required. However because I did it I list the steps to perform it.

  1. Unconnect BRF3 from Betaflight
  2. Downolad BLHeli Suite
  3. Unzip it and open the program.
  4. Select Row “E SILABS BLHeli Bootloade (Cleanflight)”
    ESC FW Update
  5. Make sure the propellers are off and then click “Connect” button and then the “Check” button.
    ESC Check
  6. Click “Flash BLHeli” and select “[Rev: 14.8] XRotor 20A MULTI” and then click OK
    ESC Select FW
  7. Wait until the flashing and verification is completed
    screenshot-2016-11-20-20-02-29
  8. Now you can check the setup of all four ESCs under the “ESC Overview” tab. Note the bold values are the only non-default settings.
    ESC Overview

Configure Flight Controller:

  1. Click the “Connect” button. Betaflight should now connect to your copter and the following screen will appear. If you have problems, check your COM port setting
  2. Put the Victory210 on a leveled surface and under the “Setup” tab click the “Calibrate Accelerometer” button. Then rotate it along all three axis at least 360 degrees within 30 seconds. Now the accelerometer should be properly calibrated.
    Calibration
  3. Move to the “Ports” tab and select the “RX” of “UART3” to enable the connection between the BRF3 to the RC receiver.
    Ports
  4. Move to the “Configuration” tab and scroll down to “Battery Voltage” and set “Voltage Scale” to 210. Next turn under the “Current Sensor” the “CURRENT_METER” on. Set the “Scale the output voltage….” to 380. Now the under voltage and over current protection will go off at the right levels.
  5. Under “Receiver Mode” select “RX_SERIAL” to configure the BRF3 to understand the FlySky receiver connected to UART3
  6. Under “Serial Receiver Provider” select IBUS to the correct protocol for the FlySky receiver.
  7. Under “System Configuration” enable the “Barometer (if suppoted)” and click “Save and Reset”

Configure the FlySky Transmitter:

  1. There is not too much to configure. The transmitter should work out of the box and shipped already paired with the receiver.
  2. Although we use it for a copter make sure that it is configured to “Plane/Glider”

Calibrate Motors:

  1. Click on the “Motors” tab.
  2. Make sure your propellers are off! Then activate  “Enable motor control”
  3. Move the “Master” slider to 100%
    Motor Calibration
  4. Connect the battery and wait until the sound stops
  5. Move the “Master” slider to 0% and wait until the sound stops
  6. Unconnect the battery

Save configuration:

  1. Go to “CLI” Tab and enter “dump” into the command line
  2. Select the display output and cut and paste to a text editor and save the file.
  3. Here is the dump I got: BRF3 configuration

Note: once you have turned the “Expert Mode” on you can also save and restore configurations under the “Setup” tab.
Maiden Flight
Before we install the propellers we want to check a few things:

  • Check that when you move the sticks only the related chnannels are chaning. If that is not the case your Radio Controller may do some mixing so you want to check this.
  • Check the Motor control. The motors are secured until you push the throttle stick (in a normal setup the left stick on your RC) to the lower right corner. Once you do this a Beep will signal that the copter is armed and you should see all four motor bars to jump to 1070.

Now it is time to install the propellers and do a first flight test. Note the propellers are not all the same: pay attention to their shape before you mount them. Consider the motors turning directions and select the propeller that works for the related directions.

  1. Firmware: Even though Natan uses Clearflight I could not get it to work with their firmware

Resources and Credit:
A big Thank You goes to all the contributors of tools and software described in this post. I also want to acknowledge the blog posts from Nathan Vertile and the countless YouTube videos I used as guides for this post.

Spark Core compiler toolchain under cygwin

There are good instructions how to install the local toolchain to compile the Spark Core firmware. I don’t want to replicate them here. Go to the Spark Core Github and check the Readme.md or search for a tutorial.
The purpose of this page is to show the steps and pitfalls when installing this toolchain under cygwin on a Windows 7 64 bit computer.
I assume you have at least the base cygwin installation on your machine. For instructions please head over to cygwin.org:
Screenshot 2014-04-07 22.05.40
Make sure you install git and any other goodies you like under cygwin.

  1. GCC for ARM Cortex processors – ARM cross compiler tool chain for Windows
  2. Make – Windows version of gmake
  3. Device Firmware Upgrade (DFU) Utilities – Utility to download the firmware to the Spark Core
  4. Zatig – USB driver for firmware downloads

Now install gcc for ARM and gnu make for Windows. Yes, cygwin also includes gmake. However there is a problem with it around dependencies. The MINGW GCC compiler uses Windows path notation in the *.d dependencies files that gmake under cygwin chokes on. So if you, the second time you try to compile, get an error like this:

obj/src/application.o.d:1: *** multiple target patterns. Stop.

it is because we use MINGW GCC under cygwin instead of a native cygwin compiler. You can also checkout a related posts on the Spark Community Board. It is now time to install the firmware. Pull the following three repositories from Github:

git clone https://github.com/spark/core-firmware.git
git clone https://github.com/spark/core-common-lib.git
git clone https://github.com/spark/core-communication-lib.git

These repositories contain all the Spark Core firmware. Once the source code is downloaded, go to the build directory in the firmware folder and start the compile:

cd core-firmware/build
make

If everything went smooth you should now have a core-firmware.bin file.  Run the Zatig program to install the USB driver. The moment has come to flash the firmware into the Spark Core. For this, push the left button to reset the core while holding down the right button. Release the reset button and wait until the RGB-LED is flashing yellow. You can now download the firmware with the following command:

make program-dfu

Screenshot 2014-04-08 03.03.57
Note the DFU utility always indicates an error “Error during download get_status” This is normal and as long as you see “File downloaded successfully” everything is fine.

Galileo is different, is it?

There a quite a number of Arduino boards available. The original Arduinos all used 8-bit AVR micro-controllers from Atmel. Recently Arduino adopted 32-bit ARM cores. In this post I want to look at the features of the Galileo board. The Board is about double the size of an original Arduino board and built around the Intel Quark X1000 controller.Galileo-circuitry_610x534 The Quark family of Intel chips are the new low cost line of x86 controllers that are positioned below the Atom cores.  Quarks are elementary particles that make up the atomic nucleus. Intel positions the Quark family for Internet of Things (IoT) applications. The X1000 controller is the first member of this line. The X1000 offers:

  • 400 MHz 32-bit x86 CPU
  • 512 Kbyte ECC protected embedded SRAM
  • Up to 2Gbyte external ECC protected DDR3 memory
  • 10 /100 Mbps Ethernet port with RMI interface
  • 2 x PCI Express Rev 2.0 ports offering up to 2.5 GT/s data transfer rates
  • 2 x USB 2.0 Host ports
  • 1 x USB 2.0 Device port
  • SDIO card interface
  • 2 x I2C Master interfaces up to 400 Kbit/s
  • 16 x GPIO
  • 2 x SPI Master controllers
  • 2 x 16550 compliant UART supporting baud rates from 300 to 2764800
  • Real Time Clock (RTC)

The controller is packed into a Flip-Chip Ball Grid Array (FCBGA) package with 393 solder balls that come with a 0.593 mm ball pitch. The package dimensions are 15mm x 15mm. With this kind of a package hand soldering is out of the picture.
Noteworthy is the implementation of the Arduino shield interface. The interface is pretty much designed with external components. For the GPIO/PWM digital shield pins a Cypress CY8C9540A 40-Bit I/O Expander with EEPROM  is used. The analog shield pins use an Analog Device AD7298 8-Channel, 1 MSPS, 12-Bit SAR Analog to Digital Converter (ADC) with Temperature Sensor . The Quark controller uses I2C serial interface to control the PGIO/PWM CY8C9540A device and the SPI for the ADC AD7298.

Olimexino-STM32

I have played around with the Arduino and had fun with it. However I am accustomed to more powerful micro-controllers than the AVR CPU. So it was only a matter of time until I started to look for an ARM based board that offered Arduino shields.  One board that caught my attention was the Olimexino-STM32 board.
OLIMEXINO-STM32-01
It is a nice board that offers the following key features:

  • STM32F103RB based ARM CPU
  • SD-Card slot
  • Mini USB port
  • CAN bus
  • Wide range of supply 9-30V
  • Battery supply plug

The board is a derivative of the Maple board from LeafLabs and also supports their Arduino like IDE.