Thursday, 21 July 2016

The gravest fear that has rippled through humanity from the technology industry is that, someday, almost all of our jobs will be replaced by robots.
While that fear is often laughed off as something that will only happen far into the future, the truth is that it's actually happening right now.
In Dongguan City, located in the central Guangdong province of China, a technology company has set up a factory run almost exclusively by robots, and the results are fascinating.
The Changying Precision Technology Company factory in Dongguan has automated production lines that use robotic arms to produce parts for cell phones. The factory also has automated machining equipment, autonomous transport trucks, and other automated equipment in the warehouse.
There are still people working at the factory, though. Three workers check and monitor each production line and there are other employees who monitor a computer control system. Previously, there were 650 employees at the factory. With the new robots, there's now only 60. Luo Weiqiang, general manager of the company, told the People's Daily that the number of employees could drop to 20 in the future.
The robots have produced almost three times as many pieces as were produced before. According to the People's Daily, production per person has increased from 8,000 pieces to 21,000 pieces. That's a 162.5% increase.
The increased production rate hasn't come at the cost of quality either. In fact, quality has improved. Before the robots, the product defect rate was 25%, now it is below 5%.
Shenzhen Evenwin Precision Technology, also based in Dongguan, announced a similar effort in May 2015. This region of China is often referred to as the "world's workshop" due to the high number of factories located there.
The shift happening with automation has been in the works for many similar companies in the area for quite some time. Foxconn, the controversial manufacturer of many gadgets such as the iPhone and iPad announced itsrobot initiative back in 2011.
Dongguan is about an hour's car ride north of Shenzhen, which is widely regarded as one of the top regions in the world for gadget manufacturing. The growth of robotics in the area's factories comes amidst a particularly harsh climate around factory worker conditions, highlighted by strikes in the area. One can only wonder whether automation will add fuel to the fire or quell some of the unrest.
Some of the influx of robotics in the region is due to the Made in China 2025initiative, and we will continue to see automation affect the area and potentially reduce the number of manufacturing jobs. Additionally, in March, 2015, the Guangdong government announced a three year plan to increase automation in the region by subsidizing the purchase of robots.
According to the International Federation of Robotics (IFR), electronics production was one of the biggest growth drivers for the sales of industrial robots. China was the largest market for industrial robotics in 2014 with nearly 60,000 robots sold.

Saturday, 2 July 2016

Nikon Digital Camera - PLC - Raspberry Pi 2

This PLC application about how to use Nikon Digital Camera for connecting to PLC with using Raspberry Pi 2. this application for photographing, example:
Automatically take picture when:
  1. products that are not good (NG) or reject
  2. at a certain time, the worker does not exist in the machine
  3. emergency stop in the machine, and etc.
In Nikon Digital Camera using USB Picture Transfer Protocol (PTP protocols) or another digital camera that is PTP Protocols support.
In Raspberry Pi using Raspberry pi 2 with Raspbian Wheezy OS and use python 2.7
In PLC using Siemens S7-200 with Modbus Support or another PLC with Modbus Support.


Hardware needed for Digital Camera Application

  1. Digital Camera with PTP Support, I use Nikon COOLPIX S2800 Compact Digital Camera
  2. Raspberry Pi 2
  3. PLC that is Modbus Support, I use Siemens PLC S7-200
  4. Male RS232 - TTL Module
  5. RS232 PLC Cable
  6. Power Supply for Raspberry Pi
  7. 2 pieces Push Button Switch for test

Hardware Connection for Digital Camera Application

Software needed for Digital Camera Application

  1. Raspbian Wheezy OS : https://www.raspberrypi.org/downloads/raspbian/
  2. gphoto2 reference : http://gphoto.sourceforge.net/doc/manual/ref-gphoto2-cli.html
  3. Project file for Raspberry Pi Setup, click here

Raspberry Pi Setup for Digital Camera Application

A. Serial Modbus Setup on Raspberry Pi 2

STEP 1:

In LXTerminal:

sudo cp /boot/cmdline.txt /boot/cmdline.bak
sudo cp /etc/inittab /etc/inittab.bak

sudo nano /boot/cmdline.txt

Remove "console=ttyAMA0,115200"

Ctrl+X to exit, Y to save followed by enter twice

sudo nano /etc/inittab

Put a '#' before "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Ctrl+X to exit, Y to save followed by enter twice

STEP 2:

Copy Paste All Project file to folder /home/pi on Raspberry Pi 2

STEP 3:


In LXTerminal

cd /home/pi
cd pyserial-2.7
sudo python setup.py install

STEP 4:

In LXTerminal

cd /home/pi
cd MinimalModbus-0.6
sudo python setup.py install

B. gphoto2 Setup on Raspberry Pi 2

STEP 1:

Raspberry Pi Connected to Internet via Ethernet/LAN
Install via Internet Access:
Open LX-Terminal and type:

cd ~
sudo apt-get install libltdl-dev libusb-dev libusb-1.0 libexif-dev libpopt-dev

Optional: Raspberry Pi Disconnected from Internet

STEP 2:

Camera do not Connected to Raspberry Pi
Already Project file to folder /home/pi on Raspberry Pi 2

STEP 3: libgphoto2-2.5.8 setup

in LX-Terminal and type:

cd ~
cd libgphoto2-2.5.8
sudo chmod 777 * -R
./configure
sudo make install

STEP 4: gphoto2-2.5.8 setup

in LX-Terminal and type:

cd ~
cd gphoto2-2.5.8
sudo chmod 777 * -R
./configure
sudo make install

STEP 5: Check the installed gphoto2 is Success

in LX Terminal type:

cd ~
gphoto2 --version

If Error:
gphoto2: error while loading shared libraries: libgphoto2.so.6: cannot open shared object file: No such file or directory

in LX Terminal type:

sudo ln -s /usr/local/lib/libgphoto2.so.6 /usr/lib/libgphoto2.so.6

If Error:
gphoto2: error while loading shared libraries: libgphoto2_port.so.12: cannot open shared object file: No such file or directory

in LX Terminal type:

sudo ln -s /usr/local/lib/libgphoto2_port.so.12 /usr/lib/libgphoto2_port.so.12

STEP 6: Camera Check

Camera Connected to Raspberry Pi via USB
in LX Terminal type:

cd ~
gphoto2 --auto-detect
gphoto2 --summary

If Error:
Camera already ..
From Remove Camera such as Storage Mass

sudo killall gvfs-gphoto2-volume-monitor 
sudo chmod -x /usr/lib/gvfs/gvfs-gphoto2-volume-monitor

C. Auto Startup Python Script on Raspberry Pi 2

STEP 1:

in LX Terminal type:

cd ~
sudo nano auto-startup.sh

in editor, type in this script:

#!/bin/sh
cd /
cd home/pi
sudo python take-photo-plc.py
cd /
and then:
CTRL+X ,  press Y, enter

STEP 2:


in LX Terminal type:

cd ~
sudo chmod 755 auto-startup.sh

STEP 3:

Script Test, in LX Terminal type:

sudo sh auto-startup.sh

CTRL+C for  Stop

STEP 4:

in LX Terminal type:

sudo crontab -e

In editor, go to bottom and type:

@reboot sh /home/pi/auto-startup.sh >/home/pi/startuplog 2>&1
CTRL+X ,  press Y, enter

STEP 5:


Auto Start the Desktop (LXDE)
  1. in LX Terminal type: sudo raspi-config
  2. 2.Select Enable Boot to Desktop/Scratch from the menu and press Enter
  3. 3.Select Desktop Login as user pi at the Graphical Desktop.
  4. 4.Select <Finish> and Enter, then select <Yes> to reboot.

PLC Programming for Automatic Capture Image

  1. Project file for Siemens PLC S7-200, click here
  2. Download PLC Ladder Programming to PLC using PLC Software