This repo. contains the hardware/software design files and Ipython notebooks for PYNQ-BOT.
In order to install it your PYNQ-Z1 boad, connect to the board, open a terminal and type:
sudo pip3.6 install git+https://github.com/Xilinx/PYNQ-BOT.git (on PYNQ v2.1)
Instructions for connecting with board and opening a terminal are on this page : PYNQ Getting Started Guide
This will install the PYNQ-BOT package to your board, and create a pynq_bot directory in the jupyter_notebooks folder on PYNQ-Z1. You will find the Jupyter notebook to run the robot in this directory.
-
Note 1: In order to test the existing package, you have to assemble PYNQ-BOT first or connect individual components (sensor/motors etc.) with corresponding I/O ports as mentioned below.
-
Note 2: Before executing the Jupyter notebook, have a look at the comments/instrucitons in Jupyter notebook and see what each of block of code is doing. You need to configure some parameters for sensor and motors as per your needs.
Following robotics kit and components were used to assemble the PYNQ-BOT.
-
Robotics Kit
-
Grove Ultrasonic Ranger (Optional, If obstruction detection is not needed)
-
PYNQ PMOD Grove Adapter (Optional, required for above Grove Ultrasonic Ranger only)
The Arduino board in robotics kit was replaced by PYNQ-Z1 board and Wifi module was replaced by Raspberry Pi USB WiFi Adapter.
You are free to use any robotics kit, chassis, motor power IC and ultrasonic sensor, but make sure you connect them with correct ports as mentioned in below in I/O Control ports table.
-
The pre-generated bitstream and tcl files can be found under the folder
clone_path/PYNQ-BOT/Robot/bitstream
-
The Ipython notebook can be found under the folder
clone_path/PYNQ-BOT/notebook
-
In Ipython notebook, execute all the cells, then at the end you will see robot control widgets. Just press the buttons to control robot movement and sliders to rotate the camera up/down or left/right.
In order to rebuild the hardware designs, the repo should be cloned in a machine with installation of the Vivado Design Suite (tested with 2017.4). Following the step-by-step instructions:
- Clone the repository on your linux machine: git clone https://github.com/Xilinx/PYNQ-BOT.git;
- Move to
clone_path/PYNQ-BOT/Robot/Pynq_bot_fpga_design
- Set the pynq_bot_root environment variable to
clone_path/PYNQ-BOT/Robot/Pynq_bot_fpga_design
. Make sure to set the variable in bash shell mode, as script uses bash to rebuild the hardware design. - Launch the shell script
make-hw.sh
. - The results will be visible in
clone_path/PYNQ-BOT/Robot
that is organized as follows:- vivado-project : Vivado project can be found in
Pynq_bot_fpga_design/output/pynq_bot
- bitstreams : bitstream and tcl files can be found in
bitstream
folder; - Reports : Utilization report can be found in
Pynq_bot_fpga_design/output/report
.
- vivado-project : Vivado project can be found in
- Note : Make sure all the motors are powered using external power supply/battery and not through the PYNQ-Z1 board. It can damage the board.
Following are the steps and hardware required to control the robot using a Wireless connection.
- Raspberry Pi WiFi Adapter has to be plugged into USB port of PYNQ-Z1 board.
- Note : No usb device should be connected to PYNQ-Z1 during power up. Once the board is powered and is up and running, then connect the USB devices like USB WIFI dongle or USB camera etc. Since PYNQ-Z1 has one USB port, you will need a 2-Port USB 2.0 Hub to connect more than one device.
In jupyter_notebooks/common folder on PYNQ-Z1, you will find usb-wifi.ipynb notebook, which can be used to connect robot with a wireless router/hotspot and control it over WIFI.