Search This Blog

Friday, August 26, 2016

A Complete Guide to Understanding Basic Components of your Hardware

Today, I will be walking you through to understanding some of the basic components of your computer.  There are many posts about this, but this post will be more complete and much easier to understand.  By understanding your hardware, you will be able to learn about computers much faster.  Hardware knowledge is key!

Let's begin!
Image result for computer hardware clipart
In order to start, let's first download CPU-Z here and GPU-Z here.
With these tools, we will be able to easily analyze details about your CPU, RAM, GPU, and a little bit of detail about your motherboard.  Other tools that are very useful but are not going to be covered in this post include Battery View, System Specs, Speedfan, Corsair Link (for systems with a lot of Corsair manufactured hardware), RealTemp, and HDDHealth.

Once you download CPU-Z and GPU-Z, open it up with admin privileges.  It will open up a GUI and display useful information about your hardware.  Let's start with CPU-Z first.

Name: Your processor name and version.  CPUs with a K are overclockable because its multiplier is unlocked
Code Name: That's just the name of the developmental project that made this CPU
Max TDP: That's just the maximum amount of possible heat this CPU can generate.  Cooling systems should prevent CPUs from reaching this point.
Package: This gives you the socket type for this CPU.  This socket type would only be able to work on motherboards that support this socket
Technology: This specifies how small transistors on your CPU are.  This number is decreasing rapidly as new CPU models go onto the market.  22nm is actually large nowadays... I built this computer four years ago.
Core Voltage: This tells you how much voltage is needed for the CPU to run reliably
Specification: This gives you the exact name of the CPU and its factory set speed (This can be increased via overclocking)
Instructions (I skipped a few because those just give even more details on which family the CPU belongs to, what model it is, etc.):  This is the instruction set built into the CPU... it gives the CPU built in instructions and tells you what commands and languages are implemented within the processor.
Core Speed: This just tells you how fast each core is running at
Multiplier: This is basically the ratio of the CPU speed and the Bus Speed.  By increasing this through overclocking, your CPU will run much faster
Bus Speed: This is the speed at which commands are transferred throughout the motherboard
Cores and Threads: This just tells you how many CPUs you have and if hyperthreading exists.  Many CPUs have many CPUs built into one chip.  Since my thread number is same as the cores, my CPU does not implement hyperthreading.  Hyperthreading is the creation of virtual cores; this would allow CPUs to carry out more tasks
Caches: This will be explained in the next section

Caches are like memory in your CPU.  Not all temporary memory is stored in RAM; motherboards, GPUs, CPUs, and many more hardware parts also have temporary storage areas.
Basically, in CPUs, there are 2 to 3 caches usually.  L1 cache is the smallest and fastest one for the CPU to use.  Many CPUs have two types of L1 cache as you can see in the image above.  L2 cache is the next level of CPU memory.  It is slightly larger and slower for the CPU to use.  Lastly, the L3 cache is always the largest and slowest for the CPU to use.  CPUs will usually pull memory out of lower level caches for processes that need to processed quickly.  Also, L3 cache is the only one that can be accessed; L1 and L2 cannot.  Lastly, the L1 and L2 caches are in one core; the L3 cache connects the cores.  Some processors may have an L4 cache... this takes in dumped memory from the L3 cache and can be accessed by both the CPU and GPU

This tab just shows you motherboard information.  On every motherboard, there is a Southbridge and a Northbridge.  The Northbridge is the direct communication system between the CPU and motherboard while the SouthBridge is slightly farther away.  Northbridge is meant to quickly carry out the more demanding tasks. The info with the PCI-Express part just shows the PCI info.  The PCI is used for connecting other hardware to the motherboard, such as peripheral devices.
This tab just gives you information on your RAM.  It tells you how much RAM you have.  DRAM frequency is basically RAM speed; again, this can be increased through overclocking (but increasing may produce system instability).  FSB:DRAM ratio is the ratio of the front side bus to the RAM's operating speed.  CAS is the time it takes for a certain column of the memory to be accessed and then retrieved.  RAS to CAS Delay is the amount of clock cycles it takes for the correct row to be accessed.  RAS Precharge tells you the amount of time you have to wait before accessing another row.  Cycle time tells you how long your computer needs and long the row should be active for in order to get the information out of a row.  Command Rate is very confusing; basically, most computers use 2T but 1T operates faster.  The SPD tab covers pretty similar things to the memory tab.  GPU-Z has a better analysis on the graphics section and there are better benchmarking tools out there (Intel has nice CPU benchmarking tools and Heaven Benchmark is really good for GPUs).

Now, its time for GPU-Z

This shows some pretty self-explanatory information.  Some of the stuff are already covered in CPU-Z's guide.  ROPs are the units that display the final render result on screen and the TMUs processes texture information on pixels and outputs the results onto triangles used to form 3d models. Shaders are like little cores that compute and render images for the screen.  Although these shaders are very simple compared to CPUs, their power combined can be more powerful than a CPUs, such as password cracking, when performing simple tasks.  The Pixel Filtrate tells you the amount of pixels your GPU can render to the screen every second.  Although 32 Gpixels/s may seem very large, you have to consider the scope of things here.  60 frames per second is considered optimal for gaming.  Now if you have a 1920 * 1080 pixel monitor like me, your GPU will have to render 124416000 pixels every second; this is why the pixel filtrate has to be such a large number.  Texture filtrate is the amount of texture pixels your GPU can render.  Texels, or texture pixels, are used to display 3D objects on screen.  The GPU clocks display its speed and cache (memory).  Again, the speed can be increased through overclocking.  Crossfire is a cable used to connect multiple GPUs.  The Bus widths is used to communicate with other components within the computer hardware.  Bandwidth tells you the speed of the video RAM; the faster the better.  The driver version tells you the driver version of your GPU and the Computing section tells you what extra software features your GPU supports.  Some programs need these extra features in order to run since they could be programmed in them.  Lastly, the die size is the physical size of the GPU.

This tab gives you monitoring capabilities.  You can click on the numbers to display the min, avg, current, and max numbers since this program started.  You can also change the sensor refresh rate and log the details to the file.

We finally got through most of the information displayed about your hardware!  There is a ton of info here and even more info that will appear later on if you decide to study hardware in-depth.  This is just a basic tutorial for people to understand the basics of computer hardware by looking through GPU-Z and GPU-Z.  Stay tuned for more blog posts!

Tuesday, July 26, 2016

How To Build Your First Quadcopter




Building a quadcopter was one of the toughest challenges ever so far for me.  It took months of work and I had to overcome so many obstacles throughout the way.  But I was finally able to complete it and the result was amazing.  In this blog post, I will be showing you how to build your own quadcopter.
  
This is my first custom built drone
Before you start building your drone, here are a few things to note.  This drone does offer a lot of control over it and you can customize it in many ways, but you should first get a quadcopter trainer that is very difficult.  There are many out there... you can choose whichever one you like.  Also, you should always order extra parts; parts like the landing gear and propeller are very fragile.  Lastly, I wasn't able to record the process of building so there won't be a video guiding you through.  I am planning on making a complete video guide of building a quadcopter the next time I am building this because it wasn't a very smooth process this time.
**Note: you can customize the build and instructions in this post to your own liking.  This gives a general overview and idea for quadcopter building.  However, if you are new to quadcopter building, it is recommended for you to follow the instructions on this post.


Step #1: Get the Parts
Here is my list of parts (The ones with an "E" next to the price means that you should get extras for that part):
Charger - $23
Some other stuff you must have - blue thread locker, zip ties, velcro, rubber bands, screw drivers, allen wrenches, soldering iron, rosin core solder, wire cutters, scissors, knives, servo wires, and a USB mini-B cable

The total cost of my build was around $750, but I had a lot of the tools already lying around.
It should cost around $850 for you if you don't have any of the items or tools.

* Note about the receiver and transmitter: most quads have more channels on their receivers, but they may be quite unreliable.  Spektrum products are always very reliable.  

Step #2 - Assemble the Frame
You can just assemble the frame from these two really helpful and detailed links on qav400 assembly.  
Link1      Link2

However, please NOTICE THESE THINGS about frame assembly.  
1. Some of the screws don't stay put very well.  USE blue thread locker to help keep it attached.
2. Tighten the screws as much as possible.
3. Solder in the ESCS and battery adapter first before attaching the lowest frame on.  LOOK AT THE LINKS FOR DETAILS ON ATTACHING THE PARTS THAT NEED SOLDERING!!!  After soldering the battery adapter in, get one of the battery adapters you bought and connect it to the frame's battery adapter.
4. You will need nylon spacers to seperate the bottom plate even more in order to fit the ESCS.
5. You also won't be able to fill on the screws for the bottom plate... just put at least 5 on it. Look at the picture below for reference.  

6.  Please use the battery strap... it makes it so much easier for keeping the battery in place.
7. Use nylon spacers to mount the flight control board.  Make sure the side with the usb port is facing away from the side with the battery strap and placement location.  
8. You will need to slightly customize the clean section to fir the flight control board.  Look at the photos below for guidance.  All the parts are already in the qav400 bag.  


9. Use blue thread lock to help keep those extra protrusions in place.  
10.  Mount you receivers on top with velcro and tie up lose wires with zip ties (make sure to cur the extra parts of the zip tie that comes out after fastening it).
11. You can attach the landing gears already by fitting it through the middle hole of the arms.  Fit it in sideways until the top is going through.  Then twist and the landing gear should be in.
12. Overall, you can always customize this frame for your parts.  Please think everything you do and PLEASE DON'T RUIN THE ORANGE VIBRATION MOUNTS.  Those are the main parts that make this frame so special.  
13. Look at online images of the frame or the following images for reference and guidance.







Step #3 - Attaching the motors and props

Note: Since you will need to remove the props after this step, don't put blue thread locker on the props yet.  Do it when you are about to fly.  Always take the props off during calibrations and configurations.  

Attach the motors like this and then connect the wires to the escs.  Don't worry about the way you wire them for now: 



For the props section of the motor, all you need is the prop screw.  Put prop in and then put the prop nut on top.  However, don't put the props on right now.  Do it before takeoff and also put blue thread locker on the nut and props so they would stay on.  MAKE SURE to follow the proper propeller and motor configuration (the motors will be configured later on). For now, make sure that the clockwise and counter-clockwise props go on correctly.  Look at the following image for guidance. 

Note: HQ props with the letter R at the end means that it is a clockwise prop.  Also, prop one is supposed to place at the top left arm of the quadcopter frame.  (The side with the battery strap is the back).

Step #4 - Connecting the ESCS, Flight Control Board, and Receiver 
Note: You might have to customize the wiring from the receiver to the flight control board.  Do this when the transmitter controls are wrong during configuration and calibration.  

Connecting the ESCs:

Wire the ESCs starting from top left.  Then go to top right, bottom right, and then bottom left.  
You should wire them by first connecting the top left ESCs wires to the ESCs pins on the board (the ESCs pins have three pins while the receiver pins have two).  Connect the first ESCs wire to the ESC pin port labeled one under the word "Motors."  Lastly, make sure the yellow wires of the ESCs face up.  You can customize the settings for the ESCs with the AFRO ESC USB Programming Tool, but it is not necessary at all.  Look at the images below for reference.




Connecting the Receivers:

Before you start, you will need to customize the frame of the receiver a little.  Get a knife and cut the sides of the bottom frame a little so that the bottom frame would be able to bend out.  Then plug in the bind pin and five other servo wires. Start by plugging in the bind pin into the bind/data port and then place the other servo wires after it in the ports next to it. Afterwards, tape the receiver parts onto the top of the quadcopter frame with velcro.  Wiring the receiver wires to the proper flight control board is where it gets complicated.  Since both the receiver and remote are actually meant for planes and helicopters, configuring it for quadcopters becomes quite difficult.  First, leave the bind pin where it is.  Then connect the fifth, or last, servo wire that is connected to the gear port of the receiver and connect that one to the 5v port of the receiver channels.  The red wire should be connected to the top pin while the black wire should be connected to the bottom pin.  Leave the white wire unconnected.  For all the other wires, the white wire should be connected to the top pin while the red wire should be connected to the bottom pin.  The black wire would be disconnected for all the other ports.  The next few wiring instructions might have to be changed if the transmitter signal commands are wrong during calibration (which will come later on).  For now,  connect the wire on the "Thro" port to pin port 4, "Ale" to pin port 1, "Elev" to pin port 2, and "Rudd" to pin port 3.  Look at the images below for reference of the cutting, mounting, and connections of the receiver.  





Step #5 - Charging the Batteries
Don't get excited, your quadcopter cannot take off yet.  Batteries are needed for the calibration and the configuration process.  Plug the power supply in and then connect the charger to it.  Then, connect the battery to the charger and the positive and negative wires that came with the charger to the charger..  Make sure use the battery adapter so the battery be plugged in.  Also, connect the other data wires to the data port of the charger.  Then press the Type button and make sure it is on Lipo.  Then press start, which will then flash the certain numbers, which are the settings for charging the battery.  Change the numbers by pressing the two arrow buttons.  The numbers should be 3.3A, 11.1V, and 3S for us.  Then, hold on start and click enter if it asks you.  It should start charging now.  Remember to never completely drain your battery or leave them uncharged for long periods of time.  



Step #6 - Getting the required software

**Note: for the next two sections, you can just go to Aeroquad's manual.  Although it does offer a more detailed and comprehensive explanation, my post would be better for beginners because of its simplicity.  You can go to the manual as a beginner if my method somehow doesn't work.

1. You will need to download the software that will allow your computer to communicate with the flight control board.  Download the packages here.
2. Extract the folders to another folder dedicated for this quadcopter build.
3.Install "VCP_V1.3.1_Setup.exe" or "VCP_V1.3.1_Setup_x64" (depending on your operating system) found in the "...\01_OneTimeSetup\01_InstallVirtualComPortDriver" folder.
4. Plug in your AeroQuad32 board and wait until the drivers finish configuration.
5. Pay attention to what COM port is assigned.
If the assigned COM port is not within COM1-COM9 reassign the COM ports to make it so. To do this, open the Device Manager, right-click on the device and select "Properties". Click on the "Port Settings" tab, then on "Advanced..." and in the upcoming windows change the "COM Port Number" value to a free port between COM1 and COM9.

6. Then, unplug the USB cable connected to your Aeroquad board and then reconnect it.
7. Go to the folder where you extracted the softwares to and go to "...\01_OneTimeSetup\02_ConfigureBoardIntoDFUeMode".
8. Edit reset.bat with notepad and change the first lines COM port to your COM port.
9. Save reset.bat
10. Run reset.bat
11. Go to "...\01_OneTimeSetup\03_InstallUSBDriver".  Run the zadig executable (be sure the board is in DFUSe mode first).  Click on "Options" and select "List all devices".  Click on STM32 Bootloader from the pull down menu and click on "Replace Driver."
12. Unplug then replug your Aeroquad Board.

Step #7 - Uploading the Software and Calibrating the Flight Control Board

1. Install the the Aeroquad Configurator and then restart your computer.
2.  Make sure that your Aeroquad Board is connected to your computer.
3. Open Aeroquad Configurator.
4. Select the correct COM port and press connect.
5.  Then, click upload. 

***Note: Make sure there are no power supplies or anything that produces an electric/magnetic field near your quadcopter during calibration.
6. Click on Initialize EEPROM and connect your charged battery to the quadcopter.
7.  Click on transmitter calibration.  Bind your transmitter to your receiver by holding up the trainer lever before turning it on.  Keep on holding it for a few seconds when you turn the transmitter on.  If the orange lights on the receiver becomes still, your transmitter will be binded.
8. Follow the instructions on the screen.  If the transmitter's controls are wrong, plug in the receiver wires in a another way.  Do that until it works.  If the transmitter's controls are right but moving in opposite directions, click on the scrolling button on the transmitter.  Scroll to the bottom, and click on "Setup List."  Then scroll and click on "Reverse."  Click on the controls that are reversed and click on it until the "N" becomes and "R."  
9. Now you need to calibrate the ESCs.  Make sure the battery is still connected and make sure that the propellers are removed.  Just click on Electronic Speed Controller Calibration.  If it takes forever, after calibrating the high and low throttle positions, just click "OK" and end the process. The quadcopter will work just fine.


10.  Then, click on the Gyroscope, Accelerometer, and Magnetometer Calibrations.
11. Those calibration processes are very self-explanatory; just follow the instructions on the screen and make sure your quadcopter is far away from electric/magnetic fields.
12.  However, make sure that the quadcopter is flat and still during gyroscope calibration.  Make sure that the quadcopter is exactly positioned as the images during the accelerometer calibration.  Lastly, rotate the quadcopter more than once during the magnetometer calibration.
13.  After calibrating all of those sensors, click on 3d-view on the Information Display pull-down menu.
14. Make sure that the quadcopter is mostly still and turns in the right directions when your move it.  If it spins uncontrollably or doesn't react properly, recalibrate the sensors.  I had to recalibrate them multiple times.



15.  Then, go to "Motor Commands" from information display, with the battery attached.  DON'T PUT PROPS ON YET!!! Raise the slider for one of the motors and then click on "Send Motor Commands."  Check that the right motor is spinning in the right direction.  If the direction is wrong, rewire the motor wires.   

Follow this diagram for making sure that the right motor is spinning in the right direction.
16.  These are the motor wirings for me: 
Clockwise: Black is with black, red is with red, and yellow is with blue.
Counter-Clockwise: Black is with red, red is with black, and yellow is with blue.
17. Go to the vehicle status menu. 

18.  Make sure that the commands are all working properly.  Arm the quadcopter by moving the left transmitter stick to the bottom and then bottom right. Check to see if everything is working by following the instructions on this page.  Disarm the quadcopter by moving the left transmitter stick to the bottom and then the bottom left.
19.  Put on the props and you are almost about to FLY!!!

Step #8 - Get a Quadcopter licence.  
You must do get a Small UAS Certificate of Registration for this quadcopter in order to fly it legally.  Go to this site, pay a small fee, read the rules, and print out the certificate.  Then, write down the licence number on a piece of paper and tape it to the bottom of your quadcopter. 

Step #9 - TAKEOFF
Bring your quadcopter to a grassy field.  Arm the motor and takeoff.  However, it is highly recommended that you first train in a quadcopter simulation (it's best to train with one without altitude holding capabilities).  If you quadcopter is tilting towards the battery side, add a counterweight on the other side.  After flying this, you can customize your quadcopter thanks to many options built into the Aeroquad board.  You can plan out flight routes by getting GPS addons, set up altitude holding by configuring some of the sensors, know your battery percentage, and even get a first person view with the on-screen display capabilities of the Aeroquad board.  There is so much more you can do with it!  Although this first build may not be as good as ones designed by multirotor companies, you can make it better by changing some of the parts, like the battery or the receiver.  Lastly, you can even solder on a Luminier gimbal and attach a GoPro to it to record your flights!  I have attached a really short clips of the quadcopter taking off below.



Stay tuned for more tech-related posts!!!☺

Thursday, June 30, 2016

AR Drone 2.0 Automated Panaramos

https://github.com/eschnou/ardrone-panorama.git provides a really cool npm ar drone ponarama software.  Now once you have installed it, you can start taking panoramas!  All you need to do is to connect to your AR-drone on your computer and type "node panorama -h5"(The five would cause the drone to take the panorama at five meters in the air; you can change the height settings).  The terminal will now start displaying messages related to the calibration and picture taking process (such as which picture it is on).  During the flight, all the photos will be taken as a .png and be stored in the bin folder of the panorama folder.  In addition, a flight log will be created under the name of navdata-date.txt.  Then, in CMD, type:

var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.land();

Since the drone takes the panoramas in separate pieces, you will now need to stitch the photos together with a panorama stitching software.  You can do it with Photoshop, here, or with a great free program made for panorama stitching called Hugins (you can download it here).
Some extra things you can do is by editing the original javascript file (it is located in ardrone-panorama\lib and is called panorama.js).  The original author of this file, Laurent Eschenauer, left a lot of instructions and comments on how the program was coded; this would allow you to change the settings of the automated panorama.  One thing I changed was the amount of photos it took for the panorama.  You can also do this by opening panorama.js in notepad and changing the number in the line in  "this._pictures = options.pictures ||."
I will post more tutorials about the AR-Drone and node.js later on... Stay Tuned!!!☺

Wednesday, June 29, 2016

AR-drone Programming Update

About a month ago, I posted an article about controlling the A.R. Drone with the computer.  Since my last post, I have learned a lot about coding the drone.  I've got it to move around with the computer and I 've made pre-scripted codes that run directly from Node.js command prompt.  

Here are a few examples of the coding I have done :
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.takeoff();
client
  .after(5000, function() {
    this.clockwise(0.5);
  })
  .after(3000, function() {
    this.front(1.0);
  })
  .after(1000, function() {
    this.stop();
    this.land();
  });
This will make the drone take off, rotate, fly forward, and land.
var arDrone = require('ar-drone');
 var http    = require('http');
 console.log('Connecting png stream ...');
 var pngStream = arDrone.createClient().getPngStream();
 var lastPng;
 pngStream
   .on('error', console.log)
   .on('data', function(pngBuffer) {
     lastPng = pngBuffer;
   });
 var server = http.createServer(function(req, res) {
   if (!lastPng) {
     res.writeHead(503);
     res.end('Did not receive any png data yet.');
     return;
   }
   res.writeHead(200, {'Content-Type': 'image/png'});
   res.end(lastPng);
 });
 server.listen(8080, function() {
   console.log('Serving latest png on port 8080 ...');
});
This will stream the video live (you will need ffmpeg installed for this to work) from the drone into your browser at http://localhost:8080/ (this trick was taught to me by instructables)
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.config('control:altitude_max', 100000);
Since the Ar-drone module sets the default max height to three meters, this code would set it to 100 meters.
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.takeoff();
client
  .after(5000, function() {
 this.animate('flipLeft', 15);
})
  .after(1000, function() {
    this.stop();
    this.land();
  });
This code would make the drone to a flip.  I recommend that you add a height code to make sure the drone does not hit the ground during the flip.
To control your drone from your browser, download nodecopter-monitor:
:
var arDrone = require('ar-drone'),
    client = arDrone.createClient();
require('nodecopter-monitor').init(client);
For the list of controls, click here.
For more amazing modules (such as AI flying and taking panaromas go to www.nodecopter.com)


Currently, I am working on getting the A.R. Drone to identify and follow the commands of QR codes.  Right now, all I know is that one would need opencv and qrar (can only be used if you have ffmpeg, gtk, and npm).  
Some people might wonder how to control the small Bluetooth drones.  My friends and I have found an app for the ipad/iPhone to control it.  The app is called "Tickle."  It has a Scratch-like interface (drag and drop coding) and is very easy to use.  We held a competition to see who can get it to fly a definite path (it was very hard to manipulate the distance variables) and land at the right destination.  
I will post more stuff about A.R. Drone programming later on.  Stay tuned!

Ar-drone controlled by PC


This week, I met up with a few of my friends and decided to attempt to control an A.R. drone from a computer.  I was a very complicated process and we made many mistakes.  However, today, we were able to get it to take off after two days of research and tests!  Some sources we used to figure the process out included stackoverflow, nodecopter, instructables, and yahoo answers.  In this post, I will describe to you what we did and how you will be able to code and control your A.R. Drone from your computer!
All you really need is the ar drone module from npm.

var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.takeoff();
client.land();


Yay!  Now your drone should have taken off and landed.  Our project is still in development.  Any updates will be posted.