ZeroBug: From Simulation To Smooth Walking

Thanks to 3D printing and cheap hobby servos, building you’re own small walking robot is not particularly difficult, but getting them to walk smoothly can be an entirely different story. Knowing this from experience, [Max.K] tackled the software side first by creating a virtual simulation of his ZeroBug hexapod, before building it.

Learning from his previous experience building a quadruped, ZeroBug started life in Processing as a simple stick figure, which gradually increased in complexity as [Max.K] figured out how to make it walk properly. He first developed the required movement sequence for the tip of each leg, and then added joints and calculated the actuator movements using reverse kinematics. Using the results of the simulations, he designed the mechanics and pulled it back into the simulation for final validation.

Each leg uses three micro servos which are controlled by an STM32F103 on a custom PCB, which handles all the motion calculations. It receives commands over UART from a python script running on a Raspberry Pi Zero. This allows for user control over a web interface using WiFi, or from a gamepad using a Bluetooth connection. [Max.K] also added a pincer to the front to allow it to interact with its environment. Video after the break.

The final product moves a lot smoother than most other servo-driven hexapods we’ve seen, and the entire project is well documented. The electronics and software are available on GitHub and the mechanics on Thingiverse.

Continue reading “ZeroBug: From Simulation To Smooth Walking”

A Look Back On A Decade Of Kerbal Space Program

Just a few weeks before Atlantis embarked on the final flight of the Space Shuttle program in 2011, a small Mexican company by the name of Squad quietly released Kerbal Space Program (KSP) onto an unsuspecting world. Until that point the company had only developed websites and multi-media installations. Kerbal wasn’t even an official company initiative, it started as a side project by one of their employees, Felipe Falanghe. The sandbox game allowed players to cobble together rockets from an inventory of modular components and attempt to put them into orbit around the planet Kerbin. It was immediately addictive.

There was no story to follow, or enemies to battle. The closest thing to a score counter was the altimeter that showed how far your craft was above the planet’s surface, and the only way to “win” was to put its little green occupant, the titular Kerbal, back on the ground in one piece. The game’s challenge came not from puzzles or scripted events, but from the game’s accurate (if slightly simplified) application of orbital mechanics and Newtonian dynamics. Building a rocket and getting it into orbit in KSP isn’t difficult because the developers baked some arbitrary limitations into their virtual world; the game is hard for the same reasons putting a rocket into orbit around the Earth is hard.

One of my early rockets, circa 2013.

Over the years official updates added new components for players to build with and planets to explore, and an incredible array of community developed add-ons and modifications expanded the scope of the game even further. KSP would go on to be played by millions, and seeing a valuable opportunity to connect with future engineers, both NASA and the ESA helped develop expansions for the game that allowed players to recreate their real-world vehicles and missions.

But now after a decade of continuous development, with ports to multiple operating systems and game consoles, Squad is bringing this chapter of the KSP adventure to a close. To celebrate the game’s 10th anniversary on June 24th, they released “On Final Approach”, the game’s last official update. Attention will now be focused on the game’s ambitious sequel, which will expand the basic formula with the addition of interstellar travel and planetary colonies, currently slated for release in 2022.

Of course, this isn’t the end. Millions of “classic” KSP players will still be slinging their Kerbals into Hohmann transfer orbits for years to come, and the talented community of mod developers will undoubtedly help keep the game fresh with unofficial updates. But the end of official support is a major turning point, and it seems a perfect time to reminisce on the impact this revolutionary game has had on the engineering and space communities.

Continue reading “A Look Back On A Decade Of Kerbal Space Program

Emulating A Power Grid

The electric power grid, as it exists today, was designed about a century ago to accommodate large, dispersed power plants owned and controlled by the utilities themselves. At the time this seemed like a great idea, but as technology and society have progressed the power grid remains stubbornly rooted in this past. Efforts to modify it to accommodate solar and wind farms, electric cars, and other modern technology need to take great effort to work with the ancient grid setup, often requiring intricate modeling like this visual power grid emulator.

The model is known as LEGOS, the Lite Emulator of Grid Operations, and comes from researchers at RWTH Aachen University. Its goal is to simulate a modern power grid with various generation sources and loads such as homes, offices, or hospitals. It uses a DC circuit to simulate power flow, which is visualized with LEDs. The entire model is modular, so components can be added or subtracted easily to quickly show how the power flow changes as a result of modifications to the grid. There is also a robust automation layer to the entire project, allowing real-time data acquisition of the model to be gathered and analyzed using an open source cloud service called FIWARE.

In order to modernize the grid, simulations like these are needed to make sure there are no knock-on effects of adding or changing such a complex system in ways it was never intended to be changed. Researchers in Europe like the ones developing LEGOS are ahead of the curve, as smart grid technology continues to filter in to all areas of the modern electrical infrastructure. It could also find uses for modeling power grids in areas where changes to the grid can happen rapidly as a result of natural disasters.

Circuit VR: Arduino Virtually Meets Analog

There was a time when building electronics and building software were two distinct activities. These days, almost any significant electronic project will use a CPU somewhere, or — at least — could. Using a circuit simulator can get you part of the way and software simulators abound. But cosimulation — simulating both analog circuits and a running processor — is often only found in high-end simulation products. But I noticed the other day the feature quietly snuck into our favorite Web-based simulator, Falstad.

The classic simulator is on the left and the virtual Arduino is on the right.

Back in March, the main project added work from [Mark McGarry] to support AVR8js written by [Uri Shaked]. The end result is you can have the circuit simulator on the left of the screen and a Web-based Arduino IDE on the right side. But how does it work beyond the simple demo? We wanted to find out.

The screen looks promising. The familiar simulator is to the left and the Arduino IDE — sort of — is to the right. There’s serial output under the source code, but it doesn’t scroll very well, so if you output a lot of serial data, it is hard to read.

Continue reading “Circuit VR: Arduino Virtually Meets Analog”

Custom Components In LTSpice

If you enjoy simulating circuits, you’ve probably used LTSpice. The program has a lot of powerful features we tend to not use, including the ability to make custom components that are quite complex. To illustrate how it works, [asa pro] builds a potentiometer component that is not only a good illustration but also a useful component.

The component is, of course, just two resistors. However, using parameters, the component gets two values, a total resistance and a percentage. Then the actual resistance values adjust themselves.

Continue reading “Custom Components In LTSpice”

Circuit Impedance Calculations Without Cumbersome Simulations

Using circuit simulating software like SPICE can be a powerful tool for modeling the behavior of a circuit in the real world. On the other hand, it’s not always necessary to have all of the features of SPICE available all the time, and these programs tend to be quite expensive as well. To that end, [Wes Hileman] noticed an opportunity for a specific, quick method for performing impedance calculations using python without bulky, expensive software and came up with a program which he calls fastZ.

The software works on any network of passive components (resistors, capacitors, and inductors) and the user can specify parallel and series connections using special operators. Not only can the program calculate the combined impedance but it can perform frequency analysis at a specified frequency or graph the frequency response over a wide range of frequencies. It’s also running in python which makes it as simple as importing any other python package, and is also easy to implement in any other python program compared to building a simulation and hoping for the best.

If you find yourself regularly drawing Bode plots or trying to cobble together a circuit simulation to work with your python code, this sort of solution is a great way to save a lot of headache. It is possible to get the a piece of software like SPICE to to work together with other python programs though, often with some pretty interesting results.

Python Settles Bet About Best Strategy In Children’s Board Game

Simulating a tabletop game can be done for several reasons: to play the game digitally, to create computer opponent(s), or to prove someone wrong. In [Everett]’s case, he used Python to prove which adult was right about basic strategy in a children’s game.

[Everett]’s 5-year-old loves a simple game called Hoot Owl Hoot! in which players cooperatively work to move owls along a track to the safety of a nest. Player pieces move on spaces according to the matching colors drawn from a deck of cards. If a space is already occupied, a piece may jump ahead to the next available spot. The game has a bit more to it than that, but those are the important parts. After a few games, the adults in the room found themselves disagreeing about which strategy was optimal in this simple game.

It seemed to [Everett] that it was best to move pieces in the rear, keeping player pieces grouped together and maximizing the chance of free moves gained by jumping over occupied spaces. [Everett]’s wife countered that a “longest move” strategy was best, and one should always select whichever piece would benefit the most (i.e. move the furthest distance) from any given move. Which approach wins games in the fewest moves? This small Python script simulates the game enough to iteratively determine that the two strategies are quite close in results, but the “longest move” strategy does ultimately come out on top.

As far as simulations go, it’s no Tamagotchi Singularity and [Everett] admits that the simulation isn’t a completely accurate one. But since its only purpose is to compare whether “no stragglers” or “longest move” wins in fewer moves, shortcuts like using random color generation in place of drawing the colors from a deck shouldn’t make a big difference. Or would it? Regardless, we can agree that board games can be fitting metaphors for the human condition.