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

Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Jun 19, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Controlling Machines with Smalltalk on Raspberry Pi

ESUG 2016 Georg Heeg eK

Georg Heeg & Karsten Kusche

Page 2: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Motivation

Page 3: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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

HDMI

USB

Ethernet

26 GPIOs + Power + Ground

Page 5: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Hardware Assembly

Page 15: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Hardware Assembly

Page 16: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

GPIO Access

• sysfs in Kernel via /sys/class/gpio

Page 17: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

VisualWorksGPIO

GPIO

GPIO

Matrix Button System

Sound System

4 @ 2

on

off

Page 19: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Testing on WindowsGPIO

GPIO

GPIO

Matrix Button System

Sound System

Dummy Objects

Page 22: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Developer Tools

Page 23: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Developer Tools

Page 24: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Home Automationthe Heeg way

Home Automotion

Page 25: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Kitchen Lift

Page 26: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

The LiftMotor with Windlass

Top Contact

Door Contact 1

Controls

Door Contact 2

Bottom Contact

🍵🍺

Page 27: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Connecting 220V

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

Page 28: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Hardware Assembly

Page 29: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Hardware Assembly

Page 30: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Hardware Assembly

Page 31: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Hardware Assembly

Page 32: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Demo• Controlling the Lift from a Workspace

• Using Model Objects for Buttons

Page 35: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg
Page 36: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Maintenance

• X11 via SSH

• basically unnecessary

• runs since October

• daily use

Page 37: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Beaglebone Black

Page 38: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

Virtualization LayerGPIO1

GPIO2

GPIO3

Matrix Button System

vGPIO1

vGPIO2

vGPIO3

Page 39: Controlling Machines with Smalltalk on Raspberry Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

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 Piesug.org/data/ESUG2016/04-Thursday/1400-1430 Controlling Machin… · Smalltalk on Raspberry Pi ESUG 2016 Georg Heeg eK Georg Heeg

SummaryConnecting Hardware to Smalltalk was never more fun