Showing posts with label robotics. Show all posts
Showing posts with label robotics. Show all posts

2016/11/21

C vs C++, performance on AVR

The aim of this post is to fight the generalized belief of C++ being too slow of a language for embedded environments. This belief goes around, saying that microcontrollers should still be programmed in C, or even in assembler. Probably you don't agree with me right now. The idea of C being much more efficient than C++ is so extended that it almost seems like sacrilege to debate it. That's why I'm about to make a series of comparisons between both languages, throwing in some real and objective numbers (code size, execution time, etc). After we prove that not only can C++ compete with good old C, we'll see it's actually a better alternative. For that, besides performance metric, I will compare things like safety, code readability or portability.

2014/10/15

Antagonistic Actuation Arm (A3): Part I

I'm starting with the design of a 3d-printed arm to test antagonistic actuation.
Antagonistic actuation is a technique by which you control some degree of freedom (e.g. a joint rotation) with two opposite actuators at the same time. The actuators are connected by an elastic piece of material, like a spring, that can store energy. When the two actuators move accordingly, nothing special happens, and the result is just like if you had a single traditional actuator. But if the two move in opposite directions, the elastic element will stiffen, and your articulation will get stronger. Varying stiffness actually introduces a new degree of freedom, so you get two per joint.

With a good design, you can probably reuse stiffness control between various joints and get the best of both worlds: Shock absorbing and stiffness regulation from antagonistic actuation and low actuator count.

2013/01/26

Hacking a servo: Part I

Motivation

Servos are probably the most popular actuator in DIY robotics today. Cheap, easy to use and easy to control, they are almost everything you want for your little robot. However, they're also quite limited, since they don't provide any feedback, or any information about how they're performing. This makes servos open loop systems, resulting in robots showing typical open loop issues.
Basically, your robot tells its servos to move to some position, and hopes they do it. Never knows whether servos have come to its target or they are stuck in the middle. Even when a servo doesn't get stuck, it's hard to predict where it actually is due to varying loads and initial conditions.
Most of the time, this is solved using an external sensor, like a potentiometer.
But some times there is no room for extra sensors in your robot, and even if there is, why bother when the servo has its own potentiometer inside?

2012/07/25

AVR High performance timing.

Note: For an in-depth discussion on using C++ for high-performance avr programming, see this post.

Introduction:


 What's the point of programming a timing system for our AVR projects?
Good control of time can prove to be a valuable tool under our belts. Focusing on robotics, it can help us with a variety of things including, but not limited to:
- Control of servos and sensors
- Position estimation based on speed encoders
- Led flashing
- Task scheduling
- Code profiling
So proper timing can make our projects more powerful and reliable. Moreover, having an abstraction layer on top of timer hardware will help us prototype faster and will make our code more portable.