Wednesday, September 20, 2023

Story: The Team

The Dutch Rescue Team consists of 5 members living spread over The Netherlands, all being autonomous robot hobbyists.

Skills

Our combined skills:

  • mechanical
  • electronics
  • 3D print design
  • robotics
  • programming

Per team member, per skill, the experience varies both in time (0 to +20 years) and level (novice to expert). As mentioned in the previous blog, none of us has OpenCV skills, but we’re all eager to acquire those. Further we have many knowledgeable contacts in The Netherlands and Belgium able and willing to advise us and review our designs.

Team is so abstract ...

You will probably not see all our faces online, but if admitted all five of us will be present at Pi Wars 2024 to get to know many other attendees.

A few of us during an online meeting on Pi Wars.

 



Other facts

  • We’re not living close to each other.
  • Physical meetings will be limited to approximately once per month.
  • Where online meetings are more frequent.
  • Every team member has the option to build the DRT robot to own.
  • As a result, 3 the same robots are built with the same components and will be running the same code.
  • Having the three robot instances also increases testing capacity.
  • Most coding and testing will be done at home.
  • Our physical meetings are mostly used for discussions, demo and diagnosing together.

Story: The Zombie Apocalypse - Shoot the undead!

 Aim of the challenge

Zombies have taken over the Pi Wars Tower! It is up to you to rid the building of the "differently mortal".

Shoot all the zombies in the Tower and save the inhabitants. The targets will be at a number of different levels and you must use projectiles as your "anti-zombie device" to knock them over.


What a fun challenge!

Always wanted to hack an automated shooting turret, so this is the perfect opportunity to do so. It’s still a bit unknown how the exact challenge will look like, but somehow we need to shoot the undead…


The arena

Targets:

  • Targets will be no smaller than a standard playing card 62mm wide by 88mm length

Shooting rounds:

  • 3 rounds
  • every round 5 shots
  • 5 minutes maximum


Shooting methods

Using nerf darts was unanimously chosen as our favorite way of shooting projectiles. But what options do you have for shooting nerf darts?

Watching previous versions of Pi-Wars and doing some research on internet, we identified three different ways of shooting nerf darts:


Although assuming compressed air might be the best option, creating compressed air is not the most easy one to accomplish. There are also ways for shooting with the pre-tensioned springs. But might be less optimal than spinning motors. So spinning motors will be our favorite way.


Proof of Concept (POC1)

After some tinkering, a first proof of pudding was created. It is a mobile shooting device, which has 2 spinners and a trigger mechanism and 3d printed 5-darts-magazine. It shoots quite far, at least over 15 meters, which is not really needed.

User acceptance test

Okay, our little secret is our test team. Here we did a shooting test, shooting darts in the garden. It was an obvious hit!


First shooting series




First performance test

Without going into too much detail today, first impressions of precision seem hopeful…


There are (ofcourse) still some minor issues to be solved, which might be a subject in another post.

To be continued…

Story: A real time controller

 To compete in Pi Wars, we think it would be good to have a differential drive robot that could move around predictably, based on odometry. So, we have two motors to control and feedback from the motor encoders to process. 

The motor encoders quadrature output which are estimated to have an output frequency of 1.5 kHz at top speed. 1500 Hz, two edges per period, two encoders, two pins per encoder are 6000 edges to track every second.

We were not sure how to do this on Raspberry Pi. Can this even be done reliably and if so, how much time and effort do we need to spend on this? Time and effort that can’t be spent on Pi Wars challenges itself and on OpenCV – our tool of choice for our main sensor (the camera) which is also new to us.

So, we decided to have a separate controller to move the robot around. We’ve made robots with motors and encoders before, so we knew it can be done, what it takes and even have code available to give us a head start. As additional advantage, two controllers (the Raspberry PI – our main controller- and the Realtime controller) creates modularity and enables us to splits tasks between team members.

Downside of this the robot will be larger due to the second controller. And the functionality (code) will be split between two modules (which could be a blessing or a curse, depending on the issue at hand).

The modules are coupled by a serial link with, for now, text-based commands sent by the Raspberry Pi and framed responses (along with lots of unstructured logging) sent by the Realtime controller. 

Realtime computing

From Wikipedia:

Real-time computing (RTC) is the computer science term for hardware and software systems subject to a "real-time constraint", for example from event to system response. Real-time programs must guarantee response within specified time constraints, often referred to as "deadlines".[1]

For this, our Realtime controller has a main loop that runs every 20ms to read the encoders and update the robot position estimate of the robot. This updated estimate is reported to the Raspberry Pi and used by the active ‘driver’ as feedback, to calculate the proper steering (pwm) signal for each motor.

Other actions in the main loop include processing of commands from the Raspberry Pi. This could be forementioned driver-commands of update of the servo-outputs, which are generated in the background.

And if additional sensors are required, they will probably be connected to the Realtime controller and read in the main loop.

And all those encoder edges? They are decoded with no overhead by two hardware counters of the microcontroller. So reading the encoders is basically get the counters and calculate the difference since the previous time.


 Implementation

The Realtime controller is based on a PCB, created with KiCad and manufactured by one of the big Chinese PCB-manufacturers. On this PCB are modules available from the well-known Chinese resellers. 

We’ve considered the Raspberry pi Pico as the microcontroller for the Realtime controller but chose an STM32F411 we’ve used on a similar robot, since we expected less risk of errors on the design and less issues with the software. 

And with regard to that risk: it turned out we had two pins swapped on the PCB, which could be fixed with one wire as long as we don’t use IR remote control.

Although they worked on another robot, we had quite an issue both the encoders. Both timer2 and timer4 did not count the encoder pulses from the motors. It took three long nights to track down what caused this: IO configuration values of the were swapped, and the 0x22 marked red should have been 0x11, while in another register, 0x11 should have been 0x22. Small but hard-to-find errors…



The software is compiled with the Arduino IDE (v1.8.19) and the ‘STM32 MCU based boards’ from STMicroelectronics. This is easy to configure and use. Instead of the basic Arduino IDE editor, an external editor with more advanced features for search and project/file management is used to write the software.

The only other external library used is the PID library of Brett Beauregard [2].

The source code is in a private repository on GitHub. We intend to make it public later this year, once we’ve thoroughly tested it.

In a future blog, we’ll go into more detail of our driver software and some of the supporting modules we’ve created for the Realtime controller. For now, we conclude with the block diagram of the motor control software (including the PID controllers).


[1] https://en.wikipedia.org/wiki/Real-time_computing

[2] https://github.com/br3ttb/Arduino-PID-Library

Raspberry Pie... (July 2023 and a bit of August)

This month

This month a lot of time was spent and progress made on our journey towards Pi Wars 2024. Many small discussions and tests and some major achievements. First, we will provide an overview, followed by some more in-depth stories on specific topics.

We had our kick-off meeting on the last day of June and the day after, one team member withdrew from the team because he didn’t feel the team was a good fit for him. A few days later another person applied and joined the team. Some more on the team in one of the stories below.

During the month we had many discussions on our DRT discord server, about things like:

  • Communication protocol between Raspberry Pi and other controllers.
  • Sourcing of first components.
  • Maintaining a parts list.
  • Motor mounting plates and wheels:
    • Allowing to reach the screws of the motor mounting plates.
    • Allowing to attach bigger wheels for the obstacle course. 


 

  • First prototype nerf gun.
  • First prototype barrel gripper.
  • Lava Palava requirements, resulting in using the camera as main ‘sensor’.
  • Configuration management and having our bespoke Raspberry Pi image.

Within this month the DRT Realtime Controller PCB has gone from initial design, via review (including outside the team), ordering from China, and putting on the components, to our first working prototype. More on this topic in the story below.


We met three times online for general alignment and on August 5 we had our second physical meeting, where we discussed:

  • The initial ideas on configuration management, including the DRT specific sd card image for our Raspberry Pi-s.
  • Barrel grippers
    • A ‘stock’ barrel gripper robot ...

    • First round of other barrel gripper prototypes ...

  • Different git repos
    • One with everything that will be loaded on the raspberry pi.
    • Another one with the rest.
  • Serial communication protocol to use between the Pi and extensions.
  • High level component wiring for power and communication
    • Realtime controller provides power to Pi and extensions.
    • Pi has serial communication with Realtime controller and extensions.
  • some naming conventions
    • Single word name per challenge.
    • Standard names for realtime controller instance and nerf gun instance.
    • Namespaces for libraries used.
  • First prototype of our base robot, including:
    • The motor mounting plates ...
    • The wheels ...
    • The first prototype of the DRT Realtime Controller ... 
    •  

       


  • First nerf gun prototype ... – More in the story below !!!




  • We went over all challenges (again),
    • resulting in base robot containing:
      • Raspberry Pi 4
      • Battery
      • Realtime controller
      • Raspberry Pi Camera 3 Wide
    • and required extensions:
      • Barrel gripper
      • Nerf gun
  • And off course Raspberry Pie ...


Saturday, September 9, 2023

We want to go far ... (June 2023)

This blog has been created to share the journey of some autonomous robot hobbyists towards Pi Wars 2024.

June 1

June 1, 2023 the return of Pi Wars was announced: Pi Wars 2024 - Disaster Zone


June 4

So, on June 4 a call was sent out on a mailing list to find robot enthusiasts who wanted to be part of a team for Pi Wars 2024...


June 7

On June 7 we had a team covering the following skills:

  • mechanical
  • electronics
  • 3D print design
  • robotics
  • programming

Note that blogging is not one of our skills 😉.

 

June 9

Where the initial team communication was done using e-mail, we started using a Miro board (https://miro.com/) for online brainstorming on June 9.

 

June 10 to 12

From June 10 to 12, using mail we discussed topics like our motivations for participating, which challenges to participate in, tools to use, and of course a team name.

Why do we want to participate?

  • have lots of fun
  • have a great weekend with like-minded people in the UK
  • learn new skills
    • Even though no one has experience with OpenCV, it is on everyone's to-do list.
  • satisfaction

Initial tool selection

Team name

Dutch Rescue Team


June 14

June 14, we had our first online meeting.

Lots of things to share our initial thoughts on, like:

  • Pi Wars 2024 entry
  • mutual expectations
  • how many robots will we build?
  • motor type
  • raspberry
  • batteries
  • wheel diameter
  • lidar type
  • camera type (global shutter?, 360 degree?)
  • OpenCV
  • nerf gun
  • Git / GitHub usage

June 15 to 29

From June 15 to 29, we brainstormed and kept diverging in discord and on our Miro board.

Resulting in many ideas and notes on our Miro board:


Ideas for storing barrels for the Eco Challenge:

 






 

Possible grippers for the Eco Challenge



Testing barrel detection using a lidar:

The situation:


The lidar view of the barrels:


A quick speed / accuracy test with an existing robot:

Speed 1600 mm/s and return accuracy < 10 mm!






Ideas on chassis layout and overall structure:







June 30

The Kick-off our first physical meeting on June 30.

Goals of the kick-off meeting

After weeks of brainstorming and divergence it was time to meet and make a first attempt at some convergence....

The primary goal:

  • Define our base robot at a high level.

Secondary goals:

  • Agree on programming languages.
  • Agree what documentation will be created.
  • Agree on documentation formats.
  • Define other work packages to start with.

Work packages

In preparation for this meeting, we defined that we will be working with what we call ‘work packages’ as more or less independent executed development parts, with a scope and an accountable team member.

How to define the Base Robot

In preparation for this meeting, we also defined the process to follow during the meeting to get to the high level definition of our Base Robot.


  • Which categories will we compete in?
    • Challenges run autonomously.
    • Challenges by remote control.
    • Pre-competition blogging challenge.
  • For each challenge define both the Minimal Viable Solution and possible Target Solution(s).
    • For each possible solution:
    • The required sensors.
    • Required extensions.
      • Consider power requirements for the extension.
    • Possibly required proofs of concept / technology.
  • Define wheel layout and powertrain.
  • Modules making up the base robot.
  • Microcontrollers and single-board computers to use.
  • Additional not required sensors to enhance the base capabilities (e.g. additional ToF sensors)
  • Resulting in high level design:
    • Wheel layout and powertrain.
    • Sensor list and position.
    • Communication technologies / protocols to use between different modules and extensions.
    • Power supply.

 Which challenges will we take on?

Although we’re all passionate about autonomous robotics, we decided to also participate in the other challenges, because of the fun. So, we decided to participate in:

  • Autonomous
  • Remote control
  • Blogging

Initial work packages

The work packages we assigned during our kick-off meeting:

  • Base Robot
  • Nerf Gun
  • Blogging
  • Pi Wars application

Possible extensions

  • 360 camera
  • speaker
  • led lights
  • nerf dart shooter
  • gripper and storage for barrels

Possible other work packages

  • Test courses
  • Prototype 360 camera
  • Color recognition
  • Zombie recognition
  • Remote control

Work package: Base Robot

Scope

  • Chassis
  • Battery
  • Wheels
  • Motors
  • Realtime Controller
  • API over serial

Elements

  • Two wheels on a rigid frame
  • One motor per wheel
    • 24V motors
  • Space for a 6S battery
  • Raspberry Pi 4
    • Only mounting and accessibility of the ports
    • Further as a black box for this work package
  • Camera
    • Raspberry Pi Camera 3 – Wide
  • Definition front: the camera looks forward
  • Per challenge one or more extensions can be attached
    • E.g. beam with additional wheel(s)
    • E.g. nerf gun

Work package: Nerf Gun

Scope

  • Meant for The Zombie Apocalypse
  • Has to be able to shoot nerf darts
  • Possibly a laser to help aiming
  • Controlled from the main controller (RPi), that decides based on camera images what the extension should do
  • API
  • Not: Code RPi

Work package: Blogging

Scope

  • Write and publish blogs

Work package: Pi Wars Application

Scope

  • Take care of application
    • As promising as possible; see organizational assessment aspects

The end of a fruitful day








The Finale - Sunday, 21st April 2024

 Wow What an event this Pi Wars is, being inspiring for all participants. On Saturday we saw many young people transforming from being anxi...