NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Low speed test run

January 01, 2014
by esoderberg
esoderberg's Avatar

I got my new brushless DC servo working using my custom controller I posted about a few weeks back. As hoped, the tighter control I'm getting out of the new steering mechanism has resulted in much better vehicle stability at low speed. I'm now good to go down to 4 mph, which is when the auto balance kicks in; it used to be a little shaky below about 8 mph and only smoothed out when faster than that.

Low speed and off pavement test run

January 02, 2014
by Rick_S
Rick_S's Avatar

Pretty cool, did you machine all the parts too, or is the base trike something your purchased? What parts are being "computer controlled" and what parts are you controlling?

January 02, 2014
by esoderberg
esoderberg's Avatar

I started with this scooter and tore it up a bit. It took a little bit of welding and some rough metal cutting with a angle grinder, but most of the mechanical part has been pretty simple. The throttle and brake are original to the bike, I just turned them around a little to be used as foot pedals. I steer via a little joystick on the right side - this input goes to my controller (along with speed, gyro, and accelerometer inputs) which handles the rest of it to steer and balance the bike.

January 03, 2014
by Rick_S
Rick_S's Avatar

It's quite an interesting project. What sparked your interest in it and what is your end goal for it?

January 03, 2014
by JKITSON
JKITSON's Avatar

Eric

Fantastic project. You have done a lot of fabrication. Are you using an ATMEGA in the control system? Keep us informed on progress...

Jim

January 03, 2014
by esoderberg
esoderberg's Avatar

I started off using two 328 ATMEGAs and had it running OK. One executed the main control code and the other ran the display. I've since transitioned to using XMEGA chips - they run a little faster (32Mhz), use 3.3v which is compatible with the MPU-6000 gyros I'm using, and have an "Event system" which lets me do a fair amount of activity in the background without the need for interrupts (counting tach hits for dual speed sensors, counting encoder quadrature outputs for the steering feedback, and keeping system time).

The next big upgrade will be a re-work of the front end to a much narrower track and some major body work to enclose the cockpit; it'll probably take me a while to get it all done.

January 03, 2014
by JKITSON
JKITSON's Avatar

Wow I am just upgrading to the 328's.

Jim

January 04, 2014
by BobaMosfet
BobaMosfet's Avatar

esoderberg,

What's your smallest time resolution? Meaning, how fast do you have to check things (like your speed sensors -- every mSec?); How many things are you checking (just an approximate number is fine)?

BM

January 04, 2014
by esoderberg
esoderberg's Avatar

I run through the main control loop at about 1.2 kHz. I have a separate chip doing nothing but reading from the MPU-6000 chips (via SPI at 1 Mhz)and computing orientation using the basic methodology from Madgwick ; this code runs at about 600 Hz with data being passed to the main chip via SPI at 2Mhz bit rate. The velocity gets updated every tach hit, so update rate is speed dependant (using a couple ABS sensors). Operator steering input is read once per loop (two actual signals because the joystick has dual redundant electrical outputs). Actual steering shaft feedback is measured from an encoder on the steering motor using a quadrature timer/counter running on the XMEGA event system and is updated in the main code once per loop. I'm getting 4000 pulses per rev on the encoder from my steering motor and I have a 200:1 reduction to the steering output, so I'm getting 800,000 pulses per rev on the steering shaft output, which is some serious overkill, but I can now control the steering angle and rate down to a gnats ass using my BLDC controller.

All of that said, I could probably get away with something as low a few hundred Hz in the main loop before I really started to see much in the way of a handling impact, but I'd rather be a little too fast than too slow.

Post a Reply

Please log in to post a reply.

Did you know that 20 LEDs can be controlled from 11 microcontroller pins, to make a twinkling heart outline? Learn more...