RASPBERRY Pi - LEARNING HOW TO MAKE YOUR ROBOT WORK

A great way to make your mechanical insect come to life is to use a Raspberry Pi

 

 

ANTICS - ARDUINO - ARMOUR - ARTWORK - BIOLOGY - BLACK BOX - COMPUTERS - ELECTRONICS - ENERGY - FRAME - HEAD - JAWS - JIMMY WATSON - KITS - LEGSMECHANICS - MOTORS - MOVIE  - PHOTOGRAPHY - RASPBERRY Pi - R/C DRONE - SENTRY - SOFTWARE - SOUND PROOFING - SPEED - SUSPENSION - TAIL - WEAPONS - WARGAMING

 

 

Ryan Dusart getting to know Dino the Dionbot giant robot ant

 

NECK JOINT - Let loose in the robot store, a young engineer checks out the range of movement of Dino's head mountings. Plug and Play computers do not need students to know much about structural design, welding or other engineering problems, they can just concentrate on learning how to make machines obey digital commands. The engineering grunt comes after the intellectual workout.

 

 

You might think it strange that the makers of so-called educational computers are so busy trying to maintain their market share that they failed to see the logic of working to the same basic voltage in selecting their architecture, so as to be more compatible with one another. If they were compatible they would be more efficient and the world would be slightly more sustainable in the reduction of energy and time used by humans to create robots for a better world. KISS

 

 

ABOUT RASPBERRY Pi and ARDUINO COMPUTERS

 

The Arduino is a wonderful platform for handling the lower level work of a robot - reading sensors, driving servos, and blinking lights. There is a fair amount of RAM on board, and it is programmable in C++, so you can write decent amounts of code, and basic autonomous robot behavior is well within its capabilities.

 

While it is extensible, meaning that you can add to and expand upon the basic board with future potential built in - you can buy Arduino shields to do a wide variety of things - it doesn't have an Operating System (OS) per se. Arduino has a great deal of support for accessing the board and driving servos, etc., but it is limited and doesn't provide what an OS provides, e.g., multiple processes or threads of execution, signals, IPC and so on. 

 

IPC - In computer science, 'Inter Process Communication' (IPC) refers specifically to the mechanisms an operating system provides to allow processes it manages to share data. Typically, applications can use IPC, categorized as clients and servers, where the client requests data and the server responds to client requests. Many applications are both clients and servers, as commonly seen in distributed computing. Methods for achieving IPC are divided into categories which vary based on software requirements, such as performance and modularity requirements, and system circumstances, such as network bandwidth and latency. 

 

Signal, or Asynchronous System Trap (AST) is a system message sent from one process to another, not usually used to transfer data but instead used to remotely command the partnered process, hence IPC. This is more common in robotics where we are using machines to do things based on what the machine knows about its surroundings.

 

 

 

MOTORS - We need two separate motors to power our ant robot, one motor for each side of the giant insect. This will allow us to steer the DinoBot. Slowing down one set of legs will cause Dino to turn in the direction of the legs working the slowest. The motor and gearbox that Ryan is inspecting is a 500 watt unit more commonly used to propel electric cycles. It's a teensy bit more powerful that the Lego or other VEX, STEM plug and play systems and way too expensive to learn with, but once beginners have mastered the basics using low powered robots, they may want to stretch their imaginations with projects that can do useful things in the real world. This hexapod platform could be the basis of a rescue robot, to carry humans from dangerous crash sites, or compromised nuclear plants where uneven surfaces might defeat a tracked vehicle.

 

 

ARDUINO + POINTS - When you think of Arduino, think of a great platform for hooking up sensors and servos, and the like, and getting access to a wonderful library of functions that make reading sensors and driving servos very easy.

 

RASPBERRY Pi + POINTS - The Pi provides Input and Output ( I/O) lines but no supporting library per se like you get with Arduino. You can do much of what you want in terms of reading sensors and driving servos from the Raspberry Pi, but it is probably better done on the Arduino.

 

What Raspberry Pi can provide that is out of reach of Arduino is an operating system of the stature of Linux (Fedora and others), and with that all the support that Linux provides for non-trivial devices like USB Ethernet, USB cameras, etc. It also gains you access to the wide array of powerful libraries written for Linux like OpenCV for image processing and hundreds (thousands) of others - pretty much anything that you would find on a desktop system is going to be available or portable in theory to Linux running on Raspberry Pi. It also provides orders of magnitude more processing power and memory, which will help in doing that tasks that a more sophisticate robotics application will need to perform.

Accordingly, use the Raspberry Pi as a host for all of the logic that is difficult to cram onto an Arduino (or to find as a solution - Linux is going to dominate in terms of software choices compared to Arduino by a large margin). It's also the place to do the number crunching, image analysis, database storage. Does that make sense to you.

 

 

Micro computer visual interface communications

 

 

The basic architecture of a Raspberry Pi/Arduino robot would be something like this: 

 

1. Logic for interacting with robot hardware on the Arduino, and the brains of the robot on Raspberry Pi.

 

2. Add an Ethernet shield and send messages between the two (sensor status from Arduino to Raspberry Pi, and control commands (e.g., servo commands) from Raspberry Pi to Arduino).

 

3. Or wire together the serial lines and send commands and data over serial (preferred, since it uses less power and probably less code to implement).

As a good example, if your robot uses machine vision to navigate its world, you'd put the image processing and navigation decision logic on the Raspberry Pi, as well as the web cam and its drivers. On the Arduino you might drive the servo that is used to rotate the camera into position. On the Raspberry Pi you might also run a web server that allows for monitoring the state of the system and for receiving commands for controlling the robot manually over a network.

 

 

A large energy store for a giant insectoid robot  Controlling all that power needs some hefty electronics  

 

ROBOT INSECT PARTS  - Ryan checks out the 2kW hour 48 volt lithium battery pack and the electronic speed controllers for the two 500 watt 2/3rd horsepower motors. That means that combined, this robot hexapod will have the power of 1.34 horses. Of course that all depends on the efficiency of the motors and drive train. In reality it will be more like a half a horse. A horse is a much bigger animal that our DinoBot.

 

 

Circuit diagram for a voltage shifting computer interface or coupling

 

COMPATIBILITY - A 3.3V I2C component can be connected directly to the Arduino, by using the 3.3V of the Arduino board, and using two 4k7 pull-up resistors to the 3.3V, but you have to know the risks. The Arduino boards use AVR microprocessors, most of which run at run at 5 Volts, and most of those Arduino Boards have a voltage regulator for 3.3 V which can be used for those components that need it. 

 

 

OTHER INCOMPATIBILITY ISSUES

 

Raspberry Pi is great tool for embedded engineers but it lacks ADC. One more draw back is all of its IO’s are 3.3V level. On the other side Arduino is good at sensing the physical world using sensors. To get benefits of both the systems one may want to interface them.

You can divide this interfacing problem into two steps. There are many interface options available in both boards like UART, IIC and SPI.

Universal Synchronous/Asynchronous Receiver Transmitter (UART) Serial Peripheral Interface (SPI). UART and SPI are serial communications interfaces between two devices (such as a Wi-Fi module and a host microcontroller). The two interfaces differ in the protocol and speeds at which a bi-directional serial communications link is created between two devices.

In terms of speed, simple UARTs typically operate at 0.3 Kbps to 1 Mbps whereas an SPI can operate at up to 50 Mbps or more. As such, UARTs are an excellent choice for sensor type applications and SPI is better suited to high-bandwidth applications such as audio or video.

A UART is an asynchronous interface since the transmitter and receiver use independent clock sources. 

 

SPI is an synchronous interface that uses a dedicated clock signal. The device considered the 'Master' provides a clock signal used to synchronize data transactions between the two devices.

The choice of protocol depends on the requirement of the application and roles of the Arduino and Raspberry Pi.

 

The main problem arises when we try to make physical connection between the two boards because they are working on different voltage levels. We need to use level shifters to avoid any damage to the Raspberry Pi and to get expected results.

 

There is a nice blog on arduino forms. You can build level shifters by looking at this blog. Once we have a physical connection between the two micro computers, they can start talking to each other. On Pi side you can use any of your favorite programming languages.

 

 

 

 

 

Learning how to program a computer to control a moving object, react to sound or other moving objects, tell the time or measure temperature is not as difficult as it first seems using the latest educational aids from several different manufacturers, even if there are compatibility issues. And why are there so many different programming languages? Once again, we are building in difficulties for ourselves and wasting human lives writing code again and again to achieve the same outcome. For a bunch of clever people, computer engineers are quite stupid. Keep It Simple Stupid.

 

 

RASPBERRY Pi STARTER KITS

https://www.amazon.com/dp/B01C6Q4GLE

CanaKit Pi 3 Ultimate 32GB Edition

https://www.amazon.com/dp/B00P2E9W30

 

 

 

NATURAL VARIATION - Despite their reputation as pests, the trillions of insects, bugs, and spiders that inhabit Planet Earth can make some of the most fascinating and dramatic close-up photography subjects and some of the best robots in the world.

 

 

 

 

THE GUARDIAN 12 DECEMBER 2016

We were thrilled with your creative contributions last time we asked – a year on, we want to see what you’ve been making in 2016.

More than 10m Raspberry Pi units have sold since 2012 – and many of them, we know, have landed in the hands of our ever-inventive readers.

When the Raspberry Pi Zero launched in 2015 we asked you to share the projects you’d been working on, but the past year has seen further development of the technology and exploration of its capacity – so, we’re asking again.

After we published the results – including audiovisual and entertainment projects, educational tools and even festive ideas – many of you wanted to highlight similar or alternative home project-enabling technology:

So we’re happy to say we’re also looking for anything you’ve been making with open source electronics platform Arduino – or anything else you’d like to tell us about.

Whether you have pieced a Pi or Arduino-based system together from scratch as a fun joint project with the kids, or breathed life into some older tech you had lying around, contribute your stories and photographs and we’ll gather together some of your success stories – or even tales of woe.

 

 

   

 

MAKEBLOCK - This is a more advanced version of the Lego Mindstorms Brick concept, mixed in with a bit of Meccano thinking and it looks good. These robot kits use Arduino and Raspberry Pi computers to navigate their world and perform simple tasks.

 

 

THE GUARDIAN 26 NOVEMBER 2015

 

The British-made computer is as comfortable in the classroom as on the kitchen table – we want to hear about your successful (and not so!) projects.

The Raspberry Pi has become one of the easiest and most popular tools to learn programming or hack together a tech solution with add ons – it can even take on the tasks of a conventional home computer, and its latest model is so cheap it comes free with a magazine.

Its British makers have shipped millions of the credit card-sized machines since launching in February 2012, and we want to know how you’ve been using them.

Whether you have pieced a Pi-based system together from scratch as a fun joint project with the kids, or breathed life into some older tech you had lying around, contribute and we’ll gather together some of your success stories – or even tales of woe.

You can share your pictures and stories by clicking ‘HERE’. You can also use the Guardian app and search for ‘GuardianWitness assignments’ – add it to the homepage to keep up with all their assignments.

 

 

Checking out the Arduino computer boards  Learning how to solder using crocodile clips

 

RASPBERRY Pi - Your computer board and other electronic components should come in protective plastic packets to prevent static electricity damage. A stand with clamps and magnifying glass will help you when it comes to fiddly soldering. Make life easier by using these low cost items in your laboratory, classroom or on your kitchen table. Sorry Mum!

 

 

LINKS & REFERENCE

 

The Guardian technology 2015 December readers raspberry pi projects

Witness The Guardian assignments

The Guardian technology 2016 December share your best raspberry pi or arduino projects

Create Arduino project hub Sankar Cheppal interfacing Arduino with Raspberry Pi

Open Source

Quora what are possible interesting projects with a Raspberry Pi and Arduino Uno device

https://www.theguardian.com/technology/2015/dec/08/readers-raspberry-pi-projects

https://witness.theguardian.com/assignment/584e7c8ae4b08659393bb7ad

https://www.theguardian.com/technology/2016/dec/12/share-your-best-raspberry-pi-or-arduino-projects

https://create.arduino.cc/projecthub/sankarCheppali/interfacing-arduino-with-raspberry-pi-6d9870

https://opensource.com/

https://www.quora.com/What-are-possible-interesting-projects-with-a-Raspberry-Pi-and-Arduino-Uno-device

 

 

 

 

ANTICS - ARDUINO - ARMOUR - ARTWORK - BIOLOGY - BLACK BOX - COMPUTERS - ELECTRONICS - ENERGY - FRAME - HEAD - JAWS - JIMMY WATSON - KITS - LEGSMECHANICS - MOTORS - MOVIE  - PHOTOGRAPHY - R/C DRONE - SENTRY - SOFTWARE - SOUND PROOFING - SPEED - SUSPENSION - TAIL - WEAPONS - WARGAMING

 

DINOSAURS - DOLPHINS - HUMANOIDS - RAYS - SHARKS - WHALES

 

ARDUINO - ARM HOLDINGS  - BEAGLEBOARD - MBED - PCBS - PICAXE - RASPBERRY PI 

 

 

 

 

This webpage is Copyright © 2017 Jameson Hunter Limited.  The name DinoBot™ in relation to educational robotic kits is a trademark, though these articles on insects and hard and software is not-for-profit and may be freely quoted with or without a back-link but that a credit would be appreciated. All other trademarks are hereby acknowledged. The design of the Robot Ant on this series of pages is design copyright © December 23 2016, all rights reserved - Jameson Hunter Ltd.