Deepwire's Blog

Tempus Fugit.

by on Jul.28, 2015, under Programming, Technology, Work

I’ve done it. I’ve gone an entire year without writing a blog post. Here I am today on day 2 after kicking off the YRS Reading Centre at Microsoft yesterday for the 2015 Young Rewired State Festival of Code! If you want to find out more about what this is, check out the links, and read some of my previous blogs.

In the past year, I’ve left my job as a Technical Consultant / Analyst Programmer at the IT Consultancy I’d only just joined before the 2014 Festival of Code, and moved on. I am now a C# Backend Developer for a small company that specialises in vacation property management. I joined as part of their plan for someone to take over from their current Lead Developer who will be leaving the company in the coming months to pursue his own interests.

I have also increased my involvement with YRS since the 2014 Festival of Code, running an (almost) monthly meetup called Hyperlocal. The aim here was to give young people, include anyone who takes part in the Festival of Code, somewhere they can continue to meet up and work together for the rest of the year. Otherwise they’d be stuck waiting a whole year for the next Festival of Code.

I’d say we had limited success. We had a regular small turnout when we met at Reading College, but it never grew anywhere close to the numbers of those we see when we meet at Microsoft each summer for the Festival itself. Maybe it will grow in time. Maybe in this area, there just isn’t the need for it as in other areas. It’ll be interesting to see if there’s demand for it to continue after this year’s Festival of Code.

Fortunately we never have any trouble getting participants for the Festival of Code! This year we’re full of 30+ young people of all ages, from 6 to 18, including both returning faces and many newcomers too. Last year our YRSers set the bar very high, winning both the ‘Should Exist’ category with ‘Miles Per Pound‘ and the Best in Show category with ‘YouDraw‘!

YRSers getting down to work

Many of our YRSers on their first day of the 215 Festival of Code!

I can’t wait to see what awesome projects this group of young coders makes during the week, and how well they do in the Final in Birmingham at the weekend!

Leave a Comment :, , , , more...

It’s that time of year again.

by on Jul.28, 2014, under Programming, Technology, Work

Once again, it’s time for Young Rewired State‘s Festival of Code, and I’ve been looking forward to it for months. The past year for me has been an eventful one. I left a job I had been in for 3 years, which was doing nothing but holding me back, to do a Computer Science PGCE and train as a teach. That decision was partially driven by my involvement with Young Rewired State in 2012, and also from my involvement in Scouting. I did not have the right experience to get another job, and felt this was the best option for me.

But I only stayed on that course for one term, and left after the Christmas holiday. I then spent the following months trying to work out what to do, while looking for a new job. All through that, I had Young Rewired State to look forward to in the summer, followed immediately by WINGS 2014 with my Scout Group. After many interviews, I finally got a junior position as a Technical Consultant / Analyst Programmer for a large IT Consultancy. I was looking for a role that would effectively restart my career, take someone with little experience (because my previous job really didn’t give me any) and offer opportunities to learn. In my last job whenever I developed any software, although basic, I would use C# .NET, so this was a language I wanted to focus on. Fortunately my new role is providing that opportunity, and while it will be a steep learning curve, it should be better than my last.

But I made sure when I started that I would be able to take time off for both Young Rewired State and WINGS. As great as it is having a new job, and hopefully a great opportunity to learn, I’m much more excited about YRS. Taking part in the Reading centre at Microsoft for the past 2 years, I have met some amazing young people with incredible technical ability and great ideas. Most haven’t learnt programming in school, because until September education in this country has been lacking in that area. Despite that, the work they produced has been excellent. Although we haven’t yet had a winning team from Reading, we’ve come very close.

This year, our popularity as a centre has ballooned. We’ve doubled in size, with over 30 young people expected to be there this morning to start the week. We’ve gained increased involvement from Microsoft, with support from their Developer Evangelists to help mentor and small talks being run during the week on career paths, presentation skills and different technologies. This should make the whole experience running a centre at Microsoft our best ever! Maybe this is a sign. Maybe this year will be our year!

Leave a Comment :, , , , , , more...


by on Apr.08, 2014, under App Development, Electronics, Programming

In my new found free time recently, between unsuccessfully searching for a new job and having it made clear that money is more important than I was led to believe, I’ve been taking part in a couple of MOOCs (Massive Online Open Courses) for Android Development. I have previously toyed with Windows Phone development (for Windows Phone 7) but felt that while easy, there wasn’t much point to it. I don’t have any killer app ideas, and there just isn’t the user base. Since switching my own phone to Android, I’ve wanted to look at Android development, but did not really have an idea to develop.

Since getting an m3pi Robot last year, I finally had a complete robot to play with, after still never solving the problem of how to connect the omni-directional wheels to the output shafts of the motors on my Netduino based robot. It made sense to recreate the Windows Phone app I wrote to control the Netduino robot for Android to control the m3pi. But where do I start? Fortunately, the two MOOCs had me covered.

The long-winded “Programming Mobile Applications for Android Handheld Systems” from the University of Maryland was where I started. This was a very dry, rigid course, that went step by step through Android development concepts individually, out of context from a complete app. One week was spent looking at Intents, another on Permissions, another on Fragments etc. It was a good starting point, but didn’t do a very good job at showing how everything fits together into a complete app.

The second MOOC, “Begin Programming: Build Your First Mobile Game” from the University of Reading, has been much more fun. Right from the start this course gives you a working Android game, shows you it working, and lets you explore the code. Week by week it then goes through different programming concepts, such as Variables and For loops, explaining how they are used in the game. It’s a good combination of programming for beginners, and an introduction to Android development. Straight away this gave me the perfect framework to use as a starting point for my m3pi Controller App. From what I’ve learnt on the two courses, and help from Google, I’ve managed to get an app working to send UDP packets over WiFi to the WiFly module on my m3pi. It’s not perfect, it still crashes often, particularly when I try to leave the app, but it does the minimum I need it to.

But that didn’t mean everything was finished. For my Netduino robot, as I planned to use omni-directional wheels, my control method of providing a direction and magnitude (dragging a ball away from the centre of a circle in any direction) worked well. The robot would just move instantaneously in that direction, it’s speed determined by how far away from the centre the ball was. But for a 2 wheel robot with differential drive, this wouldn’t work. I needed different programming on the robot to receive the data sent by the Android app, and move the robot in a sensible manner.

I spent a long time pondering this, looking into robot kinematics and curved path planning, getting myself more and more confused finding ever more complicated potential solutions. Then it hit me. Joysticks. What I had basically made was a virtual touch screen joystick.

I could move the ball around a central point in a constrained circular area in much the same way that a joystick is pushed in any direction about it’s pivot, up to a maximum angle. Realising this, I thought there had to be a simple method for driving a 2 wheel differential drive vehicle by joystick. Another quick Google and I’d got my control technique!

The app essentially outputs 2 values, corresponding to the X and Y coordinatates of the ball, in relation to the centre (origin) of the circle. Both the X and Y are in the range -100 < 0 < 100, but also constrained to stay within a circle of radius 100 about the origin (so coordinates such as 100,100 are never possible). The technique I am using is adapted from Roborealm’s page on Differential Drive. Essentially the Y value is responsible for the speed forwards/backwards, and the X value is responsible for the robot turning.

Each received value is first normalised into the range -1.0 < 0 < 1.0, by dividing by 100, as the m3pi motors require a speed in this range. Following the Roborealm example, each value is then halved. This is still something I am experimenting with, as it does limit the top speed of the robot. But it is is required to allow the robot to turn.

The turn value is calculated from the X value, subtracting it’s value from the left motor’s speed and adding it’s value to the right motor speed. If there is no forward/backward (Y) component, the wheels will spin in exactly opposite directions at the same speed, causing the robot to turn on the spot. If there is any Y component, it creates a speed differential between the two motors, such that one spins faster than the other, even if both are turning in the same direction. This allows the robot to drive in a curved path. My current implementation of this algorithm for the mbed on my m3pi robot is below. Variables rx_x and rx_y are the integer values received from the Android app, in the range -100 < 0 < 100.

speed = ((float)rx_y/100) * 0.5;
turn = ((float)rx_x/100) * 0.5;
//Calculate the left and right motor speeds using the speed and turn values
//By adding the turn value to one motor, and subtracting it from the other,
//it creates a speed differential so the robot will turn
//(if speed = 0, robot turns on the spot)
mleft = speed - turn;
mright = speed + turn;
//Check motor values, and limit within -1.0 < 0 < 1.0
//if they exceed this range
if (mleft < -1.00) {
    mleft = -1.00;
if (mleft > 1.00) {
    mleft = 1.00;
if (mright < -1.00) {
    mright = -1.00;
if (mright > 1.00) {
    mright = 1.00;
//Set the motor speeds to move the robot

There is a point to having the initial values halved. If for example the Y value received was above 50, and the X value was also above 50, then the combined value given to the right motor when normalised would be above 1.0 (e.g 102/100 = 1.02). This is above the maximum speed possible, so the motor would be limited to run at maximum speed, and the motion of the robot would be inconsistent with the input.

Halving the input values ensures the speed values sent to the motors stay within their minimum and maximum limits. Unfortunately this does limit the maximum speed, both directly forwards or backwards and spinning on the spot, to 50% of the maximum. But it does mean the motor speeds change continuously for all X and Y values received from the Android app.

I will continue experimenting with this, seeing if I can improve on the algorithm to allow for maximum speeds in all cases (e.g. both motor speeds at 1.0 for forwards). Having realised my Control App is a touch screen joystick, I may even rewrite it as a general wireless robot remote control, as it doesn’t really need to be specific to the m3pi. That was just what gave me the incentive to get started.

1 Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!