LEO: An Indoor, Omni-directional Robot

And a cheeky video of LEO in action:

Initial Idea

Leo is an indoor robot platform that I have been planning for a while now and my fabacademy project will be the first step towards it by building the chassis for it. LEO will be a platform to build and test home-assistant and robotics related projects to keep my mechatronics skills fresh. I do not know how far it will progress under Fabacademy, but some examples of low-hanging fruit tasks it may be able to complete in the near future are climate monitoring of all the rooms in a house (and maybe talking to electric windows to control temperature) and utilising a camera to autonomously navigate and monitor the house.

Chassis Design Phase and CAD

I started this project by CAD-ing out as much as I can at this phase to get an idea of how this project will look and feel. I have an indepth of this whole modelling process in my week 2 assignment. Modelling this was quite easy as it is symetrical and all 4 of the arms can be made from the same pieces.

The arms themselves consist of 2 identical printed parts that connect to a motor mounting plate. These arms will form a parallelogram that will keep the motor mounting plate always perfectly vertical and parallel. This will be important for the mecanum wheels which will need to be kept vertical straight in order to roll smoothly.

At this stage I did not know what motor, mecanum wheel or even method of connecting the two I would use, so I opted to leave this in a "mock-up" state to come back to later when I could better assess it.

As the model was parametric and built on variables, I went through a process of refining the design, larger mounting plates, shorter arms, just playing around with it till I was happy with all the dimensions. After which I added some primitive joints so that I could move it around and see what it would look like in action.

Manufacturing the Body and Suspension Arms

With a nearly finished 3D model of the chassis that was designed to be highly printable, it was an easy process to get it manufactured. The only modifications required before printing was to add clearances between parts to allow them a proper fit and tolerances. To do this, I went along and added a 0.3 mm gap to anything that I wanted to slide freely, and a 0.2 mm gap for anything to fit somewhat snugly.

I printed all of these on my slow-but-reliable Prusa Mk2 with PLA. Ideally I would like to use PETG, I think it has better mechanical properties and isn't much more difficult to print with, but I had a large stash of PLA that I needed to get rid of. If anyone is to reproduce this robot, I would reccomend PETG.

And after about a week of printing, I had the majority of my chassis printed up. The design for this assembly is extremely simple and everything is held together exactly as you it looks with 16x 130mm M6 bolts.

Drivetrain Design and Assembly

This robot is quite heavy, and its final weight comes in at about 7.5 kg. With the robot also needing to be snappy and responsive, quite large motors would need to be used. Large motors are expensive, but fortnutely I had some of these Polulu 37D motors lying around that should provide plenty enough torque.

I also finalised the wheel assemblies and opted for a shaft which a mecanum wheel would freely spin on, and a series of gears to connect the wheel to the motor shaft. The mounting plate I originally designed in illustrator, but I remodelled it here to visually see it in 3d space. I didn't properly model them as I did not have a model for the wheel, nor know the gear ratio yet, but here is what it will look like:

The outter house of this that holds the shaft was also split into 2 section. By having it split into 2 pieces, the lower section (the pinkish colour in the image above) could be attatched and hold the wheel assembly together and still allow access to the drivetrain for maintanence. This is one of the many design considerations made to help maximise the servicability and ease of assembly of this project. I drilled out, the centre of the wheel to be slightly larger than the 6mm rod it would mount to, then I designed and printed some gears that would glue to the sides of the wheel and allow it freely spin on some bearings that press-fit in.

And with that, the most complex assembly of the project comes together. This setup is far from perfect and suffers from a few issues - the mounting plate is too small to mount with 4 bolts, the m4 bolts that hold the mounting plate are easy to thread (I should use heated inserts here), and the shaft is made of wooden dowel (my bearings were much smaller than 6mm and sanding down wood was the easiest way to get a 5.75 mm rod). However, for the sake of testing it works just fine and after a little bit of abuse and use, it seems to be holding together just fine. I may not even revise this for Fabacdemy unless it gives me major issues.

Motor Driver Assembly and Milled Breakout Board

To drive the motors, I used these inexpensive 2-channel motor drivers which are great for upto 24v and 7a of power, plenty of headroom for the 37d motors. However, with this set up, each motor will need:

As we are fitting a Pico for a specific task and we have a specific use for it and its pins, its a good opportunity to mill a PCB for it. The motor encoders need a 4 pin connector, and the motor drivers needed 4 pins per motor (when using 2 motors a board), so I broke the Pico out into a series of 4 pin connectors.

And I went ahead and milled and soldered this board, I go into depth on that process in week8. With the hindsight of finishing this project, having this breakout board has saved me far more time throughout the course of making this project, than it took to make the board.

And at this point I could go ahead and wire it all up. The headers coming from the milled board could easily be plugged into the encoders and motor driver headers in lots of 4s without having to cross any wires. The motor's encoders go into the Pico and take power from the driver, and the driver plugs into the pico for control signals and takes power from a Lipo. Here is a crude diagram of what that looks like because its messy in real life:

Controlling the Motors

We are now at the point where much of the systems are built and we need to start integrating so I will be applying incremental integration more and more now - a process where you get a small chunk of something working in isolation, then integrate it into the project so far, and repeat that. I started building the entire project up from this point of getting the motors going, its the seed which everything will grow. In inputs week and outputs week, I go into depth of how I got this entire wheel system going, but here is a summary of it:

First I got encoders reading the wheel speeds with interrupts, and I got the motor controllers driving the wheels - both independantly.

Then I implemented a PID controller to measure the speed of the motor and regulate it to a target RPM with the motor controller. This is how we are going to offset having 2 different motors with different voltages and max speeds. We will be limited to a maximum RPM of about 220 though (which is the slower of the 2 motors). This could be fixed by changing the gearing of the slower motors, but for now we will keep it as it should result in about a 5 kmh top speed which is plenty enough.

Leg / suspension arm actuation

This was one of the parts that I was dreading, the suspension arm was the most difficult part of this whole project and the one I was most unsure about. I settled on a design where some paracord would pull on one axis of the suspension and keep the robot's body up, but then a pair of servos would rotate a pulley, and the pulley would tug on the other axis of the suspension to lower it. I designed some pulleys to attatch to the servos, and set an apropriately tight set of paracord - just enough to keep the body up.

To control all 8 servos, I used another Pico and soldered up a breakout board for it with some protoboard. This made the connections extremely easy and clean, not having power and signal wires going everywhere. Each one of these servos needed about 3.5a maximum, multiply that by 8 and you have a 30 amp maximum power requirement. I searched for a suitable voltage regulator to step down the 12v or 24v lipos (the servos needed 5v-8v), but I couldn't find a viable solution. So instead I added a 5th battery to this project (12v lipo, 24v lipo, 2x 5v battery banks for the picos and Rpi, and now this 2 cell for the servos). And this worked out perfectly fine and was far more cost effective. I also used this as an opportunity to start connecting the boards via UART, and in the image below you can also see some headers that I use to connect the 2 picos to a long 3 wire lead which will connect to the Pi 4. The ground wire can be disconnected incase the setup changes and a ground loop is formed.

This was getting into the more dire stages of the project and I didn't get footage of it working at this point, but here is some footage from a later stage in the project of the leg actuating.

Pi 4 Control

Many of the things I wish to add to this project will require processing power that isn't possible on an embedded microcontroller, so we will be adding a Raspberry Pi 4 to the project and getting it to control both the motor and leg picos via UART. So I grabbed my Pi, installed Pi OS, mounted it to the touch screen, powered it off a 5v battery bank and plugged in the UART coming from the servo pico protoboard.

You can find the code at the full code at the bottom but here is a breakdown of how they interact:

  1. Pi 4 detects keyboard strokes.
  2. Pi 4 turns keyboard strokes into meccanum wheel target RPMs or target servo angle.
  3. Pi 4 sends message to both Picos via UART with a device address as a part of the message.
  4. Each pico listens for their adress and will take that new target and regulate their hardware to that new target.

Making the Top Cover and Bringing it all Together.

Right now the Pi 4 and Lipos are resting ontop of the robot and we need something to mount the screen and hide the rat's nest of electronics so Neil doesn't see my handywork. So I went back to my CAD model in onshape and designed a top cover. This cover will mount the Pi 4 in the front, and I littered it with holes on the top to allow me to mount anything I want in the future, and it has these larger holes on the side to poke through ultrasonic sensors, or anything really. And this can either just sit on the top, or be mounted to the 2020 extrusions with the side moutning holes.

And then I went through and cut it out on our trotec laser cutter following the same steps in week 3. And this all assembled very nicely. And gave me space to mount the batteries inside here. But at this time things were getting dire time-wise so this box was just hot glued together which actually turned out a lot better than I thought it would be.
And after mounting it on the 2020, in addition with those pants, this helped clean up, package and hide most of the wiring. And that was the core lot of the project finished!

Conclusion

At this point in the project it was about 10 hours before my presentation. I had a robot that could drive around like a glorified RC car, it had an onboard computer running, it could drive in all direction,had some form of leg actuation, and had been designed to be upgradable and have other projects mounted on it in the future - so I decided to call it. I made my video and my slides and submitted it.

The Good

Overall I was very happy with this project, I had done many of these skills / systems of this project in isolation and it was the first time integrating it all together into a project of this scale. Much of the focus I put into making this easy to assemble and work on really paid off - especially those breakout boards I made for the Picos. I had to rewire those sections dozens of times and those boards made it fast and very difficult to wire inccorectly. I was also happy with the gearings I chose, at full speed it moves slightly faster than walking speed, and its snappy and responsive enough to instantly go from full forward to full reverse. Having a touchscreen and an onboard computer also made developing this thing a breeze and its a strong candidate to have one on all my projects from now on. I also feel like I did system integration really well here. I have never taken incremental integration this seriously and it paid off as I didn't have the normal amount of headaches that I encounter.

The Bad

There were not too many bad things in this, moreso things that I would redo in the future. The biggest thing would be how the gears were attatched to the motor shaft. I have had many issues with those 6mm mounting hubs, the grub screws strip too easy and the motor will just spin in the gear. I ended up printing some adapters that were wayy too small and hammering them onto it which fixed it for a few running hours. The other part htat could be improved were the mounting plates, they were too small and didn't allow enough screws for mounting. The mounting for the servos on the arms were also a little dodgey, they were just hotglued on and some proper fasteners here would help.

The Ugly

The only ugly thing about this project is that the legs didn't actuate in the end. Half way through, I got them first working and it seemed like it would work. However, once the batteries and touch screen, and everything in the top enclosure were added the robot became much heavier. The suspension wasn't tight enough and it would sit on its belly and I had to tighten the paracord to stop it from drooping, and the servos weren't powerful enough to counter this tighter paracord. This was going to be my main way of adding personality to the robot and its a bit of a shame that it didn't turn out. You can see in the presentation video at the top though that it sort of moves a little bit. The way to fix this would be to either find a better way to add spring to the suspension, or to reduce the diameter of the pulleys as the servos were only rotating halfway (you could half the diameter).

But overall, I was very happy with this project, it tested a few skills that I was rusty on, introduced some new ones, and allowed me to tackle a project of this scale. And now I have a really cool robotics platform to do things with.

Files

All of LEO's Code
All 2d and 3d files Milled Board KiCad Project and SVGs

License

LEO © 2024 by Jaryd Giesen is licensed under CC BY 4.0