A simple robot-toy for my cats
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
leon_stl.zip3D models needed to build LeOnapplication/x-zip-compressed - 634.86 kB - 12/08/2023 at 21:52 |
|
I'm developing a mechanical framework for my robotic projects. It is called simpleR. I would like to make in the way suitable for robotic prototyping and education. For the research purposes, I've decided to reimplement LeOn in my new framework, developing two projects at the same time and hoping for the synergy effect. Let's see how it goes 🙂
Separation of the Software (independent of the hardware logic) and the Firmware (dependent on the hardware) has allowed me to implement the main robot logic on Windows without involving MCUs at all.
I packed all the code in a set of CMake projects producing static libraries. Including main.cpp - it is also a component. Then I assemble everything into an executable file - currently for the Windows platform. It can be called a Windows robot simulator:
The next step is to implement the driver part and then connect them together.
Quick QnA:
Source Code: https://github.com/an-dr/LeOn/tree/7c41b8b35d2450aba1adc6544145845a02f9a0eb/software/main_controller
Initially I wanted to implement interfaces as simple header files, but after reading articles from Jacob Beningo (e.g. https://www.beningo.com/how-to-write-epic-hardware-abstraction-layers-hal-in-c/) I’ve decided to go with abstract classes and structures with function pointers. This allows me to pack the interface as separate components, decoupling other components even more. The result is on the updated component diagram:
More details are in the repository: https://github.com/an-dr/LeOn/blob/e0b4142b7202b88d46830cca5cbb5a7b23a262a4/docs/architecture-arc42.md#building-block-view---software
P.S. It’s incredibly sad, that GitHub still does not support Plant UML rendering. C'mon, GitHub!
P.P.S. Yes, I’m not coding still. Maybe, if you do the right architecture, you don’t code 🤔?
Here are the main mechanical modules that I developed to test my implementation when it is ready. They may look simple, but practically work 🙂
I took a favorite toy of my cat - a piece of filament for 3D printers.
Transportation System
The Transportation System is based on two the cheapest possible step motors
Before coding, let’s decide on the Software Architecture. Based on my previous decision, I’m going to have two main parts:
Each part will have a high-level and a low-level logic. I will use two terms, movement - for transportation in space, and motion - for any other physical activities. In total, we will have:
To break the direct dependency, Controller→Driver let’s use a Hardware Abstraction Layer Interface, so we will have a dependency on a stable interface rather than on a driver that can be changed in the future:
Controller→HAL←Driver
By doing so, we isolate the high-level logic of hardware changes.
Let's introduce two more terms:
The resulting architecture looks this way:
The next steps will be:
Meanwhile, I’m preparing a simple prototype, since my architecture already has enough information for hardware steps.
I'm going to go cheap 28BYJ-48 stepper motors and probably a DC motor for the cat toy. When it is done, I would like to port it to a different hardware and verify that my architecture does not require any changes, something like this:
And the last thing that we will need before start building a real thing. The logic.
The overall robot algorithm is the following:
The interaction between the robot components is described in the following sequence diagram:
Next time, finally, assembly of the first prototype and coding! We will add the other architectural details as we work.
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates
About Us Contact Hackaday.io Give Feedback Terms of Use Privacy Policy Hackaday API Do not sell or share my personal information