# Week 5

Social robotics

Examples brought from the participants of the class

Social Robotics: LinkVideo1 – Video2 – Video3 – Explanation

Machine states: why and how?

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…

Related topic: Why self driving cars must be programmed to kill

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

Review: Bits and Bytes

What can we do with FSM?

FSM robot

FSM wall bouncer (Roomba for it’s friends)

Just another example:

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.

Code example is hosted here: Example

A complex behavior as a set of sub-behaviors

Subsumption and A.I. in Robots

Behavioral Trees

Subsumption and behaviors

Slides used in class for week 5

Solar panel tracking light coded in class

# Week 4

Some inspiration for the final projects

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

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 Design (discontinued)

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.

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

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

Pseudocode and Flowcharts

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 desired setpoint. The controller attempts to minimize the error over time by adjustment of a control variable, such as the position of a control valve, a damper, or the power supplied to a heating element, to a new value determined by a weighted sum

PID – Image from Wikipedia

PID over and undershooting – Image from Wikipedia

Filters & implementations

Low Pass

High Pass

PID trainer based on the Arduino library: link

Arduino library

Code example of a simple filter with Arduino: link

Code Examples hosted at Github

Slides we used in class

# Week 2

Industrial Robotics

http://www.robotics.org/content-detail.cfm/Industrial-Robotics-Industry-Insights/Robot-Design-Integrated-Controls-and-Software-Architectures-of-Industrial-Robots/content_id/3909

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

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.

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

Microcontroller using analog inputs

Light sensor

Examples

Active Infrared sensor

Examples

Active ultrasonic sensor

Examples

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