Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on...

40
Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche

Transcript of Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on...

Page 1: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Controlling Machines with Smalltalk on Raspberry Pi

ESUG 2016 Georg Heeg eK

Georg Heeg & Karsten Kusche

Page 2: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Motivation

Page 3: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Mundartenstation(Station of German Dialects)

• Button to start / stop playback

• LED to indicate playback

• MP3 support

• configuration via CSV-Files

Page 4: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Raspberry Pi 900Mhz Quad-Core ARMv7 @ 1GB RAM

HDMI

USB

Ethernet

26 GPIOs + Power + Ground

Page 5: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 6: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 7: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 8: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 9: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 10: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 11: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 12: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

Page 13: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

LED Matrix Circuit• How to connect 84 Buttons

and LEDs to 27 GPIOs?

• 84 Buttons = 7 rows x 12 cols

• = on

• = off

• = in

• = out

r1

r2

r3

r4

c1 c2 c3 c4

x

x

x

x

L1 L2 L3 L4

Page 14: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Hardware Assembly

Page 15: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Hardware Assembly

Page 16: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

GPIO Access

• sysfs in Kernel via /sys/class/gpio

Page 17: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

How to program the Raspberry Pi?

• Cincom® is Cosponsor of Erlebniswelt Deutsche Sprache

• Initial Port of VisualWorks® VM within 5 Days

Page 18: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

VisualWorksGPIO

GPIO

GPIO

Matrix Button System

Sound System

4 @ 2

on

off

Page 19: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

VisualWorksGPIO

GPIO

GPIO

Matrix Button System

Sound System 4 @ 2

on

off

LEDSound System

Matrix LED

System GPIO

Page 20: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Sound System1. Wait for Any Button-Press

2. Play Track

3. Wait for Button-Release

4. Wait for End of Track or Same Button-Press

5. Wait for Button-Release

6. Repeat

Page 21: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Testing on WindowsGPIO

GPIO

GPIO

Matrix Button System

Sound System

Dummy Objects

Page 22: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Developer Tools

Page 23: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Developer Tools

Page 24: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Home Automationthe Heeg way

Home Automotion

Page 25: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Kitchen Lift

Page 26: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

The LiftMotor with Windlass

Top Contact

Door Contact 1

Controls

Door Contact 2

Bottom Contact

🍵🍺

Page 27: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Connecting 220V

• Relays to switch via GPIO • Contactor to switch Motor • Relay switches Contactor

Page 28: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Hardware Assembly

Page 29: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Hardware Assembly

Page 30: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Hardware Assembly

Page 31: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Hardware Assembly

Page 32: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Software ModelGPIO

GPIO

GPIO

Motor Control

Lift

up/down stop

Relay Array

Conductor Array

Single-Phase

AC Motor

Trigger Button

GPIOSensor Button

Page 33: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

5 Software Rules• Door open ➟ Stop

• Driving Up ∧ Top Contact ➟ Stop

• Driving Down ∧ Bottom Contact ➟ Stop

• ¬ Driving ∧ ¬ Bottom Contact ∧ Control Down ➟ Drive Down

• ¬ Driving ∧ ¬ Top Contact ∧ Control Up ➟ Drive Up

Page 34: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Demo• Controlling the Lift from a Workspace

• Using Model Objects for Buttons

Page 35: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...
Page 36: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Maintenance

• X11 via SSH

• basically unnecessary

• runs since October

• daily use

Page 37: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Beaglebone Black

Page 38: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Virtualization LayerGPIO1

GPIO2

GPIO3

Matrix Button System

vGPIO1

vGPIO2

vGPIO3

Page 39: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

Availability• 32bit Linux ARM VM

• available since August 19th, 2016

• through Cincom Smalltalk Developer Program

• Smalltalk GPIO Access

• to be determined

Page 40: Controlling Machines with Smalltalk on Raspberry Pi€¦ · Controlling Machines with Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg & Karsten Kusche. Motivation. ...

SummaryConnecting Hardware to Smalltalk was never more fun