robotics planet

http://planet-robotics.net

all robotics in one place

All content on this page is provided by the aggregrated blogs listed on the right. Please follow the links to get there.

Robots Podcast #233: Geometric Methods in Computer Vision, with Kostas Daniilidis

 − at 09:00, 30. Apr. 2017



Transcript Below.

In this episode, Jack Rasiel speaks with Kostas Daniilidis, Professor of Computer and Information at the University of Pennsylvania, about new developments in computer vision and robotics. Daniilidis’ research team is pioneering new approaches to understanding the 3D structure of the world from simple and ubiquitous 2D images. They are also investigating how these techniques can be used to improve robots’ ability to understand and manipulate objects in their environment. Daniilidis puts this in the context of current trends in robot learning and perception, and speculates how it will help bring more robots from the lab to the “real world”.  How does bleeding edge research become a viable product? Daniilidis speaks to this from personal experience, as an advisor to startups spun out from the GRASP Lab and Penn’s Pennovation incubator. (more…)

[original entry]

Watch This Robot 3D Print a Building Out of Spray Foam

 − at 15:00, 29. Apr. 2017



This MIT robot can autonomously build a giant dome

[original entry]

Video Friday: Friendly Cobot, Drone Swarms, and Robotic Recycling

 − at 22:35, 28. Apr. 2017



Your weekly selection of awesome robot videos

[original entry]

RC Speed Controller (ESC) Arduino Library

 − at 16:45, 28. Apr. 2017

RC_ESC - Arduino Calib RC_ESC - Arduino RC_ESC - Arduino Ramp

 

More and more people are starting to use what’s called an “ESC” (Electronic Speed Controller) in robotic applications or DIY projects. These are low cost, readily available motor controllers that can drive brushed or brusless DC motors and most of the time are found in Radio Control (RC) applications. Given this market, they use standard RC PWM signals as input but with some “twists” to avoid any issues of safety. These differences sometimes make it difficult to use directly with the Arduino Servo library if you are unaware of some details, so this post describes a new ESC library to help you get started. An ESC has the following nuances:

  • Upon power up, the ESC will wait for a low PWM signal to arm itself. Without being armed, it won’t respond to signals.
  • The ESC’s minimum and maximum PWM values can usually be calibrated (and often needs to be for specific applications)

 

RC_ESC - Main

We’ve created a simple library which can help you understand and use an ESC with an Arduino based platform. This library is largely based on the Arduino Servo library and even use it in the background but we created different commands as well as examples which make sense for ESCs. The library is open source and although each function is not described in detail here, the library itself and the examples are well commented.

1.0 – Library Object

You can now declare an object for your ESC with all the details needed to control it. This makes the process easier even more if you have many ESC’s to control. For example:

Assigns the pin connected to the ESC, the MIN PWM value, MAX PWM VALUE and arming value.

2.0 – Library Functions

The following functions are implemented in the library.

2.1 – calib

Initiation of the calibration process. this require you to connect the ESC power at the right moment when the LED is ON and a few seconds (5s) after.

F-RC_ESC - Calib
2.2 – arm

A simple command that sends the “arming” PWM value to initiate the ESC.

RC_ESC - F-Arm
2.3 – stop

Will send a 500us value to stop the ESC. This value can be changed in the library if needed.

RC_ESC - F-Stop
2.4 – speed

The most useful function which updates the corresponding ESC speed.

RC_ESC - F-Speed

3.0 – Installation:

There is a good tutorial on how to install an Arduino library:

Arduino – Importing a .zip Library

The RC_ESC library is available on GitHub and you can use the following link to download the .zip.

GitHub – RC_ESC Library ZIP

4.0 – Library Examples

A few examples are provided which use the standard commands, and include:

4.1 – ESC_Calib:

This example was created to perform the ESC calibration and this is usually done only once, so will probably never be used in a full project. The example will provide the standard steps to calibrate an ESC which is to send a High value at power up and after a delay goes down to the Low value. Those values will then be saved in the ESC and used for the range of speed.

4.2 – ESC_Stop

Example of a full initialisation and start of the motor at a given speed then implements the stop function.

4.3 – ESC_Knob

Largely based on the “Knob” example in the Servo Library, but using the RC_ESC’s Library to control the ESC.

4.5 – ESC_Ramp

Largely based on the Servo Library ‘s”Sweep” example which will in that case ramp up and down the speed on the given range.

 

Reference Links:

Arduino Servo Library

Material Shown:

Lynxmotion BotBoarduino Shield-Compatible Robot Controller
Octopus Rotary Potentiometer Brick
Lynxmotion 12A Multirotor ESC 1A BEC (With Connectors)
Brushless Rotor Motor 1000Kv 15A
11.1V, 2500mAh, 30C LiPo Battery

          

Related Stories

 

[original entry]

Robotic Construction Platform Creates Large Buildings on Demand

 − at 22:20, 26. Apr. 2017



This robotic foam sprayer can make you most of an igloo in 13.5 hours flat

[original entry]

Waymo vs. Uber: 8 Things I Learned From Anthony Levandowski Taking the 5th

 − at 15:45, 26. Apr. 2017



The questions he was asked spoke volumes about Uber’s suppliers, the secret Spider lidar, Google’s early suspicions, and more

[original entry]

Cellulo Introduces Classrooms to Tangible Learning With Robots

 − at 22:30, 25. Apr. 2017



Kid-proof robots are small, cheap, and help turn abstract concepts into interactive lessons

[original entry]

Lynxmotion Quadrino Nano – Raw Sensor Values

 − at 18:09, 25. Apr. 2017

The Lynxmotion Quadrino Nano Flight Controller (with GPS) was originally designed as a flight controller for drones but, it also has awesome applications for robotic rovers too. Composed of an ATmega2560 (Arduino Mega Chipset), a collection of sensors, GPS and a host of I/O options it is an ideal “sensor ball” for navigation, positioning and more.

QN_quad_nano

Lynxmotion Quadrino Nano

In this tutorial we’ll be working with a small Arduino program that will give us data from:

  • the MPU-9150 (gyroscope, accelerometer, magnetometer)
  • the MS5611 (barometer)
  • the Venus838FLP (GPS module)

based on the serial command we send to the Arduino. This will give us a starting point for understanding and utilizing the Quadrino Nano’s sensors. In future tutorials we will reference this one as we put this unit to work!

Requirements

Helpful Experience

This tutorial is targeted at beginners, but some experience with the the Arduino IDE and C++ files (.cpp and .h) is helpful but, not required.

Download and open the files

First, download the files. Second, navigate to the Arduino IDE and go to “Sketch/Include Library/Add .ZIP Library and select ZIP file you just downloaded.

(if you need any help with this step see https://www.arduino.cc/en/guide/libraries#toc4).

QN_include_library

Arduino IDE – Library Install

 

Then navigate to your Arduino Examples folder. Towards the bottom of the list you will see an item called “QuadrinoNano_SensorDataLibrary”, navigate there and click the “QuadrinoNano_SensorData” item.

 

QN_open_example

Arduino IDE – Quadrino Example

Upload files to the Quadrino Nano

Next we’re going to upload the files to the Quadrino Nano and work with the code before we dive into the specifics.

QN_usb_connection

Lynxmotion Quadrino Nano – USB Connection

First we need to plug the Quadrino Nano into our computer. Once we have the unit plugged into the computer we need to do two things before we can upload the code.

QN_select_board

Arduino IDE – Board

First select the correct Arduino “Board” for the Quadrino Nano from the “Tools” menu. As we discussed above, the Quadrino Nano is an ATmega2560 at heart so we need to select either be the “Arduino/Genuino Mega or 26560” or the “Arduino Mega ADK” depending on your configuration (I had more success uploading with “Arduino Mega ADK”).

QN_select_port

Arduino IDE – Port

Second select the appropriate port for your Arduino. If you’re on Windows this may be “COM” followed by a number, on Mac it may be “tty” or something even wilder (like the picture shows below).

QN_upload_to_quadrino

Arduino IDE – Upload

Once we have the port and board selected we’re ready to upload the sketch. To upload the sketch, you can press the arrow as shown in the image below or go to “Sketch/Upload” in the menu bar.

QN_upload_success

Arduino IDE – Uploaded

After uploading you should see a message like the one below without any orange error messages.

If you do have errors, there’s a few things to check:

  1. Make sure the Quadrino Nano is plugged in (this happens to me all the time)
  2. Make sure the proper “Board” is selected from the tools menu
  3. Make sure the proper “Port” is selected from the tools menu
  4. Copy the error message and paste it in Google, often there will be a blog article or a Stack Overflow question about the issue
  5. Check the official Arduino site especially the troubleshooting section

Run some commands

QN_serial_monitor_open

Arduino IDE – Serial Monitor

Now that we have everything uploaded, its time to run some commands. In order to do that we need to open the serial port by pressing the little magnifying glass icon as illustrated in the image below.

QN_serial_monitor_settings

Arduino IDE – Serial Settings

Often when we open the Serial Monitor we just see garbage (as you can see in the image below), this usually means we need to set the baud rate to match our project. The baud rate needs to be set to “57600” and line endings should be set to “Both CL & NL”. Use the diagram below to find and set these settings.

QN_serial_monitor_interaction

Arduino IDE – Serial Commands

Now that all our settings are correct you should see the printout like the image below (if you see some garbage at the very top of the Serial Monitor, don’t worry, that happens when the serial port still has data in it that hasn’t been cleared out).

When you type in a number and press return, the Quadrino Nano starts reading that sensor and will keep reporting its value at a predefined interval until you press enter to stop reading from the sensors (barometer and temperature only read once and stop).

After you’ve had a chance to experiment, we’ll look into some of the details of how we get data from these different sensors.

Diving into the sensor commands

Probably the best way to get an understanding of how we read and interact with the Quadrino Nano’s sensors is to take a look at the code itself. The function names are fairly self explanatory and the included notes by the original developers and myself attempt to make these files as readable as possible. That said, we will take a little time to look at the basics of each sensor below.

MPU-9150 commands and function files

The MPU-9150 is an Accelerometer, Gyroscope and Compass in a single chip. From the manufacturers (InvenSense) website:

The MPU-9150 is a System in Package (SiP) that combines two chips: the MPU-6050, which contains a 3-axis gyroscope, 3-axis accelerometer, and an onboard Digital Motion Processor™ (DMP™) capable of processing complex MotionFusion algorithms; and the AK8975, a 3-axis digital compass. The part’s integrated 6-axis MotionFusion algorithms access all internal sensors to gather a full set of sensor data.

We communicate with it via I2C using the Arduino Wire Library. We read data from the accelerometer, gyroscope and compass in the same way by using a predefined function and predefined register addresses (often doing a two byte read, once for the low byte and again for the high byte).

/* Example - Read the value of the compass X-axis and save the value to a floating point variable called "compass_x_axis_value"
 MPU9150_readSensor(low_byte,high_byte)
 MPU9150_CMPS_XOUT_L = Compass X-axis low byte
 MPU9150_CMPS_XOUT_H = Compass X-axis high byte */
 float compass_x_axis_value = MPU9150_readSensor(MPU9150_CMPS_XOUT_L,MPU9150_CMPS_XOUT_H);

All of these register addresses are defined in “MPU9150.h” (included with the sketch). Below is a list of useful functions for reading the basics of the MPU-9150 when used in conjunction with “MPU9150.h”.

// Clear the 'sleep' bit to start the sensor.
MPU9150_writeSensor(MPU9150_PWR_MGMT_1, 0);
// Start the compass
MPU9150_setupCompass();
// Read the Accelerometer
MPU9150_readSensor(MPU9150_ACCEL_XOUT_L,MPU9150_ACCEL_XOUT_H); // X-Axis
MPU9150_readSensor(MPU9150_ACCEL_YOUT_L,MPU9150_ACCEL_YOUT_H); // Y-Axis
MPU9150_readSensor(MPU9150_ACCEL_ZOUT_L,MPU9150_ACCEL_ZOUT_H); // Z-Axis
// Read the Gyroscope
MPU9150_readSensor(MPU9150_GYRO_XOUT_L,MPU9150_GYRO_XOUT_H); // X-Axis
MPU9150_readSensor(MPU9150_GYRO_YOUT_L,MPU9150_GYRO_YOUT_H); // Y-Axis
MPU9150_readSensor(MPU9150_GYRO_ZOUT_L,MPU9150_GYRO_ZOUT_H); // Z-Axis
// Read the Compass
MPU9150_readSensor(MPU9150_CMPS_XOUT_L,MPU9150_CMPS_XOUT_H); // X-Axis
MPU9150_readSensor(MPU9150_CMPS_YOUT_L,MPU9150_CMPS_YOUT_H); // Y-Axis
MPU9150_readSensor(MPU9150_CMPS_ZOUT_L,MPU9150_CMPS_ZOUT_H); // Z-Axis

With these commands and the “MPU9150.h” you can easily get accelerometer, gyroscope and compass data from the MPU09150.

NOTE:The source of the “MPU9150.h” file is http://playground.arduino.cc/Main/MPU-9150. Additional details about the file are available there.

MS5611 commands and function files

The MS5611 chip gives us altitude, barometric pressure and temperature. Like the MPU-9150, we communicate with it via I2C. There are a few basic commands defined in MS5611.h and MS5611.cpp that we use to get the readings from the chip (everything else in these files deals with I2C communications). The function names do a good job of explaining what each of these functions does.

uint32_t readRawTemperature(void);
uint32_t readRawPressure(void);
double readTemperature(bool compensation = false);
int32_t readPressure(bool compensation = false);
double getAltitude(double pressure, double seaLevelPressure = 101325);

The MS5611 chip is very easy to use:

  1. Simply including the MS5611.h and MS5611.cpp files in your Arduino sketch
  2. Include Wire.h
  3. Start Wire in “void setup()"
  4. Execute one of the functions listed above, and that’s it

That’s it!

NOTE:The source of the MS5611 library is https://github.com/jarzebski/Arduino-MS5611. Additional details about the library are available there.

Venus838FLP commands and function files

The Venus 838FLP GPS module was the most difficult to find a simple working library for. After some research, I decided to start with the MultiWii drone software and delete as much of the unnecessary functionality as I could to give us the leanest GPS library possible. There may be ways to further optimize the code, but I’ve tried to leave it robust and useful for as wide an array of applications as possible.

The Venus communicates via Serial unlike our other two sensors which use I2C. In our sketch, we’re doing three things to get data from the GPS module:

  1. Include the Venus838FLP.h file in our sketch
  2. Start the module by executing “GPSModuleInit()" and “GPSConfigureDefaults()" in our “void setup()"
  3. Run “VenusReadAndPrint(2000)" whenever we want a reading.

"VenusReadAndPrint(2000)" reads the data from the GPS module with a timeout of 2000ms. This is a function I created to display the data and is defined at the bottom of the Venus838FLP.h file. “VenusReadAndPrint()" calls a function “VenusDispatchMessage(int result)"  (defined right above “VenusReadAndPrint()") that looks like this:

void VenusDispatchMessage(int result){
 //f.GPS_FIX = venus_ctx.location.fixmode >=2;
 Serial.print("Latitude: ");
 Serial.print(float(venus_ctx.location.latitude/10000000.000000),6); // With 1.9 now we have real 10e7 precision
 Serial.print("\t Longitude: ");
 Serial.print(float(venus_ctx.location.longitude/10000000.000000),6);
 Serial.print("\t Altitude: ");
 Serial.print(float(venus_ctx.location.sealevel_alt /100));
 Serial.print("m \t Satelite Count: ");
 Serial.println(venus_ctx.location.sv_count);
 //GPS_coord[LON] = venus_ctx.location.longitude;
 //GPS_altitude = venus_ctx.location.sealevel_alt /100; // altitude in meter
 //GPS_numSat = venus_ctx.location.sv_count;
 // note: the following vars are currently not used in nav code -- avoid retrieving it to save time
 // also, Venus8 doesnt provide these in a way that we can easily calculate without taking cpu cycles
 //GPS_speed = venus_ctx.location.ground_speed; // in m/s * 100 == in cm/s
 //GPS_ground_course = venus_ctx.location.ground_course/100; //in degrees
}

This function contains all the variables and values you would need to create almost any application that uses GPS. Feel free to modify “VenusReadAndPrint" and “VenusDispatchMessage" to create your own functions that store the GPS data to global variables or return values for setting local variables and more.

NOTE: The MultiWii source is availble here: https://github.com/multiwii/multiwii-firmware.

Conclusion

As we can see, the Lynxmotion Quadrino Nano Flight Controller (with GPS) is an ideal “sensor ball” for all kinds of sensor intensive projects. The sample code has a fairly small footprint (6% of memory and 47% of dynamic memory) and could easily be optimized further by removing variables and trimming the libraries/sensor functions to include only the exact code your specific application needs (we included the seemingly redundant functions in order to facilitate the greatest range of applications that readers of this tutorial may wish to create).

Happy making!

Continued reading

          

Related Stories

 

[original entry]

Controlling Robot Swarms With Augmented Reality

 − at 16:30, 22. Apr. 2017



Engineers at NYU have built an AR app to operate robots in the real world

[original entry]

Video Friday: RoboCup, Drone Magic, and NotBot Is Pedro

 − at 20:30, 21. Apr. 2017



Your weekly selection of awesome robot videos

[original entry]