Programming the Quadruped with Block Coding in PictoBlox

Description
Learn how to build and control the Quarky Quadruped robot using block coding in the PictoBlox coding education software. With PictoBlox, you can program the Quadruped to walk, dance, and do other cool moves!

Introduction

The Quarky Quadruped robot is a fourlegged robot inspired by spiders and capable of maintaining its balance while walking. It uses 8 servo motors and 2 degrees of freedom in each leg assembly to create different movements and maintain stability. This robot is simple to build yet powerful in exploration and stability!

The robot is programmable with PictoBlox. PictoBlox is coding education software that uses both graphical block-based coding and Python programming.

With PictoBlox, you can program the Quadruped to walk, dance, and do other cool moves! You can also create your own actions with special servo motors and servo oscillators.

If you haven’t installed PictoBlox, please follow the instructions:

Windows Installer (.exe)

STEP 1: Download the Pictoblox Installer (.exe) for Windows 7 and above (Release Notes).

STEP 2: Run the .exe file.

Some of the device gives the warning popup. You don’t have to worry, this software is harmless. Click on More info and then click on Run anyway.

STEP 3: Rest of the installation is straight forward, you can follow the popup and check on the option appropriate for your need.

 

Your software is now installed!

macOS Installer

STEP 1: Download the Pictoblox Installer (.dmg).

STEP 2: Run the .dmg file.

Mobile App Installer

STEP 1: Open Google Play Store on your Smartphone and and search for PictoBlox or visit the link here to head over to the Google Play Store. You can even scan the QR Code below from your Smartphone to head to the PictoBlox App.

STEP 2: Install the PictoBlox App.

Connecting Quarky with PictoBlox

Let’s begin by first connecting Quarky to PictoBlox. Select your preferred type of device i.e. either the desktop/laptop or your smartphone and follow the instructions.

Desktop

Follow the steps below for connecting Quarky to PictoBlox:

  1. First, connect Quarky to your laptop using a USB cable.
  2. Next, open PictoBlox on your desktop.
  3. After that, select Block as your coding environment.
  4. Then, click the Board button in the toolbar and select board as Quarky.
  5. Next, select the appropriate Serial port if the Quarky is connected via USB or the Bluetooth Port if you want to connect Quarky via Bluetooth and press Connect.
    COM Port
  6. Click on the Upload Firmware button. This will upload the latest firmware in Quarky.
    Note: If your device already has the latest firmware, then PictoBlox will show the message – Firmware is already updated. For learning more you can refer to this tutorial: https://ai.thestempedia.com/docs/quarky/quarky-toubleshooting/updating-quarky-firmaware-with-pictoblox/
  7. Once the firmware is uploaded, Quarky starts the Getting Started program. This runs only for the first time. Run through it.

And voila! Quarky is now connected to PictoBlox.

Mobile

Follow the steps below for connecting Quarky to PictoBlox:

  1. First, power ON Quarky.
  2. Open PictoBlox on your smartphone. Go to My Space and make a new project by clicking the ‘+(plus)’ button in the bottom-right corner.
    PictoBlox in Mobile Phone
  3. Then, tap the Board button in the top-right corner of the toolbar.
    PictoBlox BoardSelect board as Quarky.
  4. Next, tap the Connect button:
    PictoBlox ConnectSelect your device from the list.

And voila! Quarky is now connected to PictoBlox.

Quadruped Extension

The Quadruped extension in PictoBlox allows you to control the robot. It has blocks for specific applications. To add the Quadruped extension follow the instructions:

  1. Click on the Add Extension button and add the Quarky Quadruped extension.
  2. You can find the Quarky Quadruped blocks available in the project.

PictoBlox Blocks for Quadruped

The following blocks are available for the Quadruped:

The block initializes the quadruped robot and maps the 8 servos to the specified pins.
This block should be included every time you work with the quadruped as this block calibrates the angles of the servo motors and saves it in the memory of Quarky. Due to some mechanical assembly errors, there may be some misalignment of the servos which can be handled with this block.
The block performs the selected motion for the quadruped. The motion runs for the specified times and at the specified speed.
The block performs the selected action for the quadruped. The action runs for the specified times and at the specified speed.
The block sets the servo motors of the quadruped to the specified angles at the specified speed.
The block sets the selected servo motor angle to the specified angle in the specified time. This creates a smooth motion for the servo motor from the current angle to the specified angle.
The block set all the servo motors of the quadruped angles to 90.
The block sets the oscillator parameters for the selected servo motor.
The block resets the oscillator parameter for all the servo motors.
The block executes the oscillator according to stored parameters for the servo motor and the current time.
The block executes the oscillator according to stored parameters for the servo motor and the current angle specified in the block.
The block executes the oscillator for the complete cycle for the specified cycle times. The cycle time is the maximum time period assigned for the oscillator for the individual servo motors.
The block resets the timer running for the oscillator to 0.
The block reports the time passed from the reset for the oscillator.
All articles loaded
No more articles to load

Project: Making the Quadruped Walk

In this project, we will explain how to run predefined motions for the Quadruped.

In this project, we will explain how to run predefined motions for the Quadruped.

Quadruped Motions

The are eight predefined motions for Quarky in PictoBlox which can be accessed through do () motion () times at () speed block.

Code

Click on the green flag to run the motion sequence.

Controls

Using the do () motion () times at () speed block, we can control the number of times the motion has to be executed.

We can also control the speed of the motion.

If you want to perform the motion at a different speed, then you can use a variable to define the speed.

Explore: Try to create a square using the Quadruped motion block.
Table of Contents