Python Code for Interfacing to Sportident Stations

Sportident Primer

Sportident is a system commonly used for timing in e.g. the sport of orienteering. One part of the system is battery powered stations placed at the start, finish and control posts along the course. The other main part is small RFID “cards” the athletes carry with them. The cards store information, like time and code number, from the stations they come in contact with. At the end of a race, the data in the cards is read out and processed by some piece of software to create the results list.

Sportident station BSF8. Common type without cable.

The stations come in different versions. The most common type (often used at control posts) has no other means of communication than the inductive RFID link, while others have e.g. a serial port (not sold anymore) or USB. The wire-free stations can be connected to a computer by inductively coupling them via a ferrite rod to a station connected to a computer.

Sportident station BSM7. This type with serial port is not sold anymore. Today USB is used instead.

There is non-volatile memory inside each station and this stores station configuration information, as well as a log of which cards have punched at the station and at what time.

Sportident provides a gratis program called Sportident Config+ that can manage the Sportident hardware, by e.g. upgrading firmware, setting operating mode, setting time, reading out backup memory, reading and configuring cards etc. While the program is generally quite complete in its functionality, it has a rather inefficient GUI for doing the same operation on many stations in a row, like setting up all stations to have synchronized clocks and the same operating time. Or reading out the backup memories of many stations. Such operations require a lot of clicking for each station and small mistakes can cause undesirable results.

Python Code

The communication protocol used over the USB/serial port is partially documented in a non-maintained document not generally available, although it is possible to get a copy of this document by asking Sportident for it. I found more information about the protocol and the configuration data of the stations in the source code of a program called sireader.py which I found on Github. This code was developed by Gaudenz Steinlin, Simon Harston and Jan Vorwerk in 2008-2015 and the purpose primarily seems to have been to read out the information of cards inserted into a station connected to a computer.

I wanted to do more than this however. First, I wanted to be able to read out the backup memory of many stations and store the information in separate CSV files with minimal user intervention for each station. Second, I wanted to have a streamlined way of preparing many stations for an event. This involves synchronizing the clocks, clearing the backup memory, setting the operating time (time before the station goes to sleep) and a few other settings.

Some of this was quite straightforward to do using the code in sireader.py, but some of it required more investigation of the communication protocol by means of a logic analyzer as well as the addition of several new methods in the main class of the code. I also had to study the raw configuration data of stations, which consists of 128 partially documented bytes, and compare it between stations in different modes to be able to get to the settings and information I wanted.

The result of all this is currently an extended version of the python code, which I call sireader2.py since it is not necessarily 100% compatible with sireader.py and it also contains a lot more functionality and documentation of a few more parts of the Sportident station configuration data.

I have also written scripts which use sireader2.py to do what I set out to do, namely to read backup memories and normalize station settings.

All of the code is freely available under GPL 3 at the following github repository:

https://github.com/per-magnusson/sportident-python

Electronics Podcasts Update

This post from 2018-11-15 was updated on 2019-08-01.

Back in 2016, I did a blog post entry about podcasts about electronics. Some of the podcasts mentioned there are still going strong while some have disappeared and a few new ones have shown up, so it is time for an update:

I regularly listen to a number of podcasts and below is a list, along with some comments, of the electronics related ones.

I find that the podcasts provide inspiration, insight and knowledge about tools, projects, parts, companies, people and resources in the world of electronics. I first learned about many of the building blocks, components and development tools I use in my hobby projects (and sometimes professionally) through these podcasts.

The Amp Hour

RSS: http://feeds.feedburner.com/TheAmpHour

I guess this is the longest running electronics related podcast I know of, started in 2010. “The Amp Hour is a non-scripted off-the-cuff format show […]. It is the worlds largest and most respected electronics oriented radio show. Discussions range from hobbyist electronics to the state of the electronics industry, components, circuit design, and general on and off-topic rants.”

Chris Gammell and Dave Jones (of the EEVblog) chat weekly either with each other or guests about industry news, hacker/maker/open hardware stuff or other things mostly related to electronics. Chris is currently a cosultant and also teaches the online course Contextual Electronics while Dave is an opinionated and quite successful youtuber. If I need to pick a favorite electronics podcast, this is it.

Embedded

RSS: http://embedded.fm/episodes?format=rss

Started in 2013 this is another weekly show, but more geared towards embedded software than electronics, although some of the guests are more into electronics. Elecia and Christopher White discuss between themselves or with guests about “the how, why, and what of engineering, usually devices.” The guests include “makers, entrepreneurs, educators, and normal, traditional engineers.” Both Elecia and Christopher are embedded software consultants in Silicon Valley. Well worth a listen if you are into electronics or embedded software.

Unnamed Reverse Engineering Podcast

RSS: http://reverseengineering.libsyn.com/rss

This is new on the list since I just discovered it. The topic is primarily reverse engineering of electronics and software. The style is similar to The Amp Hour and Embedded and the content is equally interesting in my opinion. Episodes come out irregularly. In the first two years, 23 episodes have been published.

SolderSmoke Podcast

RSS: http://www.soldersmoke.com/soldersmoke.rss

SolderSmoke is mostly about home-brew HAM radio. Hosts Bill Meara, M0HBR, and Pete Juliano, N6QW, discuss their radio projects and issues they run into. This is the show for anyone who is interested in home-brew radio or perhaps HAM radio in general.

MacroFab’s Engineering Podcast

RSS: https://feeds.backtracks.fm/feeds/macrofab/macrofab-engineering-podcast/feed.xml

MacroFab describes the idea behind the company as “[…] to disrupt the contract manufacturing industry by developing a software driven approach to make it faster and easier than ever to bring new electronic products to market.” They seem to specialize in small volume PCBA manufacturing. The weekly podcast was started in 2016 and is hosted by Parker Dillmann and Stephen Kraig who are engineers at the company (except Stephen has left Macrofab, but remains a host of the show). They mostly talk enthusiastically about projects they are working on (they seem to do a lot of fun projects, often with unclear connection to the business) and discuss industry news. The program can be quite inspirational and does not feel like an ad for MacroFab.

A little warning might be in place. Of the podcasts listed here, I get the impression that this is the one on which the hosts are most likely to sound relatively sure about something that is utterly wrong. It seems to have gotten a little better over the years, but still this warning may be relevant.

Ontrack Podcast

RSS: http://podcast.altium.com/feed.xml

This podcast is new since the previous list.

Ontrack is a podcast produced by the EDA tool company Altium. The host Judy Warner is enthusiastic about the industry and brings on various guests from the PCB industry. Mostly it does not feel like ads for Altium (full disclosure: I have been using the Altium Designer ECAD program for many years and think it is great – for the most part) but instead is pretty interesting if you are involved in PCB design.

EETimes-on-Air

RSS: https://feeds.blubrry.com/feeds/aspencore.xml

This is the most recently started podcast on this list. It comes from EETimes and is very professionally produced. The production quality is in my opinion both a good thing and potentially not so good since the polished surface may perhaps come at the expense of depth and nuts-and-bolts content. I find a reasonable fraction of the news and analysis on the podcast to be of interest, although the engineering-to-business ratio is far lower on than it is for the other podcasts on this lists.

This is the way the podcast is described:

“EETimes On Air is the audial digest of EETimes, presenting a thirty-minute (editor’s note: rather 15 minute) deep-dive on the most compelling stories in electronics. Featuring subject matter experts from all corners of the industry, EETimes On Air lends elevated discourse to design engineers and tech industry professionals.”

PCB Tech Talk

RSS: http://pcbtechtalk.libsyn.com/rss

This podcast was started by Mentor Graphics in 2015 and has had a few periods of silence, although new episodes seem to be coming out as of now (2019). It contains some useful information and insights for PCB layout designers, but very much pushes Mentor’s tools and brand. It distinctly feels like it is produced by the marketing department of a traditional company and a lot of the content is clearly read from a script. I rarely bother to listen anymore since I do not use Mentor’s tools nowadays and currently do not see that happening in the near future either.

Shows that seem to have disappeared

The Spark Gap Podcast

RSS: http://thesparkgap.libsyn.com/rss

As of this writing, no new episode has come since 180131. I really hope it will come back as I highly enjoyed the show, but I will not hold my breath.

“A podcast discussing the nuts and bolts of embedded electronics, the systems that use them, and the community that surrounds them.” Started in 2014 and hosted by Karl and Corey. Episodes often have a specific theme and occasionally feature guests.

The Engineering Commons Podcast

RSS: http://feeds.feedburner.com/TheEngineeringCommonsPodcast?format=xml

After increasingly infrequent episodes, this podcast has as of this writing not come out since June 2018.

This podcast is only occasionally about electronics and more often about other aspects of engineering and being – or becoming – an engineer. It was co-founded in 2012 by Chris Gammell of The Amp Hour, but he left the program a few years ago. Today the show is hosted by the other co-founder Jeff Shelton (a mechanical engineer) as well as Adam (civil engineer), Brian (electrical engineer) and Carmen (also an electrical engineer).

Changing Spindle Bearings on a Taig CNC Mill

The spindle on my Taig CNC mill was getting uncomfortably hot after a few minutes of milling; especially at higher RPMs. It ran smoothly and without any play, but with noticeable friction, so I decided to try to change the ball bearings.

Taig CNC mill

Ball Bearing Selection

The bearings have the standard dimensions 17x40x12 mm (inner diameter x outer diameter x width) and this apparently is designated with the number 6203 in the ball bearing world.

I am not a mechanical engineer and have little knowledge of the intricacies of ball bearings and it was also surprisingly hard to find a lot of good information online on how to select the proper bearings for the application. I wanted high quality to avoid having to change them soon again and I thought that dust covers would be a good idea to minimize the risk of chips getting into particularly the lower bearing. After some browsing of an online catalog (at kullagret.com, although there are countless others), I realized that there were plenty of options, even after selecting a particular well respected brand. It was clear that deep groove bearings were required since they can handle axial loads as well as radial ones. Since rubber seals were slightly more expensive than metal shields, I thought they were superior and bought two SKF 6203-2RS bearings. This unfortunately turned out to be less than ideal.

After replacing the bearings (the process I used is described below), it turned out that the spindle still rotated with quite a bit of friction. The rubber sealed bearings themselves did indeed have significant friction, which was concerning even before putting them into the spindle, but it became even worse after the assembly was done. A quick test run revealed that the spindle got at least as hot as before and that the motor was almost not powerful enough to even run the unloaded spindle at full speed at the highest gear.

I  think part of the reason for the high friction was the rubber seals, but since it got even worse after assembly, I think there is also another part of it. It must be either that the bearings  are put under radial stress in the spindle, compressing them tighter and thus causing them to run with higher friction, and/or that there is ever so little misalignment  between the two bearings.

So, back to the bearing catalog. This time I tried to address both of the reasons for the high friction. I opted for bearings with a higher play, designated by the option C3. I also selected an unshielded bearing for the top one (6203/C3) – which will hopefully not be subjected to chips or other debris – and metal shields for the lower bearing (6203-2Z/C3). This worked much better and now the spindle runs smoothly with very little friction and no discernible play.

Below is a description of how I replaced the bearings the second time.

Disassembly

I first removed the spindle motor. It is fastened only by two screws holding its mounting plate to the rest of the spindle.

The spindle is secured to the Z-axis assembly by a single set screw holding on to a dove tail, so this was easy to remove.

Spindle removed from mill

The pulley is secured by two set screws. I released them and gently applied some force to pull it off from the shaft. There probably are some good special tools for this, but I used two screwdrivers as levers.

Removing the pulley

Under the pulley, there is a nut (with a very fine thread) that needs to be removed. I held on to the shaft by one wrench on the lower side while using another to loosen the nut.

Removing the nut

Now the shaft had to be pushed out of the bearings. This takes a lot of force. Maybe there is some trick that I am not aware of. Using a mallet to hammer it out might be one option, but I initially tried to be more gentle by using clamps (more than one was required to two get enough force) together with wooden blocks to avoid damaging the shaft. If I had had a gigantic vise with a wide enough mouth, that would probably have been a better option.

Pushing out the shaft using clamps and wooden blocks

Once the shaft was fully pushed into the top bearing, I resorted to hammering on a dowel at the end of it.

Hammering out the shaft using a dowel

This was successful.

The shaft has successfully been removed.

The next step was to remove the bearings. Here I came up with an (in my opinion) clever method. The housing is made of aluminum and the bearings are obviously made of steel. Aluminum expands a little more when it is heated than what steel does, so by heating the whole thing up by a few tens of degrees, it should be much easier to remove the bearings. So I set the kitchen oven to 60 C and let the spindle cook for an hour or so.

Cooking the spindle

This was even more effective than I had thought. The bearings more or less fell out by themselves.

Bearings falling out of hot spindle.

There were a few shims between the ends of the bearings and the spindle, probably to prevent the inner ring of the bearings to touch any part of the housing.

Re-assembly

Before the housing cooled down, I inserted the new bearings into it (together with the  shims).

Upper bearing without shield or seal

Lower bearing with metal shield

Inserting the shaft into the new bearings was a bit hard. I probably should have heated up the new bearings before attempting this. Instead I lubricated the shaft a little (not sure this helped) and used force in the form of a hammer to hammer it in. Maybe this could harm the bearings due to the high axial load, but fortunately the spindle ran fine afterwards, so perhaps it was no big deal. Next time I will probably heat the bearings (and perhaps even cool the shaft, although I am worried that might cause too much condensation and then rust) before trying to force it in.

Hammering in the shaft

After making sure the shaft turned smoothly with little friction and with no discernible play, I replaced the nut (not tightening it very hard as that increased friction), added the pulley and then put the whole thing back onto the mill.

The shaft and its nut are back

Reassembled Taig CNC mill

So despite the unnecessary set of sealed bearings I bought and having to do it all twice, I am pretty happy with the bearing replacement. Now the mill runs fine without the spindle getting hot, even after long runs at maximum RPM.