Week 5

Robots are taking important roles in our lives. We saw in a previous class the Kiva Robots . There are many social implications and these are not the only ones used in warehousing. But also it is part of our course to understand how these machines operate and are using the sensors to guide themselves through the shelves.

We discussed about the impact of introduction of robotics, but somehow we left outside all the new opportunities that this brings to the game. Some robots are specifically designed to interact with other workers. For example, Baxter has many degrees of freedom and also has a human form factor to move precisely and while helping on tedious tasks. But of course there are many other improvements in hazardous environments like the car industry.

What would happen if the car is in the function of self driving and a door is opened? There should be a way to establish these different behaviors…

A complex behavior as a set of sub-behaviors

Subsumption and A.I. in Robots

Behavioral Trees

Subsumption and behaviors

Subsumption and behaviors

Industrial robots and comments from 1983

Updated definition from the dictionary: link

Categories: cartesian, cylindrical, polar and articulated.

Production line for silicone injection with workers: link

This is how a Tesla is manufactured today: link

Robot Operative System

The ROS is a general purpose system that helps the most advanced robots work:

 

Neurons in software

neuron

With no middle layers, OR, AND, NAND, NOR are easy to implement.

nn3layer

With a middle layer, a XOR can be represented.

nnxor

Example: Arduino as a neuronal network

http://www.mind.ilstu.edu/curriculum/artificial_neural_net/xor_problem_and_solution.php?modGUI=239&compGUI=1286&itemGUI=2253

Finite State Machine

A finitestate machine (FSM) or finitestate automaton (plural: automata), or simply a state machine, is a mathematical model of computation used to design both computer programs and sequential logic circuits. It is conceived as an abstract machine that can be in one of a finite number of states.

Here there is an interesting example of how a state machine can be used in automation (robot joke?)

Read further: Why developers should use state machines ?

Using the concept of function and state machine, we created in class our very humble autonomous LDR/LED system. Code is hosted in Github: here

 

 

Simple Finite State Machine

 

Just another example:

day-night

 

We rewrote the Example 5 into an Example 6, using SWITCH CASE syntax. But States could be many, depending the complexity of our application.

From other robot fans we can learn more about their state machines and the functions they use them for.

 

Using the basic work frame given in Example 7, we can build a state machine with several inputs and different actions. For this we define 4 different scenarios:

  • environmental light
  • strong light on the left sensor
  • strong light on the right sensor
  • strong light on both sensors

Instead of using real motors, we are using LEDs to simulate the states.

See it working with two LDR’s (simulator)

We connect the real motors with the functions, such as an example.

light-follower

Code example is hosted here: Example

Review: Bits and Bytes

Bit & Bytes

What can we do with FSM? 

FSM robot

FSM robot

 

FSM wall bouncer (Roomba for it's friends)

FSM wall bouncer (Roomba for it’s friends)

Week 4

Fiction & robotics laws

1. A robot may not injure a human being, or, through inaction allow a human being to come to harm.
2. A robot must obey the orders given it by human beings except where such orders would conflict with the First Law
3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.

Different schools of design: B.E.A.M.

Mark Tilden is a recognized roboticist that has challenged the status quo. He is one of the pioneers together with other bright scientists asking themselves the concepts behind a robot. Only scratching the surface, we can take a look at the laws he propose:

1. Protect thyself.
2. Feed thyself.
3. Move thyself to better real estate.

There is so much more to learn from Tilden and why is it so challenging this design philosophy. Here there are some videos online

 

Projects in the spotlight

Special thanks to our senior fellow Marcela Godoy for most of these suggestions:

Design Process

Aesthetics

 

MIT & Design Steps for robots ( extract from Mobile Robots: from inspiration to implementation)

Avoid “Usually”

What is the robot supposed to do?

What is the simplest way to accomplish the task?

What mechanical platform is needed?

What information does the robot need?

What sensors give this information most effectively?

How can the problem be decomposed into behaviors?

Wish you good fortune.

 

Mechanics Crash Course

The material you choose is going to be your friend

Sketch first, try even before

Where is your center of gravity ?

 

Open Structures

Open Structures

http://openstructures.net/

Live demo: 

Materials: aluminum, plastic, cardboard, paper, tape, hot glue

Center of gravity

Screws – washers – nuts

Resources for digital prototyping:

Thingiverse

Instructables

123D Make

123D Design

Slide Deck about robot desing used in class: LINK

Follow up from last class:

Code for light follower: LINK

Code for light follower with low pass filter: LINK

Code for PID braking: LINK (not tested)

Week 3

There is a noteworthy educational project that proposes to bring robots to teach. This works inside of the many frontiers humanity is working actively to solve. One of the incentives are the X Prizes.

 

 

Details of the sensors and capabilities of a robot used as a teacher.

Aldebaran-Nao-Joints

Image from https://www.ald.softbankrobotics.com

features-of-nao1

Image from https://www.ald.softbankrobotics.com

 

Pseudocode and Flowcharts

cup-of-tea1

Extensive explanation about how to draw flowcharts: Link

About feedback loops:

Image from Wikipedia

The way that all these robots send their control signals to their motors. But in order to move accurately they need a feedback loop. This proves to be one of the biggest challenges to face.

Overview of functions 

http://playground.arduino.cc/Code/Function

https://www.arduino.cc/en/Reference/FunctionDeclaration

Image from Wikipedia

Servomotors

One way to achieve that control, is not only moving but actually adjusting their position. So we call them servo-motors. They have a big contrast with the DC motors also by the way they are operated.

There are plenty of operational details about how servomotors are used with Arduino. Make sure you understand the difference between an inactive servo and a detached one.

 

 

Proportional Derivative Integral Control Loops ( P.I.D. )

From Wikipedia:

A proportional–integral–derivative controller (PID controller) is acontrol loop feedback mechanism (controller) commonly used in industrial control systems. A PID controller continuously calculates an error value as the difference between a measured process variable and a desiredsetpoint. The controller attempts to minimize the error over time by adjustment of a control variable, such as the position of a control valve, adamper, or the power supplied to a heating element, to a new value determined by a weighted sum

PID

PID – Image from Wikipedia

PID_varyingP

PID over and undershooting – Image from Wikipedia

 

Filters & implementations

Discard wrong values

Low Pass

High Pass

Filter_LP

PID trainer based on the Arduino library: link

Arduino library

Code example of a simple filter with Arduino: link

Here you can read a practical example about why filters are really needed: link

Code example with PID link

Code Examples hosted at Github

Week 2

Thoughts about robot origins

GolemTalos & Galatea

 

H-Bridges are thoroughly explained at Chapter 7 of Make an Arduino Controlled Robot in our bibliography 

 

How do we control speed if our outputs are digital?

Arduino pins that are not configured to have an output timer will not be able to work on PWM. Watch out for that.

Pulse Width Modulation might also become interesting by itself. There is plenty of information about how this actually works.

 

Using our knowledge of PWM now we can adjust the speed of the motors and directions accordingly.

 

 

Software

All our code is posted at our Github repository: https://github.com/todocono/NYU-robotics-2016-A/tree/master/ex2

Sensors in Robots

-Which physical parameters a robot needs to measure?

-Are those internal or external?

-Do the sensors provide the information or do they need further processing?

 

Robots are taking important roles in our lives. One of the most well knowns are the Kiva Robots . There are many social implications and these are not the only ones used in warehousing. But also it is part of our course to understand how these machines operate and are using the sensors to guide themselves through the shelves.

Among the different sensors a robot can use to measure the environment, there is a particular application of those sensors to detect positions. We call those encoders. There are different classifications and specific applications.

 

Further readings:

https://itp.nyu.edu/physcomp/lessons/sensors-the-basics/

https://en.wikipedia.org/wiki/Robotic_sensors

http://cmp.felk.cvut.cz/~hlavac/TeachPresEn/55IntelligentRobotics/070SensorsforRobots.pdf

https://learn.sparkfun.com/tutorials/analog-vs-digital

 

Microcontroller using digital inputs

Use the tutorial from Arduino to create a simple digital input https://www.arduino.cc/en/Reference/DigitalRead

Further reading: https://www.arduino.cc/en/Tutorial/DigitalPins

Microcontroller using analog inputs

https://www.arduino.cc/en/Reference/AnalogRead

Further reading: https://www.arduino.cc/en/Tutorial/AnalogInputPins

 

Light sensor

Examples

Active Infrared sensor

Examples

Active ultrasonic sensor 

Examples

You can find information about the sensor about the HC-SR04 sensor

To measure time, there is a special function that will give us how long a pulse has been: PulseIn

Behavior examples

And there was light…

Stay on the table!

Watch out!

Light follower

Line following

Obstacle avoiding

Coded in class

Code for Ultrasonic Ranger