[{Image src='attach/KRZ01/krz-01-carpet-800w.jpg' caption='The KRZ01 at home on the lounge carpet' align='center'}]

The   __KRZ01__  robot is a  [robot prototype]  in the [mini weight class|RobotWeightClasses]. 

''You can also see the [NZPRG blog entry on the KRZ01|https://robots.org.nz/2020/02/07/krz-01/] and a [motor test video|https://youtu.be/VdvCCPvwDmE] on the [NZPRG YouTube Channel|https://www.youtube.com/channel/UCY3HPoPv-t_1HiRurWfgUOA].''

[{TableOfContents}]

Note that the KRZ01 has been superceded by the __[KRZ02]__, a Mechanum-wheeled robot.


!! Description

[{Image src='attach/KRZ01/krz01-top-thumb.jpg' link='attach/KRZ01/krz01-top.jpg' caption='Breakout Board and Motor Controller (click to enlarge)' align='right' class='imgFloatRight'}]

The KRZ01 (''__K__iwi __R__obot for the Raspberry Pi __Z__ero Model __1__'') uses a __Raspberry Pi Zero W__ (with Wifi) as its computer and a __PiconZero__ as its robot controller. Considering that the microcontroller and robot controller for the larger [KC01] together costs about NZ$82, this robot (at about NZ$52) has about a $30 price advantage, ''and it has wifi''.

It has a [Raspberry Pi] rather than the KC01's [Circuit Playground Express] — so it runs on Linux, whereas the KC01 runs a single Python program.

RobotShop sell a [MiniQ Motor Wheel Set w/ Encoder|https://www.robotshop.com/en/miniq-motor-wheel-set-encoder.html|https://www.robotshop.com/en/miniq-motor-wheel-set-encoder.html] that includes two motors, wheels and an encoder pair — with the encoders already mounted — for US$36. They use the 50:1 ratio rather than 298:1. The as-built prototype uses the 298:1 motors.


!! Requirements

TBD

!! Photos

%%(max-width: 800px)
| [{Image src='attach/KRZ01/krz01-side-thumb.jpg' link='attach/KRZ01/krz01-side.jpg' caption='Side View (click to enlarge)' align='left' class='imgFloatLeft'}] | [{Image src='attach/KRZ01/krz01-front-thumb.jpg' link='attach/KRZ01/krz01-front.jpg' caption='Front View (click to enlarge)' align='right' class='imgFloatRight'}]
| [{Image src='attach/KRZ01/krz01-iso2-thumb.jpg' link='attach/KRZ01/krz01-iso2.jpg' caption='Overall View (click to enlarge)' align='left' class='imgFloatLeft'}] | [{Image src='attach/KRZ01/krz01-bottom-thumb.jpg' link='attach/KRZ01/krz01-bottom.jpg' caption='Bottom View (click to enlarge)' align='right' class='imgFloatRight'}] 
%%


!! Features

The [Raspberry Pi Zero W|https://shop.pimoroni.com/products/raspberry-pi-zero-w] has all the features of the Zero plus Wifi and Bluetooth:

* BCM 2835 SOC @ 1GHz
* 1GHz
* 512MB of RAM
* On-board Wireless LAN - 2.4 GHz 802.11 b/g/n (BCM43438)
* On-board Bluetooth 4.1 + HS Low-energy (BLE) (BCM43438)
* micro-SD
* mini-HDMI
* micro-B USB for data
* micro-B USB for power
* CSI camera connector (needs adaptor cable)
* Unpopulated 40-pin GPIO connector (__requires soldering__)
* Compatible with existing  [pHAT/HAT add-ons|https://shop.pimoroni.com/search?q=&hPP=30&idx=shop.pimoroni.com.products&p=0&hFR%5Btags%5D%5B0%5D=Pi%20HATs%20%26%20Plates&hFR%5Bvendor%5D%5B0%5D=Pimoroni&type=product&is_v=1] 
* Dimensions: 65mm x 30mm x 5mm


The __[PiconZero|https://shop.pimoroni.com/products/picon-zero-intelligent-robotics-controller-for-raspberry-pi]__ board has the following features:

* [I²C|I2C] interface, leaving all GPIO pins free for your own use*
* 2 full H-Bridge motor drivers with full forward/reverse and speed control. Up to 1.5A continuous per channel (2A peak)
* 6 general purpose output channels (5V) that can be set as: Digital, PWM, Servo, WS2812( aka "Smart RGB" LEDs)
* 4 general purpose inputs (5V) that can be Digital, Analog, DS18B20 (digital temperature sensor)
* All inputs and outputs use 3-pin GVS connectors (Ground, Volts, Signal) - allowing 3-pin sensors, servos, etc. to plug straight in
* Dedicated socket for HC-SR04 ultrasonic sensor. Plug it straight in, or use jumper wires to mount it further away
* 5 GPIO signals, 5V, 3V and Ground brought out to a header
* Power for outputs can be from Raspberry Pi's 5V or from an external USB input line
* Power for motors can be from internal/external 5V, or from a separate power source (3V to 11V)
* Both motor terminals have 2-pin screw connectors AND 2-pin male headers to allow maximum flexibility in connecting
* Python library module making it super-easy to use any of the features

The controller board is supplied fully assembled. No soldering is required.


!! Bill of Materials

This is the base price of the robot without the servo or VL53L1X Time of Flight (ToF) Sensor.


|| Count || Item || Each || Total Price* || Vendor
| 1x | [Raspberry Pi Zero W w/headers|https://www.adafruit.com/product/3708] | US$14  | NZ$21 | AdaFruit
| 1x | [Picon Zero|https://shop.pimoroni.com/products/picon-zero-intelligent-robotics-controller-for-raspberry-pi] | £15.90 | NZ$31 | Pimoroni
| 2x | [Micro Gear Motor (Extended back shaft) - 298:1|https://shop.pimoroni.com/products/micro-metal-gearmotor-extended-back-shaft?variant=3073681089] | £5.10 | NZ$20 | Pimoroni |
| 1x | [Magnetic Encoder Pair Kit|https://shop.pimoroni.com/products/magnetic-encoder-pair-kit-for-micro-metal-gearmotors-12-cpr-2-7-18v-hpcb-compatible] | £9 | NZ$18 | Pimoroni |
| 1x | [Micro Metal Gearmotor Bracket (Pair)|https://shop.pimoroni.com/products/pimoroni-gearmotor-bracket-pair] | £3.90 | NZ$16 | Pimoroni |
| 1x | [Moon Buggy Wheels - Pair|https://shop.pimoroni.com/products/moon-buggy-wheels-pair] | £4.50 | NZ$9 | Pimoroni |
| 1x | [Mini Black HAT Hack3r – PCB only|https://shop.pimoroni.com/products/mini-black-hat-hack3r?variant=19448026119] | £4.50 | NZ$9 | Pimoroni |
| 2x | [Male 40-pin 2x20 HAT Header|https://shop.pimoroni.com/products/male-40-pin-2x20-hat-header?variant=10476117383] | £1 | NZ$2 | Pimoroni |
| 1x | [2x20 pin Female GPIO Header for Raspberry Pi - 11mm|https://shop.pimoroni.com/products/2x20-pin-gpio-header-for-raspberry-pi-2-b-a?variant=1132812269] | £2.10 | NZ$8.50 | Pimoroni |
| 1x | [Breakout Garden Mini (I2C)|https://shop.pimoroni.com/products/breakout-garden-mini-i2c] | £9.60 | NZ$19 | Pimoroni |
| 3x | [Sharp GP2Y0D810Z0F Digital Distance Sensor 2-10cm|https://www.adafruit.com/product/1927] | US$7.95 | NZ$37 | Adafruit |
| 1x | 3mm Delrin chassis, nuts and bolts | - | NZ$20 | Adafruit |
|| Base Total  |  |  || NZ$210.50 | 
| 1x | [VL53L1X Time of Flight (ToF) Sensor|https://shop.pimoroni.com/products/vl53l1x-breakout] | £14.40 | NZ$29 | Pimoroni |
| 1x | [Micro servo|https://www.adafruit.com/product/169] | US$5.95 | NZ$9 | Adafruit |
|| Extras Total  |  |  || NZ$248.50 | 

%%small
''* total price shown is total in New Zealand dollars for row''
%%

!! Build

[{Image src='attach/KRZ01/krz01-templates-thumb.jpg' link='attach/KRZ01/krz01-templates.jpg' caption='plastic templates (click to enlarge)' align='right' class='imgFloatRight'}]

The chassis is made out of 3mm Delrin plastic, sourced from MacPlas in Auckland. The various components were laid out on paper taped to the plastic, which was then cut (using a sabre saw with an "extra clean" wood blade) and the holes drilled. Stainless, black nylon, and aluminium spacers were used for connecting the boards and mounting the circuit boards. 

The trickiest part (by far) was soldering the ribbon cable to the tiny motor encoder board and then soldering that to the back of each motor, which themselves are extremely small, just 25mm long. It was pretty fiddly work, and getting the alignment of the board correct took a great deal of care and patience. A magnifier might come in handy. See the bottom view above.

If you don't plan to use the motor encoders, the motors are also available with an solderless connector, the [Micro Metal Gearmotor with Push Header Shim – 298:1|https://shop.pimoroni.com/products/micro-metal-gearmotor-with-motor-shim?variant=24169921671]. Using the motor encoders entails writing software to pay attention to the motor's rotation; this is called a [PID Controller]. 

Connections were made either with ribbon cable (soldered where necessary) or using header pins and "[jumper jerky|https://shop.pimoroni.com/products/jumper-jerky-junior?variant=1076482185]" solderless connections. 


!! Options

If you only want motor control, there's a cut-rate version of the Picon Zero people
called the [PicoCon|https://shop.4tronix.co.uk/products/4tronix-picocon-motor-robot-controller-for-raspberry-pi-kit] which sells for £5. Strictly speaking, the servo and ToF distance sensor are not required, so that could be skipped. The three infrared sensors (which come in 5cm, 10cm and 15cm ranges) could be replaced with piano wire bumpers using [lever switches|https://www.jaycar.co.nz/spdt-125v-3a-sub-miniature-micro-switch-with-lever/p/SM1036] that would cost several dollars.


!! Upgrades

As this uses a Breakout Garden it's easy to change the sensors to different I²C [Breakout Garden|https://shop.pimoroni.com/collections/breakout-garden] boards. If the Mini Black HAT Hack3r (holding the Pi, motor controller and Breakout Garden Mini) were moved a bit aft, there might be enough at the front to mount a [Pixy2 camera|https://pixycam.com/]. It's yet not clear that a Raspberry Pi Zero has enough processing power to work effectively with a Pixy2, so this will likely be implemented on the KR01 instead. Otherwise there's room up front for a common Pi camera if the servo is left off (or mount the camera on the servo!)


!! Notes, Known Questions and/or Issues

This robot uses 47mm "Moon Buggy" wheels and ball casters. The fore caster is mounted a bit higher than the aft caster, so (hopefully) it won't snag on things. Absent a bumper this is a possibility. The robot is fine on wood floors and low-pile carpets, and can navigate between them without incident. There's a Kilim rug in the lounge (owned by the cat) that has a 15mm edge which has proved impossible for the robot to surmount. It just pushes up against that edge and spins its wheels. 

This points out the fact that robot currently has no bumpers. I'm considering making a tiny version of the KR01's polycarbonate bumpers, or perhaps a pair of piano wire feelers. The robot is currently relying entirely on its infrared sensors. We'll see how this works out, but given it can hang up on the cat carpet perhaps a bumper is in order.

This was not a solderless project. As noted in the ''Build'' section, soldering ribbon cable to the motor encoder boards and then soldering them to the motors was quite tricky, not for the faint of heart. You can avoid this by avoiding the encoders and using the solderless version of the motors.

__1 May 2020 Update:__ the front ball caster seemed to get hung up sometimes when trying to transition from floor to carpet. David Anderson had cautioned against using a front caster in [his YouTube video|https://youtu.be/8CXReb7f0Eo], so this was hardly an unknown. Due to this issue the front caster has been removed, and the symmetry of the robot sacrificed a bit by moving the wheels forward about 1cm in order to set the balance aft. Even with this change of balance it's still possible for the robot to fall forward onto its nose. Some kind of curved skid to keep this from happening could be fitted, but currently the plan is to change this from a 2 wheeled to 4 Mecanum wheel robot, so no further changes to this design are expected.

 

----

[{Tag Robot RobotPrototype}]