PID Autotuning: A practical example

PID can be a real pain to tune. This is especially true if you are dealing with inherently unstable systems like a quadcopter. Ask anyone who has tuned a quadcopter manually. It is a very gruelling process that tests your patience and sanity. I remember seeing an improvement in performance as we tuned the code, only to discover that we were compiling the wrong piece of code. It is even worse if you have no idea where the target value should be. ...

May 16, 2018 · 3 min

Arduino LED strip shield

Ah the amazing LED strip. I’ve used it to build so many fun projects, from the Sunrise Morning Alarm. This can probably be seen as the next level of development in my projects. I wanted something that could be used easily to connect to LED strips to power and animate them, and a couple of other components that I usually would like to have in my LED projects, such as a radio and a real-time clock (RTC). ...

March 29, 2018 · 3 min

Spring Projects, 2018

Spring! A great time to get started on new projects, now that I won’t actually freeze the moment I step outside, I can also start embarking on outdoors projects. Tiva TM4C123 The Tiva TM4C123 is a very capable chip! We started using this in class and I really like how well documented Texas Instruments is. Datasheets and official examples work amazingly well. The only quibble I have is that searching through the examples to find a right one can be a hassle, especially if I just want to simply reference an example of how to toggle a pin. I really started to appreciate good documentation when I picked up the Beaglebone Pocket and tried to look up the software reference to program in C, there simply wasn’t any! All that was provided was a simple copy-and-paste example to blink an LED. The material didn’t point to any progression, or other examples, which I found kind of surprising. Documentation is sparse, and relies on third parties to write “unofficial” guides. I guess maybe that’s why Arduino/Raspberry Pi parings are so common instead of the Beaglebone. ...

March 28, 2018 · 5 min

Moving from Arduino to ARM

Moving from Arduino to ARM can be a frightening thing! The IDEs out there are more often intimidating because they bristle with features. For someone coming from Arduino where there was only really five buttons you could press in the IDE, this change is somewhat like moving from a car to an airplane. Atmel I first tried Atmel Studio because they are closely linked to Arduino, but the only other time I’ve had occasion to use it was to upload Arduino bootloader code onto SAMD21 chips. ...

February 28, 2018 · 5 min

Building a wireless controller

Let’s build an Arduino wireless controller in a Wii Nunchuk 3D-printed case with an nRF24L01! Motivaton I had a few joysticks lying around and I wondered if I could find a use for them. I was recently experimenting with nRF24l01 radio chips and they seem to be the most reliable way to send small packets of information wirelessly. I prefer them over the 433Mhz radios which I found to be too unreliable even from the distance of 1m. ...

February 7, 2018 · 3 min

Command for making GIFs on Linux

Making GIFs on a Linux computer requires you to jump through a few hoops, after a few hours of experimentation, this is my solution. Of course, you can also use an online service. ffmpeg -ss [start] -i input.mp4 -t [duration] -vf scale=280:-1 -r 15 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif The time should be set in the following format: hh:mm:ss for example, 00:12:31. ...

February 1, 2018 · 1 min

Data types, pointers, and a pickle? (14)

When programming in Arduino, you might have occasion to go beyond the standard datatypes of int and String. Data Types You might have noticed that if you did the following: int count = 5; int groups = 2; Serial.println(count/groups); Serial would have printed 3. This can be a head-scratcher, especially since we never had the occasion to use other data types. A data type refers to what the data can represent. This primarily has to do with int, which cannot represent decimal points. The solution is to use a float which is another data type, except that now it can handle floating point operations. For example, if we changed the example above a little: ...

January 24, 2018 · 6 min

An integrated Arduino nRF24L01+ module

While blinking LEDs can be really fun, wireless communication is like magic. The nRF24 is a all-in-one SMD IC for wireless communications. Chuck in an Arduino microcontroller and you got yourself a Arduino with a wireless link. The nRF24 has been adapted by Chinese manufacturers to produce an extremely inexpensive board that has very good characteristics. This chip costs $3 from Digikey, but it costs $1.37 on Aliexpress for a full board with a PCB antenna. Both through-hole and SMD versions of this board exists, making it easy to take from prototyping to board design. ...

January 11, 2018 · 4 min

Missing Keys

Sometimes Arch Linux complains about missing keys, after spending a little too long Googling around, this was the solution: Upgrade archlinux-keyring first, then upgrade the rest of the system. sudo pacman -Sy archlinux-keyring If that doesn’t solve your problems, try switching your keyserver sudo nano /root/.gnupg/dirmngr_ldapservers.conf Change the keyserver line to: keyserver hkp://pgp.mit.edu:11371 as documented here: https://wiki.archlinux.org/index.php/Pacman/Package_signing#Cannot_import_keys Your system time might be wrong as well, so remember to check that. Sometimes when installing a tool, it says that a particular GPG key is outdated. This means that the tool is no longer maintained and a red flag. You might want to look for keys elsewhere.

January 10, 2018 · 1 min

Assembling LM3914 Power Indicator Display board

The LM3914 is a dot/bar display driver. It senses analog voltage level and drives 10 LEDs, making it suitable for use as a power indicator, and there are a number of products that use this function. This device is marketed as a 2.4-20V power display indicator on Aliexpress and Banggood. It is a pretty small board, and would be useful in determining the charge on a acid battery or LiPo battery, where the voltage varies with the charge. ...

January 2, 2018 · 2 min