Showing posts with label Arduino motor shield. Show all posts
Showing posts with label Arduino motor shield. Show all posts

Wednesday, April 24, 2013

ProtoCylon: Tell Me How You Feel

ProtoCylon: Tell Me How You Feel

By Bobby Neal Winters
I’ve discovered that it’s been exactly two months to the day since I’ve blogged about my robots. There is an alphabet of reasons: HLC, PSU in PY, and NALM.  This is to day we had an accreditation visit at the university in early March; I took a trip to Paraguay in Mid-March; then in late March and early April I’ve been mowing the lawn and watching my beautiful, youngest daughter play soccer on the weekends. While I could whine a little about getting older and not bouncing back from the Paraguay trip as quickly as I would’ve liked, I will skip that.
Suffice it to say that this weekend, my beautiful, youngest daughter played soccer on Friday night; I mowed Saturday morning; then Saturday afternoon I began to play, er, work seriously on my robot once more. I decided I needed to know when it thought it was stuck so I put a couple of LEDs in the system to let me know what state it was in: trapped or not trapped.  I did this and promptly the robot ceased to function correctly.  
The robot is supposed to go straight until it encounters an object.  When it encounters an object, it goes into a trapped state and accesses its getFree function.  In its get free function, it turns alternately left and right in a struggle to get free.  
After I installed my upgrades, this no longer happened.  It seemed to simple act as if it were trapped all the time.  
I was confused.
I know what you are thinking: When I put in the LEDs, I messed something up.  That was the first thing I thought, so I inspected the program to look for conflicts and found none. (Remember this sentence verbatim because its important.)  Having dealt with the programming issues, I began to inspect my motor shield.  This is the special board I’ve got my motors hooked to the Arduino through.  I did a bit of experimenting, including changing how the motors were hooked to the motor shield.
This experimentation determined that the motors were both fine, but there seemed to be a problem with electrical connections for the right wheel motor.  I suspected a short.  I thought--briefly--about desoldering it to fix it.  I thought--longer--about buying a new motor shield.  Then today as I was playing, er, working on it seriously, I read the top of the motor shield.  It is quite an intricate little device with places to hoot in servos and what have you.
I was looking it over and saw that by Pin 9, to which I had hooked an LED, there was a label that read Brake A.  When I was sending current to Pin 9 to light that LED, I was applying Brake A which was (drum roll please) the right side. I moved the LED and the problem was solved.
It was a little thing, but it gave me such a RUSH!
It’s that childlike feeling of discovery. I hope I never lose it.

Sunday, February 10, 2013

The Proto Cylon: Muscles on the Beast

The ProtoCylon: Muscles on the Beast

By Bobby Neal Winters
As I mentioned earlier, I am using Beginning Arduino by Michael McRoberts. It hasn’t failed me yet.  I’d also mentioned that my ProtoCylon’s robot body will be a car which will be run by a couple of motors.  In order to control the motors, transistors are required.  I wrote about using them in ProtoCylon: Control. There I used a temperature sensor to control the motor of an electric fan. Pretty cool. (Pun fully intended.)
I’d had visions of having to solder a couple of transistors to a pc board in order to control the motors on my robot.  That was before I learned about the Arduino Motor Shield.  The Arduino Motor Shield takes care of the transistors for you.  It also takes care of connectors for the power in and power out.
While an earlier version of myself would’ve insisted upon doing this the hard way, at 50 I am quite happy to use the scaffolding.  My skills soldering are steadily improving--not like they could get worse--and I am gaining confidence.  But I do like to be able to measure progress in visible ways, and today I did.  The robot moved.  See below:What you see there are motions that were pre-programmed.  I didn’t even write the code myself, though I did key it in.  While this is very fulfilling, I am not nearly done.  In order for this to really be a robot, it will have to be able to take input from the outside.  Remember the model: Input; Process; Output.  
I’ve got to decide on the mode of input.  There are two ways I am currently considering.  The first of these is to use my UltraSonic Sensors.  See ProtoCylon Senses.  These I could use to keep it from running into walls kind of like a bat.  The second model is that of the line following robot.  This would require light sensors.  It would have eyes.  I need to think on this a while.