Showing posts with label Tips and Tricks. Show all posts
Showing posts with label Tips and Tricks. Show all posts

Tuesday, July 3, 2018

How to install and use KiCad FreeRouting/FreeRoute auto-router (incl. manual board cleanup & DRC) in KiCad 5


Subscribe by Email!



Watch video above.
Direct link: https://www.youtube.com/watch?v=ESrHILARL7Y.

I go through:

1) How to download and "install" (copy over) the necessary (and pre-compiled) freeroute.jar ("freeRouting.jar") binary.

2) (Briefly): how to use the auto-router to route a couple boards (1 trivial, 1 less trivial), including back-importing the routed boards back into KiCad.

Note: the crux of this demo is done by 6:00! By this point I have shown how to install the freeroute.jar executable file and use the auto-router to route a board! Feel free to stop at this point.

3) How to download the KiCad source code and demo project files (ex: to use as demo tools to test the autorouter).

4) How to work around a minor bug in the autorouter that sometimes makes it not allow you to output the routed board .ses file.

5) How to rename board layers.

6) How to do manual board cleanup, including DRC (Design Rules Check), manual trace modifications and dragging, Interactive Router Settings (very brief mention), board ground fill (brief), and how to fix ground fill problems such as floating fill islands which need to be connected via a few vias and traces.

7) The end-result is a nice, auto-routed board (auto-routing is so convenient!) with minimal hand-cleanup ready to be sent off to the manufacturer.

I'm super happy to have the auto-router working so that I can use it for quick-and-dirty jobs that require a faster design speed and less manual work at the sacrifice of a bit of perfection.

Thanks for watching!

Links you will need from the video:
1) https://freerouting.org/freerouting/using-with-kicad
2) https://github.com/KiCad/kicad-source-mirror

By Gabriel Staples
Written: 3 July 2018
Last Updated: 3 July 2018

END

Keywords: KiCad autorouter, KiCad auto-router, KiCad freerouter, KiCad freerouting, using the KiCad freerouter, PCB layout, DRC check, Design Rules Checking

Draft Time: ~ 3 hrs.

***Subscribe by Email!***

Sunday, January 28, 2018

How to clone your hard drive using free and simple open-source tools (w/any OS on your cloned drive!)


Subscribe by Email!
By Gabriel Staples
Written: 28 Jan. 2018
Last Updated: 28 Jan. 2018

Last Article:
This Article:
I just upgrade my hard drive to an SSD (Solid State Drive). Now my computer runs soooo much faster! It's usable again! No matter what operating system you have, the following instructions will work, since we will simply be using free and open source, and also no-cost, tools to copy your drive data, byte by byte, from one drive to another. In other words, the copy technique doesn't even read files, as it doesn't know what files are, so it doesn't care what file structure or format you have. It just reads bytes. I'm pretty excited that such great free tools exist. No need to buy Acronis, just do this.

How to clone your hard drive:

1. Buy an external hard drive USB enclosure. Ex: Sabrent Ultra Slim USB 3.0 to 2.5-Inch SATA External Aluminum Hard Drive Enclosure [Black] (EC-UK30) ($8.99).

2. Buy a nice new SSD. Ex: Samsung 860 EVO 1TB 2.5 Inch SATA III Internal SSD. Place the 860 EVO into the enclosure and plug it in.

3. Make a bootable USB flash drive containing Linux Ubuntu 16.04, or whatever the latest LTS (Long-Term Support) version is at the time.


***Subscribe by Email!***

Saturday, January 20, 2018

10-Second $10 Upgrade to Triple Your Raspberry Pi 3 Network Speed


Subscribe by Email!
By Gabriel Staples
Written: 20 Jan. 2018
Last Updated: 20 Jan. 2018

Site Map/Table of Contents



tldr;

Buy one of these USB to Gigabit Ethernet adapters for $10, plug it in to your Raspberry Pi 3 and voilá! Your new Pi 3 Ethernet connection is now 3x faster than the built-in Ethernet port and 12x faster than the built-in WiFi adapter (source: see my test results below)!

This really matters when you're using your Pi 3 as a network device, server, router, hotspot, NAS, or remote development machine. Pretty much it really matters whenever you want it to work better on your local or wide area network, which includes ssh-ing or otherwise remoting into it.

Details:


***Subscribe by Email!***

Saturday, August 26, 2017

How to make a Linux Live USB with a 2nd, Windows-readable partition for storage


Subscribe by Email!
This article is a "Notes to Self" article. That means I wrote it for my own personal reference and use, with myself as the target audience during drafting, but decided to post it here because I believe it is useful to others too, and I want to reach as many people as possible, not just me. 

Ever wanted to have a bootable Linux USB flash drive with a separate, Windows-readable partition for general file storage? Here's how.

By Gabriel Staples
Written: 26-27 May 2016
Posted online: 26 Aug 2017
Updated: 26 Aug 2017

The Gist of it/The super short version:
-for the experienced Linux user
  1. Use gparted on a Linux computer to make 2 FAT32 partitions on the thumb drive. The partition created first must be for storage, while the 2nd one must be for the Linux distro you are putting on the Live USB.
  2. Use UNetbootin on a Linux computer to install your iso file for the Live USB onto the 2nd partition you just made above.
  3. Done. You can now boot from the USB thumb drive, from its 2nd partition, while its 1st partition only is readable and usable by Windows still (as well as by Linux or Mac too of course).


***Subscribe by Email!***

Friday, March 31, 2017

Arduino (ATmega328) Direct Register Manipulation for Custom PWM Output (ex: 1us HIGH followed by 99us LOW --> 1% Duty Cycle at 10kHz)


Subscribe by Email!
Here's a quick example of how to make a hardware-based 1us HIGH pulse followed by a 99us LOW pulse (ie: 100us period, or 10kHz, PWM with a 1% duty cycle), via direct timer register manipulation. I've left ample comments for you to read and follow. This example below is therefore quite easy to follow and learn from, but just as it took me dozens of hours originally to learn how to do all this stuff from scratch--and to learn about all the different PWM modes possible as described in the datasheet and elsewhere, expect to spend at least a few hours if you are truly going to read the references and dig into it enough to understand it yourself. Good luck and have fun!

References to Study:
  1. Secrets of Arduino PWM, by Ken Shirriff
  2. ATmega328 Datasheet (660 pg version from 11/2015)
  3. ATmega168/328-Arduino Pin Mapping

Here's some oscilloscope screenshots of the output on Pin 3 produced by an Arduino Nano running the code below.

Rising edge to rising edge: Δx = 100us


***Subscribe by Email!***

Tuesday, November 8, 2016

Eagle PCB CAD - How to copy a part from one schematic to another


Subscribe by Email!
Gabriel Staples
8 Nov 2016

Learning EagleCAD? Here's how to copy a part from one schematic or board layout to another.
  1. Open up an Eagle Control Panel, and the board and schematic you are working on.
  2. Open up a *second* Eagle Control Panel, and the board and schematic you want to copy from.
  3. Use the group tool to make a selection of a part to copy.
  4. Click the copy tool, then ctrl + right click to copy the *grouped* selection to the clipboard. Press Esc now to not paste it anywhere in this project. 
    1. Note that you *must* use the group tool followed by ctrl + right click even if only copying a single object, since that's the only way to get it to your PC's clipboard.
  5. Go back to the schematic you'd like to paste into, and click the "paste" tool. Left-click anywhere to paste what's in the clipboard. 

Done!

Helpful References:
...among many others.





***Subscribe by Email!***

Monday, July 11, 2016

Arduino-like millisecond (ms) and microsecond (us)-resolution timestamps in Python: millis(), micros(), delay(), & delayMicroseconds()


Subscribe by Email!
By Gabriel Staples
Written: 11 July 2016
Last Updated: 22 Oct 2016
History (newest on top):
-posted updated code (v0.2.1) with Linux functions too (not just Windows) - 22 Oct. 2016

Other Articles:
Below, I show some code for basic Python millisecond (ms) and microsecond (us)-resolution timing functions. I made these to resemble Arduino functions I am already familiar with. Since these functions use the Windows API's QueryPerformanceCounter and QueryPerformanceFrequency functions, as-written, they work for Python in Windows only. If you decide to adapt them to Linux, please share how you did it in the comments section. Update (19 Oct 2016): I have updated these functions to work with Python in Linux now too! See below.

Functions and code samples. Functions include:
micros()
millis()
delay()
delayMicroseconds()

***Subscribe by Email!***

Thursday, June 11, 2015

100+V Arduino/AVR Microcontroller Input/Output (I/O) Pin Over-Voltage Protection Using a *Single* Resistor!


Subscribe by Email!
By Gabriel Staples
Written: 11 June 2015
Last Updated: 2 Sept. 2015
Update History (newest on top):
-Added "Upfront Caveat", 2 Sept. 2015
-Added lots of extra info, & the Figures, 21 July 2015

Related Articles:

Here I present a pin protection method for very high and low input voltages that I learned from Atmel themselves, in their Application Note "AVR182: Zero Cross Detector."

If you've read my article titled "Arduino Power, Current, and Voltage Limitations" you know that the pin input voltage limits are as follows:
Maximum Input Voltage: Vcc + 0.5V, or +5.5V for a 5V Arduino
Minimum Input Voltage: -0.5V

However, if you simply add a single resistor in series with any input pin, you can protect it against higher or lower input voltages, with some caveats!

Ex: simply by placing a 10k resistor in series on an input pin, you get input voltage protection up to +15.5VDC and down to -10.5VDC. With a 100k resistor you get input voltage protection up to +105.5VDC, and down to -100.5VDC. Keep reading to learn more.

WARNING: 
-FOR YOUR PERSONAL SAFETY, WHEN USING THIS TECHNIQUE, I RECOMMEND THAT YOU DO NOT WORK WITH INPUT VOLTAGES GREATER THAN APPROXIMATELY 100VDC OR 20VAC UNLESS YOU KNOW WHAT YOU ARE DOING AND HAVE READ ALL OF MY WARNINGS HEREIN, INCLUDING THE ADDENDUM AT THE END OF THIS ARTICLE. 
-REGARDLESS OF WHAT INPUT VOLTAGES YOU ARE USING, YOU AND ONLY YOU ARE RESPONSIBLE FOR YOUR PERSONAL EXPERIMENTS, PRODUCTS, DESIGN DECISIONS, AND THE SAFETY OF YOU AND YOUR CUSTOMERS.

Upfront Caveat:
Though this technique may work, and be good for home-projects or quick prototyping, better techniques are recommended, especially if you are producing a commercial product. Redundancy is your friend. Using external, rated clipping diodes is certainly a better option than relying on the internal, integrated and unrated ones. For better protection techniques, including using *external* clipping diodes for redundancy, and adding transient voltage suppression, read more here: Science Prog: Using current limiting resistors on AVR I/O pins. Also see the AVR182 Application Note for references to additional sources to read in order to add extra pin protection.

Background & Concept:

***Subscribe by Email!***

Saturday, February 7, 2015

Q&A: Question About Over-discharged LiPo--How do I quantify the amount of damage done to the battery pack?


Subscribe by Email!
By Gabriel Staples
Written: 7 Feb 2015
Last Updated: 7 Feb 2015

Related Articles:
High-current bench-top battery test setup by FliteTest (source: 4:08)


Question I Just Received:
-from "Lakshman

"Hi Gabriel.
I am referring to your post http://electricrcaircraftguy.blogspot.sg/2014/10/restoring-over-discharged-LiPos.html#.VNXv9mSUcp0.

I accidentally discharged my battery to 2.8v/cell today due to a faulty lipo alarm. It did not go off at 3.6V while flying my tricopter and within a minute or so, the voltage dropped to 2.8v/cell. I recharged it back to 3.8v storage at 0.2A without any issues. This was before I read that article.

How do I quantify the amount of damage done to the battery pack? I usually stop flying at or before ~80% discharge. Will it be a lousier battery after this incident?

Thank you."

Here's what I had to say...


***Subscribe by Email!***

Monday, October 13, 2014

Restoring/Recharging Over-discharged LiPo (Lithium Polymer) Batteries!


Subscribe by Email!
By Gabriel Staples
Written: 5 March 2014
Posted Here: 13 Oct. 2014
Last Updated: 7 Feb. 2015
-added Q&A section & link - 7 Feb. 2015

Related Articles:
Recommended Arduino Articles:

Though I first posted this article on my Instructables page, I decided to update it and repost it on my main website here in order to keep my articles more consolidated and easily maintained by myself.  From this point on, I will keep the most up-to-date version of this article right here, instead of on my Instructables page, so if you want the latest info, read here.  Don't forget to subscribe to receive an email whenever I post something new by clicking the subscribe link at the top-right of this page!  I will never use your email addresses for spam.

A LiPo that self-discharged, while in my plane, hanging overnight in a tree. :(

Intro:

LiPo batteries should never be discharged below 3.0V/cell, or they may be permanently damaged.  Many chargers don't even allow you to charge a LiPo battery that is below 2.5V/cell.  So, if you accidentally run your plane/car too long, you don't have your low voltage cutoff set properly in the ESC (Electronic Speed Controller), or you leave the power switch on, forget to unplug the LiPo, get your plane stuck overnight in a tree (the same tree, three separate times, for foolishly flying in areas too small because you are too excited to fly and it's almost dark), etc. etc., you may find yourself in a situation where you've discharged your LiPo down well below 3.0V/cell.  What do you do?

Many people toss the LiPos in the trash.  I don't.  I restore them.  Here's how.


***Subscribe by Email!***

Saturday, May 31, 2014

eRCaGuy_ButtonReader Library for Arduino - Debounce and read the current button state, & most recent action ("just pressed" or "just released") easily!


Subscribe by Email!
By Gabriel Staples
Written: 31 May 2014
Last Updated: 25 July 2015
Article History (newest on top)
-added button image & updated download links - 25 July 2015

Other Articles to Check Out:
This Article:

Library History (newest on top):

20141031: major bug fix; added multi-button support with a new 5-button-reader example!
20140531: first release.
Misc. push buttons which can greatly
benefit from digital debouncing. 
(Image source here).

Summary:

I wanted a simple and universal, yet very powerful & reliable library to read a button or switch in such a way that I can easily implement toggled actions and momentary actions, know the true, debounced state of a button or switch at any given time, and specify whether I want an action to take place when the button is *pressed* or *released.* This library makes implementing all of these things easy for me, and I now use it on all of my projects that require reading a button or switch, so I wanted to share it with others. Hopefully you find it useful too. Check out the included examples.  

This code is an elaboration of, and library form of, the main Arduino-sponsored "Debounce" example found here.  Thanks to David A. Mellis, Limor Fried (LadyAda), and Mike Walters for writing that excellent and well-thought-out example code.

Download:

(Optionally) donate, & download via the link just above, or by clicking here then choosing the appropriate download.  Install the library into the Arduino IDE (using Sketch --> Include Library --> Add .ZIP Library), then run the examples to see how to use the library.


***Subscribe by Email!***

Sunday, February 9, 2014

Arduino micros() function with 0.5us precision - using my Timer2_Counter Library


Subscribe by Email!
...merging the world of Arduino and Radio Control, one tool at a time...
...CODE FOR A PRECISE MICROS() FUNCTION IS POSTED BELOW...

"I wrote a libary to get 0.5us precision on a "micros()" replacement function, so that I can get repeatable results reading a PWM or PPM signal, to within 1us.  I searched all around the internet and could not find something comparable (or that was easy to use, and maintained the Arduino's ability to write PWM signals via the Servo Libary), so I think this is my first real contribution to the world of Arduino and Radio Control."  

(font above is type "standard," from here)

Download this library:
  • Click the above link, optionally donate (just set the price you want to pay to $0 if you like), & download the library. You may also click here, then choose the appropriate download. 
    • For the email address field, you may enter none@gmail.com if you like. Or, enter your real email if you want to receive an email with the download link, and if you don't mind if I send you an occasional email with something I'm working on (perhaps a few times a year or so).
  • Install the library into the Arduino IDE (using Sketch --> Include Library --> Add .ZIP Library), then run the examples to see how to use the library.
  • GitHub: https://github.com/ElectricRCAircraftGuy/eRCaGuy_TimerCounter

***Subscribe by Email!***

Saturday, February 8, 2014

Quick Tip: 4 Ways to Power an Arduino


Subscribe by Email!
By Gabriel Staples
Written: 8 Feb. 2014
Updated: 27 May 2014 - minor details added

Other Articles:

4 Ways to Power Your Arduino:

  1. USB cable
  2. External power supply, or battery, going into the 2.1mm x 5.5mm DC power jack (recommended 7~12V input)
  3. External power supply, or battery, going into the "VIN" and "GND" pins on the board, via jumpers (recommended 7~12V input)
  4. External, regulated 5V power going straight into the "5V" and "GND" pins; this can come from another Arduino's 5V and GND pins even!
========================================================================
Please support my work and contributions by purchasing an Arduino-compatible Nano from me here.
Also, don't forget to like, share, and subscribe at the right.
========================================================================

END OF POST

***Subscribe by Email!***

Wednesday, September 18, 2013

Propeller Static & Dynamic Thrust Calculation - Part 1 of 2


Subscribe by Email!
SUBSCRIBE TODAY TO RECEIVE MY BLOG UPDATES!  -- CLICK ENVELOPE TO THE RIGHT, & INPUT EMAIL -->


Propeller Static & Dynamic Thrust Calculation

By: Gabriel Staples
Written: 16 July 2013
Last Updated: 13 April 2014
--made a minor correction to an example, & added a plot
--added many more statistical details in order to better explain the accuracy of the equation.
--added Simplified form of eqn. too. - 15 Oct. 2013
--added links to Part 2 of this article - 13 Apr. 2014

Other Articles:

Propeller Thrust Equation, & Downloadable Excel Spreadsheet Thrust Calculator:

DOWNLOAD MY EXCEL SPREADSHEET THRUST CALCULATOR HERE (click link, then go to File --> Download)


Figure 1: a preview of what is to come - Static Thrust (left) & Dynamic Thrust (right).

I have been interested in propellers for a very long time.  I've also been interested in how they produce thrust, and how forward velocity affects that thrust.  Therefore, I've done a lot of thinking about it, and put a lot of time into understanding them better.  Here is an equation that I came up with to quantify the thrust produced by propellers.  I wanted it to be a simple approximation, with a minimal number of inputs.  Therefore, it uses only the propeller's pitch and diameter (from the numbers on the front of the prop), and the RPMs at which the prop is spinning (this can be measured from a basic optical tachometer such as the one shown in the picture to the left).  That's it!


Here is the equation.  

The expanded form is shown to help you see where some of the numbers come from.  The simplified form is shown to help you put the equation into a calculator or Excel spreadsheet easier.

***Subscribe by Email!***

Monday, July 15, 2013

Hat Cam


Subscribe by Email!
Written: 15 July 2013

Other RC Articles:
Here are some pictures of my hat-camera.  No, this is not my original idea.  I got it from other people online, and simply picked up some hardware from Home Depot that I thought would work best.  Here are some photos of what I put together.  I've been using the hat cam now for a couple years and it works great!  It doesn't aim perfectly (it usually aims just a little too high when I am really close to something, and just a little too low when I am very far away), but it works well enough most of the time.  The hat was free basically, since I had plenty of them lying around, and the hardware costed something like $3 maybe.  Certainly a wise investment I'd say.

Additional pictures can be seen below:

***Subscribe by Email!***

Monday, May 27, 2013

A Few Tips & Tricks: Arduinos, PCB Tricopter Frames, Home-made Acid Etchant for Copper


Subscribe by Email!
By: Gabriel Staples
Written: 28 May 2013
Updated: 30 Oct. 2013
-added link to LadyAda's Arduino Uno FAQ
-added link to Arduino Nano V3.0 on Ebay

Other Articles You May Be Interested in Reading:

So, this month I've been dabbling into a few new RC airplane areas that I have previously not looked into.  You may wonder how these topics in the title relate to RC airplanes?  Well, for me, everything does :), so let's briefly discuss:

Arduino & Microcontrollers:

What is Arduino?  Well, Arduino is a small interface board which connects to your computer via a USB cable, and consists of an Atmel microcontroller chip, or "brain," which can do a variety of functions and processing, as well as circuitry to enable you to connect to it via a USB cable, in addition to a voltage regulator and input and output ports.  Basically, it is a development or experiment board which allows you to plug in sensors and circuitry and do anything you can imaging via your own personal ingenuity and programming skills---yet it is inexpensive and simple enough that anyone can get started.  It is especially designed for the non-programmer.  Here is Arduino's description of themselves.  A few things that make Arduino unique are its price, ease of use and programming, and the fact that it is open-source.  Open-source means that its parts, pieces, construction, and coding are all available to the public, and that its software is FREE.  This is the counterpart to "proprietary," which means that something is owned by a company and its internal workings are generally guarded and kept secret in order to prevent others from duplicating it.

You might not know it, but the microcontroller, or MCU, which is the heart of the Arduino, is a very common-place item in today's electronics.  Modern RC radio transmitters use them, for example, as well as ESCs (Electronic Speed Controllers) and "smart" battery chargers such as the Thunder AC680.
 Many UAVs (Unmanned Aerial Vehicles) use microcontroller-based autopilots!  Now, with Arduino,

***Subscribe by Email!***

Tuesday, April 30, 2013

Beginner RC Helicopter & Quadrocopter


Subscribe by Email!
By Gabriel Staples
Written: 13 Jan 2013
Last updated: 3 Dec 2016
Update History (newest on top):
-3 Dec. 2016, updated dead link to micro heli (now linked to "v911" search results on eBay), and updated links to some other small parts too
-6 Oct. 2013, added links to micro quadrocopters

Related Articles:
For those of you who have tried a 3-Channel micro helicopter or two (ex: virtually any helicopter that you might see at a mall), you are probably ready to try something a little bit better.  Well, don't go out quite yet and spend hundreds on a 6-Channel fully acrobatic collective pitch heli.  Rather, get a nice single-rotor 4-Channel beginner micro heli that can take some abuse while still teaching you more skills.  Once you master a micro 4-Channel heli, then take the step up to a several hundred dollar 6-Channel helicopter, and start flying slowly and carefully as it will be much more difficult still than the 4-channel heli.

So, which one to buy?  Well, I have the HobbyKing FP100 ($29 + shipping) (also see the "v911" eBay links below) (shown to the right), and I love it! It flies very well, gives you those extra skills you need while providing more challenge and capability, and yet is still so light that it is durable and can take quite a few crashes without breaking.  And if you break it? --you can buy spare parts!

How is this different from a 3-Channel Helicopter? 
A 3-Channel helicopter has a left stick which controls throttle, and a right stick which controls pitch and yaw.  There is no roll control, and pitch is extremely limited, since it is done simply via a tiny horizontal propeller near the tail which spins to create lift and slightly raise or lower the tail, thereby providing forward or aft movement.  A 3-Channel heli, therefore, is very limited in control authority, and can rarely go faster than a walking speed.  Another serious limitation is that they usually use infrared transmitters, which have a very short range, and are affected by sunlight.  Therefore, they are usually only indoor helicopters due to their ultra limited control (inability to counter even the slightest wind gusts), and infrared antennas which are susceptible to interference from the sun.  (Note: infrared transmitters are usually identifiable by a small, usually red, plastic cover near their top, instead of an antenna).

So, what is the extra channel on a 4-Channel helicopter?  
A 4-Channel helicopter, on the other hand, is highly maneuverable in comparison

***Subscribe by Email!***