Posts

More power

I've moved on to a multi-ratio gearbox which consists of 2 plastic L-Shape brackets with some appropriately spaced holes in them. It comes with a motor, but I've replaced it with an MM28, which has several times the torque and power. This means using a configuration not really anything like the manufacturer intended. I'm not sure the plastic is quite up to the job, and the geometry leaves me with a few problems. I'm already considering building my own brackets out of aluminium. That would be a good use of my drill press, finally. Anyway, I think I should figure out a prototype using the off the shelf parts for now, so plastic will do. I've wired all this together, and adjusted the software, because the board is oriented differently. The result is erratic, to say the least. So I've updated my software, so that it aggregates statistics from the balancer loop, and writes them to a serial port. I've connected a serial bluetooth adapter to that, so I can have...

No pre built gcc-arm-none-eabi for saucy

I've bought a laptop to replace my desktop, and installed Ubuntu 13.10, Saucy Salamander. A down side of upgrading from 13.04 is that this PPA  doesn't support saucy yet. No matter: I can build from source. Start by adding the PPA, which will create /etc/apt/sources.list.d/terry_guo-gcc-arm-embedded-saucy.list Edit this file: uncomment the deb-src entry, and replace saucy with raring. It'll look like this: deb http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu raring main deb-src http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu raring main Now: $ sudo apt-get install apt-src $ sudo apt-src install gcc-arm-none-eabi unfortunately, this won't quite work. You will need to downgrade texinfo before it will build. $ sudo apt-get remove texinfo $ wget http://launchpadlibrarian.net/125194117/texinfo_4.13a.dfsg.1-10ubuntu4_amd64.deb $ dpgk -i texinfo_4.13a.dfsg.1-10ubuntu4_amd64.deb Now build: $ cd gcc-arm-none-eabi-4-8-2013q4 $ fakeroot ....

Electric gerbil on hold

I forgot to actually say that the electric gerbil fell by the wayside. Basically I couldn't find a strong enough gerbil ball, and re-enforcing one was going to be quite complicated. I also found that creating a convenient way of opening and closing the ball was a lot of trouble. All of this should be soluble, but I'd rather build something that doesn't require a whole lot of mechanical engineering. I want to get better at that, but I don't want it too prove too great an obstacle in my first project. I've now cobbled together a balancing robot prototype using the same motors, and the STM32F3 discovery I mentioned before. I've also written some balancing software, which seems to work roughly as described. Not that the robot balances... The guides I have read suggest just use the proportional part of PID, and get that working, and then work on the oscillation, but pretty much however high I set the constant, my robot falls flat on it's face. It's hard t...

Rust is back in the game

Forget about Haskell, Rust is now the front runner, basically, because I found armboot . It seems like Rust's ability to boot with no (or a minimal) runtime is  fairly new . Since this implementation has no GC, I might indulge in writing one. I've been thinking about it quite a bit lately. For Rust this might require some more thought, however, because it's designed to give garbage collectors a lot more leeway than most languages. I need to get my head around rust's memory model. In the meantime, I think I'll try to write the code for my balancing robot in Rust, without memory management, to see what I learn.

Accelerometer notes

Just some links relating to accelerometers, gyroscopes and balancing robots: I have an STM32F3 discovery board equipped with both L3GD20, and LSM303DLHC. Here's a Chibios based demo which logs their values via the USB port. I've just built and installed it on the board,and it works. Ignore the 'when chibios supports i2c' note: it already talks to the LSM303DLHC. There's also this in the Chibios forums for the L3GD20, which looks a little more structured. I also like this article , which describes building a balance bot based on a Raspberry Pi. The general explanation of balance bots looks good.

Haskell for micro controllers

I wrote a little rant on my employers blog the other day, lamenting the need to develop embedded applications in C or C++. I've written C and C++ professionally, and I'm not planning to do it again, unless it's directly towards the goal of not writing C in some new problem domain in the future. I've done some Arduino programming recently, and it amazes me how painful it is. I looked at loads of options for embedded development, specifically targeting some cheap ARM based boards: the STM32 Discovery line. eLua looked OK, and there's Espurino , but neither are up to the task of handling interrupts, and hence writing drivers. If the drivers don't exist for your platform, or you need to extend them, your back to C. Also, a lot of interpreted systems use precious RAM to store programs, when they should be in ROM, which tends to be more plentiful. I should say that eLua does have an interrupt handling mechanism, but it's not all that fast, and throws interrup...

More drilling holes in aluminium

I figured it must be possible to drill accurate enough holes for my purposes using a drill stand, so I bought one that includes a vice, for £30. Here it is at Amazon , although I bought at Machine Mart, where it was cheaper. I have a cordless drill and an SDS drill. Only the SDS one has a collar, and it's hardly going to be very accurate, so I need a new drill as well. According to my reading, high drill speed is good for aluminium, so I wanted a fast drill. Claims of accuracy and speed control for greater versatility were highly regarded, so I ended up going with a Bosch GBM 6 RE . It ticks all the boxes, and is one of the few drills on the market that doesn't have hammer or impact actions to complicate things. I'll try and rig something up to measure the accuracy of this arrangement and post about it later. I don't expect to be able to try it out until next weekend. Update: see  this post .