Monday, November 13, 2023

Nerf Gun Platform - PiWars 2024

      In a team, items come along all the time and if you're writing the blog then either you leave a mountain of things to add, or just publish them there and then. 

     Some things just get decided as the obvious way to go so building a platform for aiming and firing a Nerf gun just seemed the sensible thing to do for the Zombie Apocalypse challenge, though there'll be a blog analysis of it along soon.

Mounted on the rear lid of the chassis, the arm is rather overkill to support a Nerf gun, but it has it's origins in one cooked earlier for a drawing robot arm, so easier than developing a whole new arm. The servos are AX12 serial servos controlled via the official Dynamixel USB controller by a Pi Zero, which can be just seen mounted under the arm, with camera for aiming. The gun connector is a Picatinny rail, Nerf fans will appreciate that.

The heart of the arm is this bearing. It weighs 220gms just on its own without the rest of the arm, but gives superb glitch-free smooth rotation with any weight, even unbalanced.

The whole truck now weighs 2Kg, but it still drives OK

The Nerf gun we are intending to use is a Nerf Stryfe which may not be available in shops any longer, but we have one because we like playing with things. NOTE: this is different to many of the newer versions of the electric Nerf guns in that it is screwed together and so can be disassembled easily, some of  the newer ones are glued together so much more easily damaged when being taken apart, possibly a job for a Dremel if using one.

The following pictures are of the gun mechanism.

Electric motors spin up flywheels just before the barrel of the gun and after the Nerf dart magazine. 

Once the flywheels are up to speed, the trigger is pulled and a mechanism pushes a dart forwards from the magazine, see the arrow in the picture above, until it is caught by the spinning flywheels which catch hold of it and accelerate the dart out of the gun barrel. The flywheel motors are designed to be run by four 1.5V alkaline batteries (about 15Wh) and are normally expected to not last long, but powering them from the vehicle batteries (31Wh) is expected to be ok for the challenge. 
A test cradle has been designed to hold the active portion of the Nerf gun and dart magazine to facilitate fitting to the aiming mechanism.

Out of the box, these foam dart guns have a surprising range and accurate over short distances so are worth the effort to modify. In the unmodified versions, the flywheels are only powered when a trigger switch is pulled, connecting the batteries, so are unlikely to be operated for long periods of time, this is an area which needs to be understood in order to ensure the reliability of the mechanism and prevent overheating. Of course, if the mechanism is going to be modded, increasing the voltage, and thus the speed of the flywheels, might increase the accuracy, something to experiment with. The mechanism also has a variety of interlocks to prevent operation when the gun is not complete, all of which will need to be removed or bypassed.

So, on with the fun, though it might be a bit longer before the next blog post!!!!

Saturday, November 11, 2023

Chassis development - PiWars 2024

 So we needed a chassis and while we had previous skeleton chassis we could have gone back to, one of us has been developing a more substantial bit of kit.

It started out as a four wheel drive 'tonka toy' with big rubber tyres that can handle uneven surfaces. As originally made, it looked a bit blank in lemon yellow, but a bit of paint for windows and a load to carry it looked a bit better. The chassis is in two halves, articulated in the middle, around a central battery holder for three 18650 LiPo's in series. 


The video shows a basic try-out though not very exciting. The remote control is via a helicopter RC and converted from SBUS via a Pico PIO program, code on github here EastDevonPirates2024. The voltage display on the rear, as well as an obvious on/off switch, are very useful.



But never quite happy, it wasn't really up to our PiWars 2024 standard,  so it's been remodelled. The wheels are much smaller to accommodate PiWars chassis size rules, they may change yet again but these are the working wheels for now.


Gone are the flashy headlights and a new detachable bonnet fitted to cover the remodelled battery box. 



We haven't remodelled the wiring yet, but we do have a flashy invisibility cloak (lid) so you can't see them!!! As well as being a lid, that will also be a platform for attachments, more on those in later blogs.


All that's in there right now is a Pico and an RC receiver. Independent FIT0441 brushless motors on each wheel with built in motor controllers and pulse counting for rotation sensing provide the driving force.

Fans of this look can get the stl files from github.




Thursday, November 9, 2023

Escape Route - PiWars 2024

    This challenge is a zig zag course through coloured barriers described here Escape Route – Pi Wars.

    It's described as a maze but really there aren't any alternative routes other than to the end so it isn't really. The picture above is a mock up just to test general algorithms of following a similar course made of blocks that just happened to be made up for our robot workshop this year. The course can be run up to three times in five minutes with points for each run and fastest run.

    There are three methods allowed, fully autonomous, which I'm certain we'll be aiming at (a basic video of this in a later blog), blind remote control (with again a video later) and remote control with relayed commands, where the 'driver' can't see the robot or route and has the necessary directions given to them by someone else who can, and 'call and response', where the robot is remote controlled by a person being given instructions from a second person, only the second person being able to see the course and robot position.

    Autonomous is what it is, but for remote control then the communications must be rock solid in what will otherwise be a very noisy environment electrically. This may also adversely affect the video link which most likely will be over wi-fi. As the remote control and 'call and response' both require good communications be essential for control, using a dedicated RC system or a Bluetooth controller might be the best option. Video streaming over Wi-Fi is well supported, but if not practical or reliable on the day, then at least the RC will be. Video is the described navigation choice for 'Remote Control', but a feed of data from, say, a collision detector might help enormously.

    From a points perspective, completing the run scores 200 each time, or 600 for 3 completions. Not touching the walls scores an additional 100 points per run, so 900 in total for thee clean runs. For just taking on the course autonomously, 350 points are awarded, so even if your robot isn't up to it, entering autonomously and just crashing without completing any runs should be fine for some points!!! Remote control entrants get 250 points extra and 'call and response' entrants an extra 100 points. There are no points penalties for crashing/recovery etc, but the fastest robots are awarded points based on the formula system described here Formula Scoring System – Pi Wars. Thus, three clean complete runs autonomously scores 1250 with a potential extra 150 for fastest meaning a total of 1400 available. Competently doing call and response will earn a team 1000 points, plus any formula points for speed, but at least 70%. Getting this right means that a robot can do very well and any attempt at autonomous operation or 'remote control' could be abandoned closer to the day with good results. 

    There are coloured walls, but their colour won't be of much use to a robot unless someone is determined to be fastest. As with lava palaver, a fixed set of navigation routines could be coded to do the basic steering with additional collision avoidance added. A basic routine set might be:

  • Drive_forward_until_wall_10cm_away
  • Turn_90degrees_Right 
  • Drive_forward_until_wall_10cm_away
  • Turn_90degrees_Right
  • Drive_forward_until_wall_10cm_away
  • Turn_90degrees_Left
  • Drive_forward_until_wall_10cm_away 
  • Turn_90degrees_Left
  • Drive_forward_until_wall_10cm_away
  • Turn_90degrees_Right
  • Drive_forward _until_wall_10cm_away  (a hand placed in front when collecting robot at end)
  • Stop
This would give the following route.


    Driving forward in a straight line might be the bigger challenge, and putting a limit at 10cm is just an example guess, any robot needs to be tested to verify it's turning capability and as the measurements of the course are known, the turning trigger distance might be much more on horizontal runs. This is also reliant on dead reckoning but the course isn't complex so fine tuning a robots steering should get close.

    The above might get  a reliable result, but to get the fastest time will require a more irregular route. The obstacles on the course have a different width as well as colour, so a determined robot could steer a course based on knowing and using this information, as well as using some additional wall following sensors, possibly already installed for lava palaver.


    Only a team can decide how much they want to be fastest, but getting the basics right will do very well and this example route above might be close to the route of the fastest robot and 1400 points. Getting the scripted run right would be 1250 points, almost 90% of the max.

    Finally, a robot recording it's successful runs could replay them at a faster pace to get that extra speed and points. 

    So now there's a few routines to write and videos to make, as well as looking at the Minesweeper challenge.