Sunday, November 26, 2017

MyTraffic Light

This app is to create Trafic app for BBB on the RPi.
see Traffic control example running on a Beagle Bone Black for background.
Breadboard Wiring

Wiring to RPi












RPi wiring
Traffic light (Red,Yellow,Green= (pins 11,13,15) = (GPIO 17,13, 22)
Pedestrian (Red,           ,Green= (pins12,    ,16)  = (GPIO 12,    ,23)

  • Connect LED+ to a GPIO pin on the RPi
  • Connect LED- to resistor (used 330 Ohms)
  • Connect resistors to breadboard negative line,
  • which should be connected to a ground pin on RPi (used pin 6=GND)

Trafic system

Click on System and then on the  Virtual DNS tab at bottom and all variables, like %SCADA_Enable%,  and their values appear :)

Saturday, November 25, 2017

Blinky on Raspberry Pi

Test Environment and other requirements
  • Used mobile phone to create a network with 2 nodes. Interesting since no longer just using localhost.
  • ipconfig (windows) and ifconfig (raspbian)  identified the net ip address to use for the respective devices.
  • GPIO pin #s are used as expected like other SysFs RPi examples
  • Start forte on the Raspberry Pi as follows. It requires sudo to work and of course the ip addr:port as input
    • cd to directory with the forte executable:
    • sudo ./forte -c :61499
  • When using Publish and Subscribe use multicast IP addresses with unique ports.
    • See  FBDK/IP in 4diac documentation for more details.

Test Apps
Needed to use step-wise refinement to be sure the parts worked.
App1: LEDon Turn RPi led on
Tested: (RPI only)
*if the communication from 4diac-IDE to RPi worked
*if pin numbering is GPIO numbering
*simple sysFS communication test
App2: LEDauto : Blink RPi led
Tested:  (RPI only) Using sysFS more
App3ALEDstart_Stop:  (added RPI > status to PC) Blink RPi led and reflect in FBRT WINDOW via BOOL_OUT with a PC "led" 
Tested: Publish / Subscribe to PC from RPi
App3B: LEDstart_Stop:  (added PC control of RPi) Via Start and Stop buttons on PC in a FBRT_WINDOW control starting and stopping the blinking of the RPI led and the PC "led" to reflect RPi activity 
Tested: Publish / Subscribe to RPi from PC  to control RPi

LED test app Win10

[Some apps and links in older posts no longer exist, so screen shots so not lost.]

Idea is an app where the LED specifics can be mapped to different devices.

Since the LED specific parameters and interfaces are different, this is not a true build once run anywhere. This will be addressed in later post where a wrapper will hide the differences and  limitations that come from hiding the differences will discussed.

PC LED Test App from current (Nov.2017) with LED added via FBDK > HMI > OUT_BOOL FB
Also needed to add for connection between devices a Publish E_SR Q output  (FORTE_PC) to OUT_BOOL FB IN (FBDK_WINDOW) via Subscribe.


System Configuration

Devices are both on PC, but running different IEC61499 tools.

Application (Distributed)

.

Connections between devices

FBDT_WINDOW.PANEL_RESOURCE


FORTE_PC.EMB_RESOURCE     (EMB=embedded)

APP Deployed

Press START button and led1 alternates between black and red.


Tuesday, November 14, 2017

O/S and HW to run 4DIAC

As 4DIAC gets better, most O/S environments work with pre-compiled exe    

O/S currently:
  • Windows: Virtual Studio set-up is easier because Eclipse set-up uses cygwin, whose set-up is harder.  Majority of 4DIAC downloads are still from Windows.
  • Linux: Flavor used doesn't matter, Debian, Raspbian, Ubuntu, Cent OS etc. etc. Most documentation using Debian based packaging command. Favored by 4DIAC developers.
  • Mac (CACAO): Similar to Linux, but don't know anyone personally using, but often used by developers.
4DIAC Hardware comparison for hobbyist or a class:
  • Raspberry Pi models,  Several Raspberry Pi models supported and used in examples and real apps.
  • Beagle Board models, 4DIAC Trafic example uses Beagle Bone Black
  • Or donated HW 

Monday, November 13, 2017

Current 4DIAC class set-ups

(My current understand of )
These are the current 4DIAC class set-ups:

1. TU Wien Seminar

  • HW: Beckhoff?

2. Demos
  • HW - Beagle Bone (Black)
  • O/S - Debian
  • Demo app(s) - traffic light
  • Location - Off-site at conference or business
3. Demo - Hardware specific
  • HW - Company specific
  • O/S - Debian
  • Demo app(s) - ?
  • Location - Off-site at conference or business

Sunday, October 29, 2017

Finding EV3dev IP address


EV3 is connected to internet via USB cable to laptop. 
Tested with :
Laptop: Ethernet plug-in connection to internet 
EV3 :    usb cable to laptop sharing laptop's internet

Use ssh to log into the EV3DEV  (id: robot password: maker)

Started with: Determine Your Private and Public IP Addresses from the Command Line but needed to replace eth0 with usb1

Displaying private IP addresses

Note: Host laptop has different private IP address

$ hostname -I
Result: 192.168.137.3

$ /sbin/ifconfig
Result: usb1      Link encap:Ethernet  HWaddr 22:16:53:51:62:2f
  inet addr:192.168.137.3  ...

$ /sbin/ifconfig usb1 | grep Mask
Result:  inet addr:192.168.137.3  Bcast:192.168.137.255  Mask:255.255.255.0 .....

$ ip addr show usb1
result: 
3: usb1: ....
    link/ether...
    inet 192.168.137.3/24 ....
    ....

$ ip addr show usb1 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/'
result: 192.168.137.3

Displaying the public IP address

Note: Host laptop has same public IP address

http://www.ifconfig.me  (etc)
[curl not installed on ev3dev]

$ wget -qO- ifconfig.me
search for ip_address 

Saturday, October 28, 2017

First look at Lego Water Pumps


How does a water fountain pump work?


Fountain Pumps. The pump is the unseen heart of your fountain. Submerged in the reservoir, the pump draws water into its housing, where an impeller (a water propeller spun by electricity) forces the water out through the pump's outflow fitting.

source: fountainfinder.com/fountain_pumps.htm


4diac task idea using Stepwise refinement

Task 1: Student builds own water pump and test as a fountain
  • Simple to build out of Lego parts in 1/2 hour or less as shown in short videos. Student can also pick how to build their impeller from examples or own ideas.
  • Any motor can be used, so will work for Raspberry Pi or any HW supporting a motor.
Task 2: Water goes into another container then...
    • measure height of water left to know when to stop
    • measure of water in new container to know when to stop
    • measure water rate of flow based on water delivered in specific time (or via water height)
Task 3:  Student ideas for different flow rates and start and stop when ???

Construction

Coming screen shots from videos to help with my first water pump construction try. 
  • All examples used Lego motors and Technic parts, but no Lego EV3 nor programming. 
  • No standardized task description or construction was found.
12/9/17 Simple pump working (repeatable and have videos to chose to post) BUT would like a stronger pump that pumps higher. Easier to put in an larger student project scenario.

1/4/18 update... Will try with a medium power fn motor just got since using EV3 motor it was hard to get enough power to pump the water very high. Will try MattD600 video model and instructions next. Didn't have parts for the propeller nor same kind of motor until now.

Video Examples

  • All examples used Lego motors and Technic parts
  • None use Lego EV3 nor any programming. 
  • Motor on top parallel to top of fountain
  • Water intake usually on bottom
    • So need small legs so water get underneath
  • Pipes are narrow (1-2 dots wide) to help force the water up
Lego Water pump video Link collection with notes

Lego (Technic) Water Pump Building Instructions


Lego (Technic) Water Pump - MOC 

Working Lego Centrifugal Water Pump (with instructions) [MattD600] Has parts and most detailed instructions. Explains how pump works well. 
 [1/4/18] Now have some parts needed for propeller didn't have before and can try flipping the physical motor set switch in application.

Lego water pump tutorial ... 
  • Motor mounts on top are very clear
  • Curved impeller housing
  • Bit chaotic as he forgot how he built it.
Lego water pump tutorial. pumps a lot of water
  • Design simple but good
    • impeller and housing are simple, but effective design
  • Explains details like when weighting is needed
Lego Water Pump V2
  • Different motor connection to impeller
  • Strong simple impeller with more than 3 blades
    • Note: His faster v3 impeller has 3 blades.
  • Very strong water flow
  • Less leakage if long solid pieces on side
Lego water pump tutorial (Pumps Alot Of Water!)
  • Shows building pipe in detail
Working Lego Centrifugal Water Pump (with instructions)
  • Another impeller idea
  • Complete building instructions