Search This Blog

Friday, 3 June 2016

Initial thoughts on creating a Mars Curiosity inspired Rover

It's been a while since I did any "robot" work.  I've been rather absorbed in my 3D Printer firmware.

I thought it was time I took a little side break, and kicked up something I've been thinking about for a while. 

I want to create an autonomous rover based on the concept of the Mars Curiosity Rover.    

No, it won't have a  radioisotope thermoelectric generator (RTG), nor will it have fancy bio-chemical analysis thing-a-ma-bobbers... 

But it will be cool! 


Independent 6-wheel "rocker-bogie" suspension to allow it to crawl over fairly rough terrain unimpeded.

Neato XV-11 Wheel assembly

I happened to acquire a few Neato XV11 robot vacuums, 
and will be tearing them down for parts.  Each one has a pair of geared motors with optical encoders.  

A Teensy 3.2 will be used for each pair to ensure accurate positioning and velocity profiling. 
Teensy 3.2 for Motion Control

Neato XV-11 LIDAR sensor

The Neato XV-11 also has a very unique LIDAR system for mapping out room dimensions and identifying obstacles.

LIDAR mapping, A* Path planning, and Object Avoidance via multiple Sharp Infra-red proximity sensors will be done on a Raspberry Pi 3B
GPS, as well as a 9 degree of freedom fusion sensor on the chassis will also be managed by this Pi.

A* Path Planning

A Second Raspberry Pi 3B will be responsible for communications and streaming cameras. Running Nodebots, a javascript engine for Robot management, this Pi will have api's to allow connectivity via Android tablet, as well as a full web server.  

The 4 dof manipulator arm will be managed by another Teensy 3.2 and a separate  9 degree of freedom fusion sensor will sit on the wrist positional feedback.


I found on my previous rover, that another set of Infrared proximity sensors were needed on the bottom, front and back.  

Positioned on a 45 degree angle, these "cliff sensors" would alert you when the rover was in danger of falling over the edge of a cliff... ie, a set of stairs.

Similar to my previous rover, I will use a commercial 20,000ma Li-Ion power bank to power the electronics, and a separate Lead Acid 12v battery for the motors and servos.

I am also going to attempt foldable solar panels. Four panels, attached with hinges and servos, will fold away when not in use, but be able to extend off the back, fold out, and position for maximum light transfer when required. 

Any thoughts or suggestions are welcome as I embark on this awesome summer project.


Wednesday, 27 January 2016

I just received an Onion Omega!

Back in May of last year, I became aware of a KickStarter campaign for a new uController board called the  Onion Omega.
The Campaign met it's target goal of $15k USD, and then doubled it within a couple days!

Within a month, they had Successfully raised $267,851 USD with 4,459 backer.

What makes this little board incredible besides it's diminutive size, are it's enormous specs! 

  • Dimensions: 28mm x 42mm 
  • OS: OpenWRT Linux 
  • Processor: 400MHz 32bit Broadcom Atheros AR9331
  • RAM: 64MB DDR2 
  • Flash: 16MB 
  • Wireless: 802.11 b/g/n 
  • Ports: 18 GPIO 
  • Language: Python, Node.JS, PHP, Ruby, Lua and more...

These  specs put this cool little board smack dab between the 8bit loveable Arduino and it's big 32bit brother, the RaspberryPi.

The 18 GPIO are  all digital, however there are I2C, I2S, and SPI buses for expansion should you require analog support.

The biggest "feature" of this awesome little board is the Web Interface!   The Onion Console is intended to represent a virtual desktop in your browser to control applications running on the Onion Omega!

How cool is THAT???

Anyway, cutting to the chase... A couple weeks ago, on Twitter,  @OnionIoT held a giveaway contest, and I entered... I mean, who wouldn't?  I've been working with embedded controllers and System on Chip boards for a while now, and this one definitely intrigues me. 

The following day, I received THIS tweet:

And today finally, my board, plus a dock showed up!  

Now go away... I have some playing to do!   

Thank you 




Friday, 22 January 2016

Thermistor to Temperature conversion in ARM-mbed

This is a short article about how to quickly convert a Thermistor Value to Temperature on the Freescale (Now NXP) FRDM-K64F board.  Honestly, this code will work for any of the FRDM boards, as there is nothing specific to the K64F.

The FRDM-K64F developer board from NXP  (formerly Freescale) is a 32bit ARM® Cortex™-M4 core with DSP instructions and Floating Point Unit (FPU)running at 120 Mhz. It has 1M flash memory and 256k RAM.   It is compatible with most Arduino shields.

Add to this:
  •  FlexBus, 
  • 16 channel DMA, 
  • 2 16bit ADC, 
  • 2 16bit DAC, 
  • 3 analog comparators, 
  • CANbus, 
  • 3 SPI ports, 
  • 3 I2C ports, 
  • 6 UARTs, 
  • 1 Secure Digital Host Controller, 
  • Ethernet, 
  • Micro-SD card
  • Hardware CRC and random-number generator module, 
  • Hardware encryption supporting DES, 3DES, AES, MD5, SHA-1 and SHA-256 algorithms
  • 6-axis combo Sensor Accelerometer and Magnetometer

NXP/Freescale do have their own free IDE available, the Kinetis Design Studio that I've discussed here in the past. It is quite a rich and capable development platform, however with that richness comes complexity.  

For those less familiar with configuring hardware clocks and startup code for embedded processors, I suggest you look at the ARM-mbed platform.

ARM-mbed is a fairly good online IDE for working with various ARM based developer boards.

I was rummaging through my code today, and found this piece that I had struggled with last year when I was working on my 3D printer firmware.  I wanted to be able to read two thermistors, one for the extruder nozzle, and one for the heated bed.  These thermistors are used to regulate the temperature for accurate printing.

Several of the standard 3D printer firmware options (Marlin, Teacup, etc...)  that were developed for the 8bit Arduino platform used conversion tables to reduce the processing overhead. Because I was using a 32bit ARM processor at 120Mhz, I didn't feel that this was the right method to follow.  
Looking around, I quickly found out about the  Stenhart-Hart equation for converting Thermistor resistance values to Temperature values. 

It looked rather daunting at first, but then Adafruit came to the rescue with this awesome tutorial:

Anyway, with no further ado... here is my demo code for displaying Temperature values from a 16bit analog read of a 100k thermistor on the FRDM-K64F development board.

/*         FRDM-Thermistor-Demo
*  This is a Thermistor to Temerature conversion demo
*  for the @NXP (@freescale) FRDM-K64F demo board
*  Much thanks to @Adafruit for this tutorial:
*  The 100K Thermistor is configured with a 4.7k series resistor
*  tied to vcc (3.3v)  like this:
*   +3.3v
*     |
*      \
*      /  4.7k series resistor
*      \
*      /
*      |
*      .-----------O To Anlog pin on FRDM board
*      |
*      \
*      /
*  Thermistor  100k Nominal
*      \
*      /
*      |
*     ---
*   GND

#include "mbed.h"

#define THERMISTORNOMINAL 100000      // 100k
// temp. for nominal resistance (almost always 25 C)
// The beta coefficient of the thermistor (usually 3000-4000)
#define BCOEFFICIENT 3950
// the value of the 'other' resistor
#define SERIESRESISTOR 4700   
AnalogIn Thermistor(A3);

Serial pc(USBTX, USBRX);

// This is the workhorse routine that calculates the temperature
// using the Steinhart-Hart equation for thermistors
float get_temperature()
    float temperature, resistance;
    float steinhart;
    int a;
    a = Thermistor.read_u16();       // Read 16bit Analog value
    pc.printf("Raw Analog Value for Thermistor = %d\r\n",a);
    /* Calculate the resistance of the thermistor from analog votage read. */
    resistance = (float) SERIESRESISTOR / ((65536.0 / a) - 1);
    pc.printf("Resistance for Thermistor = %f\r\n",resistance);
    steinhart = resistance / THERMISTORNOMINAL  // (R/Ro)
    steinhart = log(steinhart);                 // ln(R/Ro)
    steinhart /= BCOEFFICIENT;                  // 1/B * ln(R/Ro)
    steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15);   // + (1/To)
    steinhart = 1.0 / steinhart;                // Invert
    temperature = steinhart - 273.15;           // convert to C

    return temperature;

int main()
    pc.printf("\r\nThermistor Test - Build " __DATE__ " " __TIME__ "\r\n");
    while(1) { 
       pc.printf("Temperature %f *C\r\n",get_temperature());



NXP.COM: FRDM-K64F Developer board
ARM-mbed: FRDM-K64F 
Adafruit: Using a thermistor to tell temperature