Wednesday, June 29, 2011

Starting construction of H-bridge module.

I got the components from ELFA and Lawicel a few days ago. The first step was to set up the LM2574-based step-down converter, supposed to deliver a stable 12V supply to the HIP4081, on a breadboard. The schottky diode which is part of the circuit had pins so thick, I had to sandpaper them down to be able to push them into the breadboard holes... :)

I had no batteries at hand that could deliver the 24V I plan to use for the finished Segway clone construction, so I had to borrow a battery from my lawn trimmer, providing 21V. The circuit proved to work fine, at least on a quick minimal load test.

Thursday, June 23, 2011

More components ordered.

Next step is to design a powerful H-bridge that can drive larger DC motors that can actually drive a full-scale Segway clone. Yesterday I ordered a bunch of components, most notably:
  • 1 HIP4081AIP H-bridge driver IC.
  • 4 IRFZ44N N-channel MOSFET transistor, capable of controlling 49 amps at 55 volts.
  • 1 LM2574N-12 step-down switch regulator to provide the 12 volts required by the HIP4081AIP, from a 24-28 volt power supply (sealed lead-acid batteries).
My plan is to build a prototype motor driver on a breadboard and try it out for smaller currents, measuring timing and voltage levels on eg. the MOSFET gates. When it all seems to work, I will design a PCB capable of handling the full 25-40 amps required by larger motors.

One source of inspiration (an open-source, open-hardware motor driver):


Balancing robot starts to work.

After a little Arduino sketch hacking the robot is now balancing. It works pretty well on carpets, not so well on wooden floors, probably due to small friction. Carpets seem to reduce oscillations in the control algorithm.

Tuesday, May 10, 2011

Testing the H-bridge.

I assembled the motors, wheels and electronics in a rather ugly way, but hopefully it will be enough to test all concepts. Behold:







I hacked some Arduino sketches to test the H-bridge. It seems to work fine, but I'm a little worried about the dead band around zero percent PWM duty cycle. Hopefully it doesn't matter, or I can compensate for it in software.





Friday, April 22, 2011

IMU Measurements

Just got the components from Sparkfun now, and started experimenting, initially with the Arduino and the IMU. I was impressed by how easy it was to get started with the development environment. I hooked up the IMU's XACCEL output to the A0 input of the Arduino Pro Mini and basically just adapted to AnalogInOutSerial example to output the raw accelerometer value, together with two averaging functions. These were dumped to a file and I fed them into gnuplot to get a hint of how a low-pass filter would perform. This is how it looks:

Red line is the unfiltered input from the accelerometer. Green is filtered using a weighted average algorithm. So is the blue line, but it takes very little of the the fresh input into consideration.

Friday, April 15, 2011

New project

Time for a new project, just like most of them it will probably not be finished in less than 3 or so years. However; the intention this time is to learn a little more about the following things:
  • Electronics, especially handling analog sensors such as gyros and accelerometers
  • Motor drivers, based on H bridges and MOSFETs
  • The Arduino platform (and thus, the AVR-based ATmega328 µC)
  • Mechanical constructions
  • Control theory and basic digital implementations of control loops
I have always been impressed by the Segway and my first aim is to build a small and simple clone of it based on an Arduino, a couple of gearmotors and wheels from Pololu, an IMU (Inertial Measurement Unit), a motor driver and some other stuff, mostly aquired from http://www.sparkfun.com/.

Today, the first components arrived (from Sweden-based http://www.lawicel-shop.se/):

Saturday, February 13, 2010

Debugging serial device driver with the Jyetech oscilloscope

It's really fun to actually use the home-soldered oscilloscope for something real. In this case I watch the 9600 bps traffic from my STM32 dev board:



And then, a closeup of the oscilloscope screen: