UFactory Vision Camera Kit User manual

Vision Camera Kit
V2.2
User Guidance
SHENZHEN UFACTORY CO.,LTD.

Contents
Vision Kit User Manual
1 List of Materials
1.1 Hardware
1.2 Software
2 System structure
3 Installation Tutorial
3.1 Hardware Installation Tutorial
3.1.1 Kit Installation Tutorial
3.1.2 Wiring Tutorial
3.2 Software Installation Tutorial
3.2.1 uArm controller & firmware writing tutorial
3.2.2 uArm swift pro Firmware Recovery
3.3 OpenMv tracking code writing
3.3.1 Adjusting Tracking Color
3.4 uArm Visual Object Sorting Example
01
02
02
02
03
03
03
03
05
05
05
07
08
10
10

Vision Kit User Manual
1 List of Materials
1.1 Hardware
1.2 Software
2 System structure
3 Installation Tutorial
3.1 Hardware Installation Tutorial
3.1.1 Kit Installation Tutorial
3.1.2 Wiring Tutorial
3.2 Software Installation Tutorial
3.2.1 uArm controller & firmware writing tutorial
3.2.2 uArm swift pro Firmware Recovery
3.3 OpenMv tracking code writing
3.3.1 Adjusting Tracking Color
3.4 uArm Visual Object Sorting Example
Vision Kit User Manual
1 List of Materials
1.1 Hardware
1.Target object * 3 2.USB cable *1
3.USB Type C cable*2 4.uArm 30P bottom expansion board * 1
5.OpenMv Kit* 1 6.DC Power Supply 3-in-1 cable * 1
7.OpenMv mounting bracket (with M3 screws)*1 8.uArm Controller* 1
1.2 Software
02
1 2 3
456
7
8
1.Arduino IDE
www.arduino.cc
2.OpenMv IDE
www.openmv.io
3.Vision.ino for Controller [Github]
https://bit.ly/2W6S8Sr
4.Color_tracking_test.py for OpenMv [Github]
https://bit.ly/2Ea18Mq
5.UArmSwiftPro_2ndUART.hex for uArm[Github]
https://bit.ly/30PWn4i

1 Attach the vacuum cup to the arm.
2 Attach the OpenMv mounting bracket to the end of the arm with M3 screws as shown below .
2. System Structure
3 Installation Tutorial
3.1 Hardware installation tutorial
3.1.1 Visual Kit Installation Tutorial
OpenMv mounting bracket M3 screws
03
uArm controller
USART2
USART3
5V
12V
OpenMv
uArm Swift Pro
12V

3.Tighten the screws on the end of the uArm by hand.
04

Wiring as shown below
3.1.2 Wiring Tutorial
3.2.1 uArm controller & uArm swift pro firmware writing tutorial
3.2 Software installation tutorial
uArm Controller firmware writing
The uArm Controller firmware has been written before leaving the factory. To rewrite the
firmware, please refer to the following steps.
(1)Connect the uArm Controller to the computer with a usb cable.
(2)Turn on the switch and the uArm Controller power indicator lights up
05
uArm
Open Mv
Controller Power Cable
uArm Power Cable

(3) Download XLoader xloader.russemotto.com/
(4)Download the hex-controller-vision.ino.hex
http://bit.ly/2NPbOY1
click the link
http://bit.ly/2XCfh0C
to learn how to download single directory from GitHub.
(5)Open XLoader and select your controller's COM port from the drop down menu on the lower left.
(6)Select the appropriate device from the dropdown list titled "Device".
(7)Check that Xloader set the correct baud rate for the device: 115200 for Mega (ATMEGA2560).
(8)Now use the browse button on the top right of the form to browse to your hex file.
(9)Once your hex file is selected, click "Upload" The upload process generally takes about 3 seconds
to finish. Once completed, a message will appear in the bottom left corner of XLoader telling you how
many bytes were uploaded. If there was an error, it would show instead of the total bytes uploaded.
Steps should be similar and may be done through the command prompt.
06

3.2.2 uArm swift pro Firmware Recovery
In the uArm Swift Pro, a specific firmware for the visual kit has been flashed. This firmware cannot be
used for controlling the robot arm with uArm Studio. If you want to control uArm with the uArm Studio,
please restore the firmware as follows:
Connect uArm Swift Pro to your computer, open XLoader ( ), and load
SWIFTPRO3.2.0.hex ( ). Click the
"Upload" button to upload the code to uArm Swift Pro.
If you want to change the code in the firmware, Please follow the file named readme.md in the following
link:
https://github.com/uArm-Developer/Controller/tree/master/scene_demo/vision_scratch%20cube
07
http://xloader.russemotto.com/
http://download.ufactory.cc/firmware/SWIFTPRO3.2.0.hex?attname=
uArm swift pro firmware writing tutorial
Connect uArm Swift Pro to your computer. Open XLoader ( ) and
load uArmSwiftPro_2ndUART.hex ( )
Click the "Upload" button to upload the code to uArm Swift Pro.
https://xloader.russemotto.com/
https://bit.ly/30PWn4i

All OpenMv Kits have been written with the tracking code before leaving the factory. If you need to
rewrite the tracking code, please refer to the following steps.
3.3 OpenMv tracking code writing
(1) Download OpenMv tracking code Open the color_tracking_test.py
(2) Connect OpenMv to the computer with a USB cable
https://bit.ly/2Ea18Mq
(3) Open OpenMv IDE, load color_tracking_test.py
https://bit.ly/2Ea18Mq click "Start".
08
USB MICRO

(4) Rotate the OpenMv lens to adjust the focal length
(5) Save the code to OpenMv
09

The current code tracks the red cube by default, and the color to be tracked can be adjusted
according to actual needs.
The adjustment method is as follows:
Char color_sel=0, tracking yellow objects;
Char color_sel=1, tracking red objects;
Char color_sel=2, track green objects.
3.3.1 Adjusting the Tracking color
After power-on, the display of uArm Controller oled will show a startup interface, click button
A according to the displayed content.
3.4 uArm-Visual Object Sorting System Example
Button A
Button B
Button D
oled
Button Cjoystick
vision demo
click buttonA
to start
10

Click button A to enter the mode selection interface.
buttonA-C is the selection of the grip module, corresponding to different color squares, but-
tonD is the offset setting mode. After confirming the desired color of the object, click the cor-
responding button to enter the grip mode. Make sure that the connection to the uArm is
normal, otherwise, you will not able to enter the grip mode. After entering the grip mode, if it
fails to connect with the OpenMv, a message will be shown on the display.
If it is connected to OpenMv but does not find the corresponding color square, oled will dis-
play a message saying that are waitting for the cube.
buttonA:redcude
buttonB:greencube
buttonC:yellowcube
buttonD:offsetmode
error:disconnect
with OpenMv
11
vision start
waitting for cube
buttonD:choose cube

When an object is found, oled will enter the grip mode and display the locations of x and y.
handing cube
x: 134
y: 65
buttonD:choose cube
If you find that the gripping location of uArm grab is inconsistent with the placement location,
you can adjust the offset metric with the joystick in the offset mode.Hold down the button D
until the oled displays the following picture and then enter offset mode
If you want to return to the color selection interface, press buttonD twice to enter the color
selection interface, and press buttonD to enter the offset setting mode.
Note: If your problem cannot be solved with the above solutions, please set the offset metrics
to zero and then restart the system. Due to the positional deviation, the vacuum cup may not
be able to grab the target object accurately. In this case, adjust the camera's mounting posi-
tion in such a way that the vacuum cup can accurately grab the target object.
As shown in the figure below, in general, there is no positional deviation in the Y-axis direc-
tion, and the main deviation comes from the X-axis direction. The X-axis deviation can be
eliminated by adjusting the mounting angle of the camera; or adjust the offset metric in the
offset setting mode, to observe the deviation between the uArm gripping position and the
placement position of the object. Please wait for the uArm to complete the gripping process
before adjusting the offset metrics of uArm in the calibration mode.
offest mode
x_offset: 0
y_offset: 0
buttonD:choosecube
12

If the object is behind the suction cup when grabbing, adjust the camera up.
X
Y
If the object is in front of the suction cup when grabbing, adjust the camera down.
Old Visual Camera Kit User Manual: http://bit.ly/uArmVisionCameraKitENv1-7
13

Ufactoty2013 UFACTORY_UF UFACTORY
Address:2F, Building M-6, Ma Que Ling Industrial Zone,
Nanshan District, Shenzhen, Guangdong, P.R. China
Website: Email:info@ufactor y.cc
www.ufactor y.cc
Table of contents