Tuesday, January 16, 2007

Video!

I made a quick 20second video of my ball launcher in action. Don't be too critical as it's on;y a quick and dirty to test my progress but several friends requested it so here is is http://www.youtube.com/watch?v=r30vDsLaZn8

Oh, and here is a shot of the new wiring I did over the weekend:
Note the labels, the braided cables, and the empty spot on the right side for the mouting of the launcher.

Onward,
Jay

Monday, January 15, 2007

Monday, January 15, 2007 Update:

I got inspired to do some wiring on my project this weekend. I made 4 connectors for the encoders and motors. I also started working on the ball launcher. I took my 2” 90 degree PVC elbow and started hacking at it. I am using a DIY brushless motor I built for flying RC airplanes to drive the launch wheel www.gobrushless.com. The wheel is foam landing tire which I tapped for 3mm (to fir the motor shaft thread) and secured with a nyloc nut. I am using a homemade mount I turned from nylon previously to mount it to an “arm” of blue PVC. The arm will screw to a block of Delrin I have JB Welded to the modified elbow. This will allow me to adjust the motor/wheel assembly up and down, and the threaded motor shaft will allow me to adjust the wheel position with respect to the center of the tube.

The launch motor will be driven by a BL ESC (electronic speed control) that I have which is in turn controlled by the MAVRIC via a standard servo signal. The balls will be fed to the launcher via a turnstile gate controlled by another servo.

I’ll post pictures if my ISP is back up tonight. Hopefully I’ll get off my duff and actually write some code to make this thing move.

Onward,
Jay

Saturday, January 06, 2007

Where have I been, what have I been up to?

Great questions. I have been researching and procuring a benchtop mill. It should make it easier and more fun to build parts of this robot, but it’ll become it’s own project as well. I plan to convert it to CNC (CNCZone). That said, I have not put much time into doing anything on this project except read some books on subsumption during this time.

I’m hoping I’ll get inspired to work on it this weekend, but right now, CNC and machining have piqued my full interest.


How the mill comes packed and crated. First order of business was to clean the protective packing grease off.


The mill installed in it's new home. Not sure I'll be needing the drill press or not. Need to find it a new home.

Onward,
Jay

Saturday, December 16, 2006

Progress update December 16, 2006:

As you can see from these two images I have made great strides in building the mobile base.

Today I:
  • Mounted the two lower decks where the casters mount
  • Mounted the casters
  • Machined some standoffs from acrylic rod (see the second image)
  • Attached the motor mount assemblies with angle brackets (very stiff and perpendicular)
  • Made a mount for the sonar (using 3mm PVC)
  • Redid the sonar cabling (using 22ga stranded versus the solid, and following my wiring standard layout)
  • Mounted the sonar

From the front:

Note: the front lower deck will also be the mount point for the line following sensors. You can see two of the angle brackets I'm using to shore up the motor mounts. At this time the bot weighs just over 2 pounds ... largely due tot he motors and encoders.

From the rear:

Note: I used the acrylic rod because I have 20 feet of it that a friend gave to me. I am considering lighting it with LEDs … but that's for a later time. This deck with also hold the Lipo pack.

To do:
It might help if I actually kept up with my todo lists but I use them as a brainstorm tool and right now my mind is racing with ideas.
  1. Resolder the motor controller circuit
  2. Rewire the encoders with longer leads using my wiring standard (which is to say the same as a servo lead) | GND | 5V | SIG1 | SIG2 …
  3. Get this bot mobile with some simple code to count encoder pulses and drive a square
  4. Add in PID to start using waypoints and let the "algorithm" decide how to get from A to B

Onwards,
Jay

Monday, December 11, 2006

December 11, 2006 progress,

I was on a roll this weekend and have some photos of my progress to share.

This first photos shows how I printed templates for my motor mounts. I first cut the mounts to their final width and height, glued them together with wood glue (tried spay adhesive first but it was too messy), glued the template on, marked the holes with a center punch, and drilled the mounting and clearance holes on my drill press. The photo below is my first design. Taking a page from my RC airplane days of constructing planes from foam, I added tabs and slots.

Note: I originally drilled the holes the same for both side, but due to the motor shaft being offset it was not symmetric like the encoders. Also, the mounting hole closest to the output shaft is too shallow for the screws I had. What is, was symmetric are the two mounting holes at 180 degrees which is what I am using.



The second image shows the motor and encoder mounted along with the gears and wheel. The motors are heavy and the assembly feels like it weighs half a pound or more (will measure it and update this post).



To add the mounts again I when with a tab-slot design. I printed a template for the base to locate the slots and used a razor knife to cut them out. I also had to make slots for the small portion of wheel that protrudes through the base.



Next steps are to:

  • Strengthen and square the mounts using l-brackets and a cross bar of some sort. I have some acrylic rod I am going to try. Failing that, I’ll add a skin of 3mm PVC along the bottom to tie them together.
  • I have decided to redo my motor controller board using the ribbon cable wires versus wire wrap. The insulation is better, and I had an issue with intermittent shorts when I tested it before.
  • Create the cables for the encoders to the interface board
  • Make some mounts for the caster wheels (it’s really back heavy right now so 1 may be enough)
  • Write some code to drive in a square

Onward,
Jay

Monday, December 04, 2006

December 4, 2006 update:

Well, I received the gears and wheels that I ordered. The wheels from www.budgetrobotics.com are great.

I used to be fairly proficient with my Taig microlathe, but not Sunday. The gears are bored for .25” (1/4”) but the shaft diameter on the motors is .234”. I decide to make an adapter that would fit better on the shaft and integrate with the wheels and gears. I tried to use some Fortal aluminum, but it wasn’t cutting as well as I had remembered. It took my quite an effort to hacksaw a chunk to chuck in the lathe, and then it kept bogging down on anything but light cuts. It would have taken a day for one adapter to whittle 1.5” down to .375”. So I switched to nylon. All told it took 5 hours to crank out one adapter.

The good news is it works great; the bad news is I have 1 more to make. I’ll post a photo tonight.


Onwards,
Jay

Tuesday, November 28, 2006

11/28/2006 update:

This past weekend I did indeed get some “me” time to work on my bot. I spent most of Friday making the cables and soldering the interface board. I decided to use ribbon cable (old IDE cables) for the point to point wiring versus wire wrap. I really like the way it worked out and can recommend other give it a try too.

I decided against creating four 8-pin cables from the port headers on the MAVRIC to my interface board. Instead, I designed it so that I used all of PortB for one cable and a combination of PortF, PortE and PortD for the other. In other words, I went the wiring harness route.

From left to right, simple switcher power supply, MAVRIC, interface board, encoder, DC gearmotor

I also decided against reusing my tank base for this bot. The vacuum cleaner belts were starting to dry rot and I really wanted to redo the mechanics of the drive. I spent the rest of my weekend looking for solutions to couple the motors, wheels, and encoders. When I finally settled on gears I then began the search for affordable gears. www.servocity.com have a nice selection, but they are very proud of their gears. $4.95 for 1 gear and it doesn’t even have a set screw not is it bored for the ¼” shaft. Instead they want to sell you a hub for another $4.95. I have a micro lathe and can make my own hubs, but $4 is too much for a single gear IMHO. I found Stock Drive after trying www.servolink.com (great prices but $30 minimum order) and MSC (no details on the gears). They hit me with a $3.95 handling charge for using the online store and then another $6.18 for UPS for 4 freaking gears. The gears were reasonably priced at $2.10 a piece. If they had offered USPS I would have picked that. It’s a major pet peeve of mine getting overcharged for shipping. But I digress.

Oh, and I also ordered some wheels ($10 minimum order) from www.budgetrobotics.com . After deciding on the gears, I was able to knock up a model in CAD. The silver motors will be aligned with the center of the 9" diameter disk platform. The red encoders will be linked via the gears. The wheels will be attached to the gear on the motor shaft via 4 screws. I am planning for the gears to be a press fit, but if not, the hubs on the gears or thick enough to drill and tap for a set screw. Failing that, I'll bore out the hub and make a sleeve hub out of aluminum.

Onward,

Jay





This iso wireframe shows how the gears come into play. The base is made from 6mm pvc.


Wednesday, November 15, 2006

11/15/2006 progress:


What have I been up to? Well mainly I have been thinking about how to physically interface my sensors and peripherals to the MAVRIC. The MAVRIC has 6 8-pin headers (he offers screw terminals too) for each port of the ATMega128 cpu. I am being playing with my pin layout to consolidate as many pins on a port as I can. Some pins are too specialized for this (A2D, UART) and thus I have it down to 4 ports.

Also I have three serial devices but only two serial ports. I need to play with bit-banging to one of them (most likely the voice module).

I have not touched the bot in over a week, but I did place an order to www.sparkfun.com for some odds and ends. This weekend I am testing for level three in Krav and then I’ll work on a interface board. But then I’m still in a circle. Do I need an interface board, or do I create custom wiring harness with 5 8-pin connectors on one end and sensor connectors on the other. Or do I create 4 8-pin bus connectors to a connector board and tie the port pins to their connectors using wire wrapping or point to point soldering and then run another connector from the board to the sensor. I like the second method better but it’s more connectors and thus more to screw up.

Here is what my connector board looked like on a previous robot: http://www.geocities.com/jaydmdigital/ieee/jamaica.html 3rd picture.

After I get the whole connector thing decided, I can work on the PID, line sensors, IR sensor, etc… so you see it really is a key decision.

Hmmmmm…

Jay

Thursday, November 02, 2006

11/2/2006 progress:

I tested my PWM code (and corrected a typo in my blog) tonight. I’m happy to report that locked anti-phase is working. The “sings” at the locked position but I can live with that (I think). Hopefully it won’t be louder than the voice chip speaker. Also, using my RC wattmeter my motor never goes above 1A even with a locked rotor (i.e. my stopping it by hand) with a 12V motor source.

So next on the agenda is PID testing. Then onward to line following.

Onward,

Jay

Wednesday, November 01, 2006

11/1/2006 update:

Things have slowed a bit. I decided that the best way to test the line following was to have a moving platform. Therefore I decided to rebuild my H-Bridge circuit. I decided to compare the circuit I built nearly a decade ago with the reference design. Wow, not sure what I was thinking but my component values for the RC blanking circuit were way not right, and my current sense resistor wasn’t even connected.

Locked anti-phase
Previously I was using PWM of the enable pin for speed control and the phase pin for direction. Recently I read about PWM of the phase call locked anti-phase control. At 50% the motor is locked and thus neither moves forward or backward. If the PWM is less than 50% then it moves backward, greater than 50% forward. How much greater or less than 50% controls the speed. So now you get speed and direction with one control line.

New circuit
I soldered up my new circuit with more correct values except the current sense resistor. RS doesn’t carry a .5ohm resistor and paying $5 for a resistor is nuts. Long story short 10ohms was too big and I ended up removing the current sensing and blanking components from the circuit to make it work. Also I need to get a smaller tip for my iron as I had a short (or two) that I had to trace down too. Once I’m sure on my circuits, drafting a PCB seems like a good idea.

Testing
To test my circuit I first tried it as a servo. I must have been high from solder fumes because I knew that PWM of a servo doesn’t use a duty cycle it uses pulse timing (1.5ms for center, 1ms for 0 degrees, 2ms for 180 degrees roughly). So as a quick and dirty I bit banged a 500ms 50% duty square wave. The motor was locked alright but it was singing too. So I tried smaller periods and settled on 50ms. I’m hoping that using the built in phase correct PWM of Timern that I can get a nice smooth 127 steps in both directions with little wasted power at “stop”. I am thinking that I’ll need to add a brake line for each motor to de-energize the motors at 0 speed (50% duty).

PWM
There are 4 timers on the ATMega128 Timer 0 and 2 are 8-bit and Timer 1 and 3 are 16 bit. All are capable of PWM using output compares. If I only need/want 127 steps then and 8 bit timer is enough, but I can see no penalty in using a 16 bit timer either. So here is the scenario. Using the phase-correct mode of operation the period of the waveform is set by the WGMn3:0 bits. Either 0x00FF, 0X01FF or 0x03FF. For 8-bit 0x00FF is what I’ll use. TCNTn will count up to 0x00FF and then count down to zero. If OCRnx == 0 then the output will be zero. Similarly if it is 0x00FF (or TOP) then output will be 1. So first step is to decide the actual period and set the prescaler to get close. The CPU clock is 16MHz. A prescaler of 64 will give us a 4us timer clock source. This means our period will be roughly 2ms (2 * 255 * 4us) or 500Hz. Now we need to configure the Output Compare bits in TCCRnA. We will configure them to 2 (10b) to clear the output bit on up counting match and set it on down counting match. Finally we need to set the DDRx bits for our output pins.

void timer1PWMInit (void)
{
// Set prescaler
TCCR1B = 0x03; // Timer clocked at F_CPU/64

// Init to 8bit phase correct mode 1
TCCR1A = _BV(WGMA0);

// Configure Output compares for A and B mode 2
// output bit will be cleared on match while up counting and set on match while down counting
TCCR1A = _BV(COMA1) _BV(COMB1); ;

// Set DDRB pins 5 and 6 for output
DDRB = _BV(OC1A) _BV(OC1B);

// set motors to 0 or 50% duty for locked anti-phase controller
OCR1A = 0x7F;
OCR1B = 0x7F;

// Enable timer1 overflows
TIMSK = _BV(TOIE1); // enable TCNT1 overflow

}

Onward,
Jay