Design of a 2-axis, Continuous Rotation, Camera Control Platform

This was the title of my final year project for my BEng (Mechatroics) degree at the University of Stellenbosch. It’s been a year, a loooong year, but at the same time it’s passed so quickly. I’ve probably spent more time on varsity work this year than in any other previous year, a combination of this skripsie, mechatronics and electrical design projects, interspersed between the year’s class requirements.

You can see a summary poster of the project here. And the full report here.

Skripsie is something very different to what we’ve done previously. We’re given a year to complete the project, which is a fairly long time. What I’ve appreciated is the fact that it’s the only major project we’ve been given to do individually. It’s not that I don’t like other people, it’s just that it’s sometimes nice to be able to do things my way. Most of the projects are put forth by lecturers, and they act as supervisors for the projects. I’ve been very fortunate with my supervisor and his continued support and enthusiasm for my project.

Final Product

Final Product

So what is it? Well it’s basically a turret that is capable of continuous rotation. You get a bunch of pan/tilt cameras on the market, but they all stop after 360textdegree or less. The department I did my project with had purchased several Basler a311fc cameras to play with and desired a platform they could use for tracking. It’s a very nice camera, good quality and capable of fairly high capture rates (50fps @ 640×480, 132fps @ 320×240) and comes with some nifty software (Basler Pylon Driver) to control it. So the major issue was to transfer data and power to the camera. I looked at a couple of wireless solutions but for simplicities sake eventually went with slip rings. Picked up 2 slip rings (at quite a cost, well I was surprised at the expense) from Moog.

a slipring

a slipring

Next issue was control. My control systems has never been the strongest, so decided to stick with some open loop control in the form of stepper motors. Picked up a 220Nmm and 440Nmm stepper motor to control the tilt and pan respectively. They’re bi-polar hybrid stepper motors with a 0.9textdegree step size. I drove them both in half-step mode effectively giving me 0.45textdegree accuracy. To drive them I made use of a combination of L297 and L298 ICs from ST.

The idea was to be able to control this all from a PC, so some software development and integration was also required. To bring it all together I made use of an Arduino Uno. I developed a GUI in Python which then communicated via a serial connection with the Arduino. I was originally going to use Java for this, but couldn’t get a serial connection running. Chatted to some friends who suggested Python and found this post with a nice example. For testing I also got hold of two AS5040 hall effect sensors from Austria Microsystems. These rotary encoders give a 1024bit resolution, effectively 0.35/textdegree. I managed to find some nice code for the Arduino to read the data via SSI over at RepRap.

CAD Model

CAD Model

This was also the first time I’ve had the opportunity to develop CAD models of something and have it built. We’ve done several machine design projects over the years, but they’ve all been conceptual only. I didn’t machine the stuff myself, but it was pretty cool when I built the thing, and compared it to my model, and it looked the same.

screenshot of the UI

screenshot of the UI

So I handed in the final report on the project today. Unfortunately it’s not working 100% at the moment, and one of the motor driver circuits got damaged, so I need to repair that before my presentation in a few weeks time.

But until then, it’s 3 exams in 3 weeks, so ought to be pretty chilled. And I’m almost an engineer o/

Karoo to Coast

Julle’s die mooiste mense!“, that’s the way my ride started off on Sunday as I completed my first Karoo to Coast bike ride. It’s 100km of almost purely dirt roads that takes you from Uniondale up and down the mountains to end off in Knysna.k2c

100km is a long way, and my constant self-reassurances that it must all be downhill (seeing as we started at 700m and ended at sea-level) did little to help when all the climbing occurred. Something that did help was the beautiful scenery, spectators with cheers of support, water points and a stunning 14km down hill. 14km. Of down hill. It was great!

Although the road wasn’t closed to traffic we were very lucky, along the entire 100km, I probably only encountered 2 or 3 non-official cars. This makes life on the down hills much nicer. Speaking of down hills, and up hills for that matter, and puddles, this is my only complaint, however it is not at all unique to the K2C.

I’m not the fastest climber, and as such I make a point to keep well left and out of the way of the faster riders. I’m also slightly paranoid, and constantly check around em to see where people are. If I want to pass someone I check to see I won’t get in someone’s way and I make a dash. All I want is for other people to do the same on the downhills. Downhills are where I can make up all the time I lost on the uphill. I’m comfortable going fairly fast on the downhills. It’s fun, but when you’re coming down and getting held up the whole time it get’s annoying, especially people who don’t hold their lines through a corner. Obviously cutting corners is the easiest way to get down fast, and I do it often, but I make sure I won’t be cutting someone else off.

Grabbed these off actionphoto.net they take great photos at all the events

My problem with puddles is more people’s lack of desire to get wet and muddy in an inherently dirty past time. About 15km into the ride there was a big puddle of water in the middle of the road and everyone tries to go around, half the people climbed off their bikes at this stage. I rode straight through the middle. Why? Because no one else was there, and it’s fun to make a spray of muddy water :)

Most of these problems are just an issue of too many people in the same spot, and is, I guess fully understandable, and I accept them as part of cycling, but it would be nice if they weren’t there.

In any case I cycled the full route with my dad and we finished with equal times of 05:36:08, nothing amazing, but I was quite happy with it. He did somehow manage to grab the position in front of me, us finishing 816 and 817 of 1987 finishers. The cutoff being 8hours. We also stopped for a nice swim in a river along the way to cool off on what was a rather warm day.

Although the race started in Uniondale, we spent the night at a nice B&B in de Rust, I believe the place was called Riverside or something similar. We had lovely pizza the previous night at the backpackers in de Rust whose restaurant is apparently only open on Fridays.

Included in this post are the logs from my GPS which I carried along, and which managed to die 15km from the end. Max speed clocked out at 66km/h.

Overall had a great ride on a spectacular route and look forward to doing it again next year.

Blue Crane Benefit Rally 2011

I’ve always been a rally fan, pro rally driver would be my dream job, but I don’t see that happening any time soon. In any case I’ve often seen local rally events on TV but never known anything about them, their organisation or just how one goes about spectating one.

Earlier this year I finallygot round to doing some searching and discovered rallyworld.net, a website dedicated to keeping track of the local rally scene. I had made note of some of the events happening this year, but nothing really managed to fit in with my schedule. Until a couple recently when I saw a rally coming up this weekend, and it was in Caledon!

So I drove through to Caledon this morning, camera in hand and not really sure what to expect. The organising centre was at the Caledon Spa & Casino. Pitched up there and was quite happy to see some vehicles parked outside that fitted the bill, got myself a spectators guide and set in for some spectating.

I was mildly surprised at how many spectators there were, at the one point there were easily 100 people, not sure how many of them were friends/family of drivers, but still itneresting. I think this event was fairly small, with 20 vehicles participating. It seems like quite a regulars’ club, but I still enjoyed myself and I’m definitely going to keep my eyes open for another event.

I think it was top gear that made a comment about rally spectators going to different parts of the country and standing in the rain to watch a car go by for a few minutes

I took a bunch of photos which I will sort through tomorrow and put some up here (Edit: done, see below). Cars at the event included VW Citi Golfs, Subaru Imprezas, old BMW 3 series, VW Polos and a several other single entry cars.

I was at spectator points for stages 2, 4 and 6, before I decided to head off to Hermanus.

I’m not a big fan of WordPress’ photo gallery, so you can see more photos here.

 

Justice in South Africa

Today was my first day in court. As a witness fortunately, and not a defendant. Last year my bike was stolen, and then recovered thanks to some quick work by the campus police (aka USBD, Universiteit Stellenbosch Beskermings Diensteerm, or erm.. whatever the English title is (apparently University of Stellenbosch Risk Management Services)). In any case, I received a phone call about 2 months ago out of the blue asking me to come down to the police station. No explanation or anything, just to please come down. So I pitch up there and hang around for 10min, the Sergeant who was supposed to meet me there was out, but eventually another plain clothes cop sorted me out, serving me with my first Subpoena.

So I pitched up at the Magistrate’s Office this morning at 08:30, as instructed. Hung around a while and my old roommate (who was also called as a witness) pitched up shortly before 9. 9:10 and we were all asked to rise (just like on TV :) ).

I had gone into the day assuming I’d be there all day, but I was rather happy when the first 5 cases were all immediately postponed due to the fact that the defendants were absent. On one side this was rather worrying, on the other I wasn’t keen to sit their all day. Half an hour later and my optimism was all but up.

At about 10:45 the judge finished a case, got up and walked out. In a more formal manner than that, but didn’t really say what was happening, everyone else kinda got up and left the room too. So I sat there for the next 40min, with my roommate, not quite sure what was going to happen. Fortunately the cases resumed and at about 12:15 the case was called.

We went up, with the USBD guard who caught the kid, and I got to see the kid for the first time, to be told that there wasn’t enough time left tothet though this case and have it postponed till the 20th of October. Apparently this was the fourth time the case has been postponed, and we were promised that it would have priority on the next day. All 4 of us were “Warned” to be there again from 09:00.

I was slightly disappointed at the way things were handled in general, and sightly annoyed that I skripsiereturn in October, the day before I hand in my skripsie. But I guess it’s not the end of the world.

We were allowed to leave then, and so we went outside and chatted with the USBD guy for a while. He called a vehicle to come pick us all up and take us back to campus. Those 10min were probably the most interesting of the day. He chatted to us about how often he has to come to court, and how he gets frustrated, because majority of the time the students don’t press charges or don’t come witness, so people just get let free.

It was also very interesting to hear him talking with the USBD guy who came to pick us up, chatting about some of the characters that were in court that day, how they recognise certain people, repeat offenders and how they’ve profiled certain people. He explained the way cars were getting stolen and some of the strategies the guys uses. Also how the holidays are actually worse, because there are no students around reporting suspicious people. thousands of students have thousands of eyes, which makes their job easier. It’s great to see guys like that who really want to make a difference, who know what’s going on and take their jobs seriously. It’s good to know they’re looking after us.

So I actually typed half of this last week, after my court appearance, but only got around to posting this now. Also my blog was hacked yesterday. Haven’t figured out how yet, but fortunately just some script kiddie called “Herculephp(but in a more 1337 way) edited my template’s index.php. Fortunately no lasting damage and it was quick to get running again.