Showing posts with label Robotics. Show all posts
Showing posts with label Robotics. Show all posts

Monday, October 23, 2017

Which Programming Language Should I Learn?


Subscribe by Email!
Investing time into learning a first (or new) programming language is a seriously-time-consuming endeavor. For me it wasn't something to take lightly, as I knew I'd be investing thousands of hours into any given single language when I began. When people ask which programming languages they should learn or use, a great way to make recommendations is to consider these 3 things:
  1. Popularity
  2. Is it a scripted (interpreted) or compiled language, and how does that affect what I want to do with it?
  3. Which languages are most used in my industry or application?

1) Consider the popularity of languages. The more popular the language, the higher the priority it should be, within reason, since that's what industry uses and that's where you're going to find the most resources, help and support, compatibility with others, and jobs. The TIOBE index is the place to check:
"TIOBE programming community index is a measure of popularity of programming languages, created and maintained by the TIOBE Company based in Eindhoven, the Netherlands.[1] TIOBE stands for 'The Importance of Being Earnest' which is taken from the name of a comedy play written by Oscar Wilde at the end of the nineteenth century.[2]" (https://en.wikipedia.org/wiki/TIOBE_index).



Here's the index for 2017: https://www.tiobe.com/tiobe-index/. As shown above, the top 6, in this order, are:
  1. Java
  2. C
  3. C++
  4. C#
  5. Python, and 
  6. JavaScript. 
My top 3 recommendations are Java, C++, and Python, but not necessarily in that order. When it comes to you and your personal needs, goals, and desires, however, you need to choose for yourself! Here's some tips to help you make that decision.


***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!***

Saturday, May 14, 2016

BattleBots Season 2 "Buzz" Fire Drone for Team Caustic Creations, with Team Interviews & fire-shooting Videos


Subscribe by Email!

By Gabriel Staples 
Written: 14 May 2016
Last Updated: 25 Apr. 2017
Update History (newest on TOP):
 - 25 Apr 2017 - updated "motor and prop sizing calculator" link below from http://adamone.rchomepage.com/calc_motor.htm (broken) to http://rcplanes.000webhostapp.com/calc_motor.htm (new).
 - 11 June 2016 - updated article intro below, and added the big Battlebots photo below, since BattleBots just posted it a few days ago. Also added team photo & link to buy our T-shirts on the BattleBots store.

Related Articles:

I'm the creator of a fire-shooting flame-throwing battle drone (multi-copter), "Buzz," who is an air robot hexacopter companion to our ground bot killing machine, Poison Arrow, of Team Caustic Creations (see our team Facebook page here), on ABC's BattleBots Season 2 (see our BattleBots page here, buy our T-Shirts to support us here), which will air on ABC starting 23 June 2016. I'm just one of 5 members on our team. Our main bot is "Poison Arrow." Read below for some crazy-cool fire-shooting drone previews and build drama of Buzz, as well as team & bot interviews made by our sponsor, Arrow.comshowing and discussing both robots.
Photo Source: https://www.facebook.com/battlebots/posts/10153603634031406

Build drama: why's fire gotta be so complicated!?



So, from ~17 Feb. 2016 to 14 April 2016, I worked frantically to get my fire drone, "Buzz," built from scratch and working in time for the BattleBots Season 2 competition, which was filmed in Los Angeles, CA from 15-25 April. It was very very frantic indeed. It was a very difficult project it turned out, and took me approx. 300 hrs before going to the event, in addition to another 100 hrs or so spent working on the vehicle, writing more code, and competing at the event. It also just so happened to be my first ever multi-rotor I put together from scratch (but don't worry, I've been using them for years and I have a lot of background research experience with them). Zach Goff, our team captain, worked with me to size the vehicle too. Putting our experience and skills together for that part was very helpful, as was this motor and prop sizing calculator here.

I meticulously wrote a couple thousand lines of C++ code (some of which I started years ago, before I had the skills to complete it) running on the vehicle in order to give me greater control over it, for future additions and work which I hope to implement later in order to add more autonomy, hopefully for Season 3 next year. While at the event, in my frantic last-minute coding, I was even able to get a serial BlueTooth device working on the vehicle, and I implemented a custom command-line interface, from scratch, to configure parameters on-board the vehicle using my Android smart phone. I was pretty excited about that! :).

So, without further adieu, here's the result of my hard work. This is a GIF I created from a teaser trailer that ABC made for their show. This was pulled from their teaser trailer here, at approximately 1:40. The teaser is pretty awesome; you should watch it!

As you can see, the vehicle is shooting fire. That....it turns out, was pretty stinking hard. Of my 300 hrs spent on the vehicle prior to the event (I actually logged 288.5 hrs in my project spreadsheet, but who's counting), probably *half* of that was spent just on the flamethrower. I ran into *many* problems, and each was hard to overcome. It turns out making things burn isn't as easy as one might think...especially when you need it all to be remote-controlled (RC). I had to build custom circuits, write lots of code, do some fancy programming in my Tx running OpenTx, and play with lots of hardware. Needless to say, however, I learned a *lot*...and also ruined, burned up, and destroyed some parts along the way.


***Subscribe by Email!***

Friday, March 18, 2016

Building for BattleBots - with Team Caustic Creations


Subscribe by Email!
By Gabriel Staples
Written: 18 March 2016
Last Updated: 24 March 2016 - added BattleBots 2015 Championship sample video

A Few Other Articles:
Our ground robot & drone (multicopter) builds for BATTLEBOTS: follow us on social media via the links below!

(What is BattleBots? - here is a sample video below of the championships from last year)

So, aside from my IR remote-controlled car horn/siren project, about which I posted a couple sample videos previously, I have undertaken a new project recently: building an air vehicle for the hit robot fighting TV series, BattleBots, which will be hosted by ABC this year. You can see a sample episode above, which is the final championship fight from BattleBots 2015. I was not a part of that event. For BattleBots 2016, however, I will be participating by building a secondary, fighting drone/air vehicle which will fly and shoot fire.
(see some of my preliminary flamethrowing trials below)


***Subscribe by Email!***