Thymio-II interface: Differential kinematics

The latest upgrade to my Thymio interface has been differential kinematics. Basically this is turning the wheels at different speeds in order to move in an arc. The Thymio has 2 wheels with separate motors for each so the wheels can move at different speeds very easily and so this form of motion can be implemented.

I decided to implement this using 2 variables, the radius of the arc and the distance traveled. With this information i can calculate the time the Thymio should move for and the speed of the wheels.

Previously i gave the user the ability to set the wheel speed so we can make use of that in the calculations. To calculate the individual speed we can do the following: set the outer most wheel to move at the wheel speed set by the player, calculate the difference between the length of the arcs of each wheel and then multiply the wheel speed by that difference.

In this example lets say the radius is 10cm and the length to travel is also 10cm. Looking up the specs of the Thymio we find that the width of it is 11cm, and as we want to use the middle of the wheels we can say that the difference is 10cm. The Thymio should move about 3cm/s at a speed of 100.

Calculating the time to move can be done in the following way. First we need to calculate theta (the angle we will me moving) by doing the length traveled divided by the radius, this will give us the angle in radians and works because finding the circumference of a circle  equals 2*pi*radius. That basically means that the 360 degrees (the full circle) is equal to 2*pi. to simplify this means that the angle equals the length divided by the radius. Now we know the angle we'll be traveling  we need to know the speed the center of the robot will travel. Theta * the radius (radius to the center) divided by theta * (radius + 5) will give us the difference between the 2 arcs. We can then times this number by the wheel speed to get the speed at the center and then we can divide this by 33.33 (speed of 100 = 3cm/s so speed/33.33 = speed in cm/s) to get the speed in cm per seconds. finally we can divide by the speed and the do 1 over this result to get the time to wait for the action to finish.
In our example this means theta is 1 and the difference will be 0.66 recurring and if the speed is 100 then the time we will need to wait will be 4.999 seconds

1/(((10/15 * 100 )/33.33333)/10)

Calculating the speed is very similar but instead of the radius +5 and the radius, we will use the radius-5. with the outer wheel moving at "wheelspeed" and the inner wheel moving at wheel speed * the difference.

That was quite a block of text but the result is that the center of the Thymio (the pen holder) will move the required distance in an arc.

The video below shows an example of this in action.

In the video i made use of a pi to run the python code. In the code there is a line which defines the IP address of the scratch serve the code should communicate with, by setting  this to the IP address of my laptop running the scratch code I can control it remotely.

To get the code running i used tight vnc to look at the Raspberry Pi's desktop remotely. I started the remote viewing using putty to communicate with the pi over ssh, I had to delete the .Xauthority in order to run the python as there was a conflict with running dbus. the file can be deleted by typing the following:

cd ~

sudo rm .Xauthority

Unfortunately this needs to be done every time you start up vnc on the pi

Mobile phones: A completely wireless experience

A few months ago my old phones usb port broke leading me to repair it and give it to my brother whilst getting a nexus 5. The nexus 5 has the same micro usb port that my old phone had and that broke so easily, it seams the cause of this is the very fine ribbon contacts on the phones port wearing away over time. The simple solution to this problem is to just go completely wireless.

In order to go wireless I had to consider what I used the wire for and how I could replace it. Mainly I used it for charging, this could easily be replaced by a wireless charging pad which uses induction to pass current in to a coil near the battery. This doesn't seem like such a large advantage besides the usb port not getting used, but it is amazing bordering on revolutionary. That was a bit of an overstatement and I'm sure most people would think of plugging in a phone as no trouble at all, however, the convenience of just putting the phone down and that's it is one of those things you have to use to understand. When I get home I can just put it on the pad, when I go to bed, checking my phone at night, all of these tasks benefit greatly from not having to deal with a wire.

The second thing I used the wire for was data transfer. I have a decent internet connection so its no problem to use software like Dropbox, however this proved to be a bit fiddly as I didn't want to use the Dropbox app and the website requires a login and has a bit of a clunky GUI. I found a nice internet independent solution with filezilla. Using a SSH server app on my phone meant I could connect to it using filezilla and sftp. This had a few benefits such as no intermediary step for copying files, also as long as I'm on the same wi-fi network it doesn't matter where I am so I can copy files across whilst doing something else with my phone in a different room. Unfortunately there is one drawback, in certain situations such as when on holiday or in university accommodation the wi-fi is configured in such a way that the LAN is on a completely different network and phone to computer communication is impossible, however there is little that my phone can't download that my computer can and so this issue is minor at most.

Overall it has been an enjoyable experience and I can easily see wireless charging becoming a big thing in the near future. Wireless file transfer is also a really nice technology to use however, it could do with some purpose built software with a server somewhere to initiate a handshake between the two devices so you wouldn't have to mess about with the IP addresses.

Completely wireless phones? I would completely recommend doing this for the convenience and the experience with filezilla and sftp.