Category: Embedded

Subcategories: AVR Ichibot

July 07, 2008

Electric Motorcycle Project

I’ve decided to convert my old motorcycle to electric. This involves ripping out all the gas-related parts, and putting in an electric motor, batteries, and associated control electronics to make it all work. I’ve started a new blog for the project, go check it out:

The bike in San Marcos, CA

Electric Motorcycle Conversion Project

Posted by rmann at 02:12 PM | Comments (0)

April 19, 2008

Solar Thingie

I came across a page about peak-power tracking in solar PV applications. I decided I wanted to goof around with solar stuff, so I started tinkering. This is what I have so far:

Solar Thingie thumbnail, click for larger version

So far there’s not much going on. It measures voltage generated by the panel, and current being delivered to the load (a little red LED in this picture; the circuit is powered from a bench supply). I started adding a 5-volt LDO, which I’ll use to regulate power to the MCU and LCD when powered from the panel.

If I can get AVaRICE to stop hosing my ATmega324P parts, I’ll slow this down to 4 MHz (it’s running at 16 MHz here) and power it from 3.3 V. That should work better in actual sun-powered applications.

Posted by rmann at 03:01 PM | Comments (0)

January 20, 2006

Soekris net4521 Single Board Computer

I got my net4521 a few days ago, and after borrowing a CF card (‘cause I stupidly forgot to get one of my own), I had it up and running Pebble Linux (from Tor Amundson) in no time. A few days later the CM9, miniPCI 802.11a/b/g card, arrived.

I’ve been poking at getting the 802.11 card up-and-running, and met with some success. Right now a kind soul is helping me learn how to use buildroot to build a Linux from the ground up for use on this box. We’ll see how that goes, and I’ll try to post the steps here.

Posted by rmann at 05:56 PM | Comments (1)

January 09, 2006

Site Updates

I’ve migrated most of the Ichibot status page entries to MT. FWIW.

Posted by rmann at 04:48 AM | Comments (0)

January 04, 2006

ATmega32 PWM

This note briefly describes how to set up PWM on an ATmega32. In this instance, Timer/Counter 1 (16-bits wide) is used to set up a Fast PWM-mode PWM wave to drive a typical R/C servo. The PWM period is 20 ms (50 Hz), and the pulse width varies from 0.9 ms to 2.1 ms.

Continue reading “ATmega32 PWM”
Posted by rmann at 04:14 AM | Comments (4)

July 03, 2005

Improved Motor Platform, Assembled

Okay, so I lack focus. Too many projects. School and work, whatever. I’ve finaly gotten most of the parts for the new base constructed. I used EMachineShop to make the motor mount brackets, and found EPPCO, a local Berkeley machine shop, to do the axle block.

Assembled base three-view Assembled base overhead (actually underneath)
Assembled base three-view Assembled base overhead (actually underneath)
Assembled base side view Drive train closeup
Side view Drive train closeup
Drive train overhead
Drive train overhead view
Posted by rmann at 01:34 AM | Comments (0)

March 05, 2005

Improved Motor Platform

Wow, it’s been a long time! But in an ongoing effort to avoid studying and homework, I’m mucking about with the Ichibot and associated pages.

Even though I haven’t gotten very far with Ichibot, I’ve decided to build a new, better mechanical platform for it. I’ve designed the chassis, and am currently looking for way to get it machined. I’ve also purchased the necessary hardware, pictured below (click the images for a larger version, or the links for a huge version).

Bearings, shafts, collars, pulleys, belts, motors Hardware partially assembled
Full-sized image of separate parts Full-sized image of partially assembled parts


Full-sized image of separate parts Full-sized image of partially assembled parts
The new Pittman motors (part GM8724S021-R1) are much better than the old JameCo motors. They are 12 VDC motors with 60.5 : 1 reduction gearheads and 500 CPR encoders. They were $195 each, and I’m a little concerned that I ordered too much gear reduction. Some people on the robotics lists have all suggested I’ll be happy to have the torque, and that the output shaft speed is sufficient. We’ll see.

The new chassis will look something like this. I need to redo the CAD. I’ll post complete drawings and make the files available.

CAD view of new chassis Underside of new chassis

Posted by rmann at 06:29 PM | Comments (0)

February 18, 2004

‘Bot in Action

Yesterday I added training wheels to the bot and allowed it to run free in the kitchen. The “training wheel” is a simple furniture caster attached to a 1.5” wide piece of aluminum bent in two places and bolted to the frame. The controller is running a very simple navigation program. It basically goes forward for two seconds, turns right for one, repeat. The timing is too far off to make any kind of recognizable shape, but it was a chance to see the ’bot in action.

Side view of ’bot with caster Bottom view of ’bot with caster Closeup view of battery connectors

There’s also a short high-power burst forward and backward (and forward again) to qualitatively determine what kind of torque characteristics the system exhibits. Interestingly, it’s enough to kick the caster wheel up off the ground, despite having two battery packs strapped to it.

For its first untethered tests, I added two 6-cell, 3000 mAh NiMH battery packs (the kind used in electric R/C race cars and planes) wired in series to give a nominal battery voltage of 14 V. This makes for rather large drop across the controller’s main regulator (and might even be outside the spec; I’ll have to take a look). Perhaps I should tap off of one of the batteries for powering the electronics.

Posted by rmann at 06:10 PM | Comments (0) | TrackBack

February 16, 2004

PID Controller

What a crummy day. I spent so much time fiddling with the LCD code that I broke. I had started writing a basic PD speed controller. I was writing a fair amount of info to the LCD during the PD loop interrupt, which was taking quite large portion of the available executiong time, so I tried to tighten up the LCD code (more details in a later post). Well, I broke it. Many, many hours later, and after fixing it and having it all of a sudden stop working multiple times, I got it and the PD code working.

Now, I based this off an old article written by David Anderson. It does something interesting. If you command a speed of zero, and then turn a wheel by hand, it will resist that effort like a spring. If you then release the wheel, it will rotate back to its approximate starting point.

The calculation of the PWM signal is cumulative, even if there is an error of zero, so the PWM is being integrated (I think). I need to brush up on my understanding of PID controllers to figure this one out.

Posted by rmann at 02:04 AM | Comments (0) | TrackBack

February 14, 2004

MMC Works

Okay, I’m a dork. I made so many mistakes trying to figure out this serial communications thing, it’s not even funny. But, I’ve got it working now.

Two major things went wrong. First, I failed to realize that the ’32, by default, operates off of its internal 1.0 MHz oscillator. You have to program clock selection bits as a separate step to get it to use an external crystal (which I had connected, but didn’t realize wasn’t being used). Since all of my baud rate calculations were being done assuming a 4.0 MHz clock, they were way off (which explained the bizarre timings I was seeing on the TX pin).

Continue reading “MMC Works”
Posted by rmann at 09:57 PM | Comments (0) | TrackBack

February 13, 2004

Site Updates

The reorg is well under way. Some of you may experience issues with the rendering. All I can say is, “get a better browser!” In general, I’m using Safari, and only occaisionally testing on IE/Mac 5.2. Windows users, well you can just fend for yourself. Sorry!

Posted by rmann at 08:43 PM | Comments (0)

Added Wheel Encoders & MMC

Got the second wheel encoder hooked up, and replaced the other wheel. I also hooked up the MMC, but for whatever reason have not been able to get the serial communication between it and the ’32. I can see the pulse train on the ’scope, but the MMC fails to recognize the transmission.

Posted by rmann at 02:35 AM | Comments (0) | TrackBack

February 12, 2004

LCD Works!

Outstanding success! I figured out the problems I was having getting PORTC’s pins to Respect My Authoritaaa…

Turns out that JTAG is enabled by default on this device, and for some reason disabling JTAG internally didn’t work. I tried writing the bit by assigning it twice in succession in gcc. Instead, I changed the fuses to disable JTAG, and that cleared up the problem.

An interesting side note about how I realized it was the JTAG settings getting in the way: I was thinking that perhaps some alternate function of the PORTC pins might be getting in way, but it didn’t dawn on me which function until I ran a simple sequential count on the pins in fairly rapid succession, using the STK500 LEDs to show the output. Lo and behold, only the least- and most-significant two bits changed state. Checking the docs, sure enough, the remaining bits were all dedicated to JTAG.

Continue reading “LCD Works!”
Posted by rmann at 12:41 AM | Comments (0) | TrackBack

February 10, 2004

AVR Goodies Arrived

A couple days after I bought theBasic Stamp, my Atmel kit arrived, pretty much destroying any hopes for the poor Stamp to be a part of this project.

I set up the STK500 and the pre-programmed AT90S8515 started pulsing an LED on the board. Then I installed the AVR gcc toolchain on my PowerBook, and a couple of hiccups later (you have to explicitly erase it before programming), I was writing C code and watching LEDs blink. The AVR gcc toolchain worked very well on Mac OS X, but I did have to make a minor change to one of the include files to get it to compile for the ATmega32. Targetting the AT90S8515 that came with the STK500 worked without modification.

Continue reading “AVR Goodies Arrived”
Posted by rmann at 08:35 PM | Comments (0) | TrackBack

February 03, 2004

Switching to AVR

I haven’t worked on this project much for the last six months. Between full-time school and a full-time job, it was really very difficult to spare time for anything else. Having made this project into a priority for my eductional efforts helps me to justify working on it.

Given the difficulty I’ve run into getting a C compiler for the PIC to work on Mac OS X, and taking the advice of a friend, I’m going to switch from plans to use a PIC18Fxxx to instead using an Atmel AVR. There’s an open-source toolchain that works on Mac OS X and includes gcc. I expect the programmer and chips to arrive on Wednesday.

In the meantime, I’ve discovered the Parallax Basic Stamp. I don’t really intend to do too much work in Basic, but thanks to the availability of the very nice MacBS2, I bought a BS2p40 from JameCo and had it blinking an LED in under an hour (including the time it took to make a serial cable).

We’ll see if I can make it interface to the MMC and inertial sensors; it has no A-to-D converter, so I’ll either have to add one, or find some alternative. I don’t know what peripherals are available on the SX core used in the BS2, and I really don’t know if it will be fast enough to do all the necessary things.

I’ve added some shots of the ’bot so that you can see there’s more to it than just some beautiful hubs & tires.

Posted by rmann at 12:53 AM | Comments (0)