pau - intoducing domotics

31
Programming your Lego Mindstorm NXT Robot Lego Mindstorm NXT Robot PAU Lycée Saint-Cricq 15-21 Mar 2015 MORE – MObile Resources on Education

Upload: decibeldanilo

Post on 14-Aug-2015

62 views

Category:

Education


2 download

TRANSCRIPT

Page 1: PAU - Intoducing domotics

Programming yourLego Mindstorm NXT RobotLego Mindstorm NXT Robot

PAULycée Saint-Cricq15-21 Mar 2015

MORE – MObile Resources on Education

Page 2: PAU - Intoducing domotics

MORE - MObile Resources on Education 22- PAU: 15-21 Mar 2015 2MORE - MObile Resources on Education 2

First of all… BUILDING OUR ROBOT!

Prezi presentations

Domabot [Domabot on-

line]

9797 basic model[9797 on-line]

Page 3: PAU - Intoducing domotics

MORE - MObile Resources on Education 33- PAU: 15-21 Mar 2015 3MORE - MObile Resources on Education 3

And our… “ramp”

Don’t crash the wall

Ramp version[Ramp on-line]

Page 4: PAU - Intoducing domotics

MORE - MObile Resources on Education 44- PAU: 15-21 Mar 2015 4MORE - MObile Resources on Education 4

“Find” the problem…

The Robot is doing “somethingsomething”…

In your opinion which is the problemproblem it’s solving?

Page 5: PAU - Intoducing domotics

MORE - MObile Resources on Education 55- PAU: 15-21 Mar 2015 5MORE - MObile Resources on Education 5

Video… problem Solve “your” problem…

Page 6: PAU - Intoducing domotics

MORE - MObile Resources on Education 66- PAU: 15-21 Mar 2015 6MORE - MObile Resources on Education 6

We would like…

A sequence of logical steps – e.g.:

When you press a button: Go forward 3” Turn right 90° Go backwards 2”

When you press again a button: Enjoy yourself Enjoy yourself !!! !!!

Just a…flux diagramJust a…flux diagram

Page 7: PAU - Intoducing domotics

MORE - MObile Resources on Education 77- PAU: 15-21 Mar 2015 7MORE - MObile Resources on Education 7

Flux Diagram (example)

Start

Acquiredistance

Setdistance(=100)

50<distance<100Set MotorsBackwards Power 20%

YES

NO

25<distance<49Set MotorsBackwards Power 60%

YES

0<distance<24Set MotorsBackwards Power 100%

YES

NO

NO

distance>100 Turn Motors offYES

NO

Page 8: PAU - Intoducing domotics

MORE - MObile Resources on Education 88- PAU: 15-21 Mar 2015 8MORE - MObile Resources on Education 8

See you soon…

…talking about youryour and ourour flux diagram

…and the robot program!

At the end of our workshopAt the end of our workshop !

Page 9: PAU - Intoducing domotics

MORE - MObile Resources on Education 99- PAU: 15-21 Mar 2015 9MORE - MObile Resources on Education 9

Programming levels…

Level 2Level 21 program

runningInteraction withthe environment

Level 1Level 11 program running

NO interaction withthe environment

Level 0Level 0NO Program running

Page 10: PAU - Intoducing domotics

MORE - MObile Resources on Education 1010- PAU: 15-21 Mar 2015 10MORE - MObile Resources on Education 10

NONO sensor and… NONO programWhat is the robot seeing? [programming level_0]

WiFiWiFi

BluetoothBluetooth

Page 11: PAU - Intoducing domotics

MORE - MObile Resources on Education 1111- PAU: 15-21 Mar 2015 11MORE - MObile Resources on Education 11

What do you need?

Wi Fi ConnectionWi Fi Connection:1 Router (IP address, e.g.: 192.168.1.1)

DHCP server1 notebook (IP address, e.g.:

192.168.1.55) 1 smart phone Connected to the

“DLink” network Run your “IP Webcam” “IP Webcam” android app

(Your smart phone will be a webcam server)webcam server) Please read the IP address given by

the DHCP server (something like: 192.168.1.xxx:8080)

WiFiWiFi

Page 12: PAU - Intoducing domotics

MORE - MObile Resources on Education 1212- PAU: 15-21 Mar 2015 12MORE - MObile Resources on Education 12

And…

Bluetooth connectionBluetooth connection1 Smartphone

MO_R_E_NXT_Remote_control_V2 Download your own copy .apk file (from

tablet) Install the MO_R_E_NXT_ … program Connect to the robot (PAU_3, PAU_5 or

PAU_6) Run your software copy

Drive your Robot

BluetoothBluetooth

Page 13: PAU - Intoducing domotics

MORE - MObile Resources on Education 1313- PAU: 15-21 Mar 2015 13MORE - MObile Resources on Education 13

Programming language (NXT 2.0)

Common

Data

Advanced

Flow

Action

Sensor

Page 14: PAU - Intoducing domotics

MORE - MObile Resources on Education 1414- PAU: 15-21 Mar 2015 14MORE - MObile Resources on Education 14

No sensor [programming level_1]

The robot is programmed… It’s always doing the same “things”, with no interaction with the environment…

We need: 1 Domabot

Page 15: PAU - Intoducing domotics

MORE - MObile Resources on Education 1515- PAU: 15-21 Mar 2015 15MORE - MObile Resources on Education 15

“No sensor” - Video…

Page 16: PAU - Intoducing domotics

MORE - MObile Resources on Education 1616- PAU: 15-21 Mar 2015 16MORE - MObile Resources on Education 16

“No sensor” – Flux diagram

Page 17: PAU - Intoducing domotics

MORE - MObile Resources on Education 1717- PAU: 15-21 Mar 2015 17MORE - MObile Resources on Education 17

NO Sensor program (1_NO_sensor.rbt)

html Version

Page 18: PAU - Intoducing domotics

MORE - MObile Resources on Education 1818- PAU: 15-21 Mar 2015 18MORE - MObile Resources on Education 18

Sound control [programming level_2]

The robot is moving forward, (remote) controlled by the intensity of sound…

We needWe need:1 Domabot1 Sound

sensor

Page 19: PAU - Intoducing domotics

MORE - MObile Resources on Education 1919- PAU: 15-21 Mar 2015 19MORE - MObile Resources on Education 19

“Sound control” – Video…

Page 20: PAU - Intoducing domotics

MORE - MObile Resources on Education 2020- PAU: 15-21 Mar 2015 20MORE - MObile Resources on Education 20

“Sound control” – Flux diagram

Page 21: PAU - Intoducing domotics

MORE - MObile Resources on Education 2121- PAU: 15-21 Mar 2015 21MORE - MObile Resources on Education 21

Sound control program (2_Sound_control.rbt)

html Version

Page 22: PAU - Intoducing domotics

MORE - MObile Resources on Education 2222- PAU: 15-21 Mar 2015 22MORE - MObile Resources on Education 22

Line follower

The robot is following the black line… every path is good to solve “its” problem…

We needWe need: 1 9797 robot 1 Light sensor 1 black path

Page 23: PAU - Intoducing domotics

MORE - MObile Resources on Education 2323- PAU: 15-21 Mar 2015 23MORE - MObile Resources on Education 23

“Following the black line” – Video…

Page 24: PAU - Intoducing domotics

MORE - MObile Resources on Education 2424- PAU: 15-21 Mar 2015 24MORE - MObile Resources on Education 24

“Line follower” – Flux diagram

Page 25: PAU - Intoducing domotics

MORE - MObile Resources on Education 2525- PAU: 15-21 Mar 2015 25MORE - MObile Resources on Education 25

Line Follower program (3_Line_Follower.rbt)

html Version

Page 26: PAU - Intoducing domotics

MORE - MObile Resources on Education 2626- PAU: 15-21 Mar 2015 26MORE - MObile Resources on Education 26

“Problem solving” – Flux diagram

Page 27: PAU - Intoducing domotics

MORE - MObile Resources on Education 2727- PAU: 15-21 Mar 2015 27MORE - MObile Resources on Education 27

Problem solving program (4_Problem_Solve.rbt)

html Version

Page 28: PAU - Intoducing domotics

MORE - MObile Resources on Education 2828- PAU: 15-21 Mar 2015 28MORE - MObile Resources on Education 28

Something else…

All sensors at once Playing with a… joystick

http://www.nxtprograms.com/4x4_joystick/steps.html

Building your Express-botExpress-bot http://www.nxtprograms.com/9797/express-bot/steps.html

Page 29: PAU - Intoducing domotics

MORE - MObile Resources on Education 2929- PAU: 15-21 Mar 2015 29MORE - MObile Resources on Education 29

All Sensors

Page 30: PAU - Intoducing domotics

MORE - MObile Resources on Education 3030- PAU: 15-21 Mar 2015 30MORE - MObile Resources on Education 30

All Sensors - Programm

html Version

Page 31: PAU - Intoducing domotics

MORE - MObile Resources on Education 3131- PAU: 15-21 Mar 2015 31MORE - MObile Resources on Education 31

Joystick Drive

html Version

http://www.nxtprograms.com/programs/Joystick_Drive.rbt