Friday, March 18, 2016

Listening to satellites

I have had an RTL-SDR (these are cheap software defined radios using ICs originally meant for DVB-T reception) for some time already. I've previously been listening to airplanes, local radio amateurs and all sorts of telemetry data whizzing in the air. Recently I got interested of listening to amateur radio satellites, or to put more accurately, recently I learned that it is possible to do that with basically the gear I already had.

Mostly the satellites transmit at one of two bands, at 144 MHz or at 433 MHz. I had dipole antennas built for the bands already, but I didn't have a balanced feed to them as I had been using them inside very close to the receiver. To have the best chance of receiving anything from the satellites, I had to place them outside. The best solution of course would be to have the receiver reside outside close to the antenna and to just pull the data through a cable, but high speed USB doesn't really work over very long cables. The other solution would then be to have a computer (like a raspberry pi or something) close by to the receiver, perhaps even outside, and then pull the data in over Ethernet. The distance would have been too long for USB and I don't currently have a suitable small computer to use near the receiver I couldn't do with either of those options. Thus I had to add some balancing to the antenna feed and to pull the signal in with a coaxial cable.

The simplest way to build a balanced antenna, I found, was to build a folded dipole with a loop of coaxial cable acting as the balun. The folded dipole has an impedance of about 300 ohms, with the coaxial cable doing a 1:2 voltage division, thus acting as a 1:4 balun. The feed signal is then a 75 ohm signal, which is suitable for the RTL-SDR. A folded dipole is also basically as easy to build as a regular dipole.

With this new setup I was able to hear the local transmission at much increased power and signal-to-noise ratios. However, I didn't hear any satellites. After several nights of trying to hear something, I realized that the amateur radio satellites were in fact solar powered, and not transmitting when not illuminated by the sun. Unfortunately, I don't get much chance listening to satellites at day time due to my day job, and even during weekends it is only possible when the kids are napping.

One evening, just a short while before sunset, I plugged in the receiver to notice a strong transmission I hadn't seen before. Looking at it more closely, I realized it was drifting in frequency! This had to be a satellite. Unless someone was deliberately generating a signal that looked like it had such a strong Doppler shift. I started recording the IQ samples to store it for demodulating later. After two minutes of recording, the signal had vanished.

Screenshot from GQRX showing the satellite signal. The blue area is a spectral histogram of the signal, with frequency in the horizontal axis, time in the vertical axis and signal magnitude indicated with color. The Doppler effect is clearly visible, so the signal must have come from a satellite.
After I was confident the signal was not coming back, I started playing back the IQ data to demodulate the signal. It seems to be some type of audio modem signal, which itself is modulated using narrow FM. The signal is quite noisy, but it clearly has a ~2.4 kHz carrier frequency, which is present intermittently. Whether there is other data than just the intermittent carrier, is lost to noise. A sample of the signal can be obtained here.

As the signal didn't want to be demodulated, and as I couldn't even figure out what modulation it uses, I started to investigate which satellite was responsible for the transmission. The original transmission frequency is difficult to estimate due to the Doppler shift, but my guess is that it was somewhere in the band between 435.56 MHz and 435.57 MHz. I first looked at the amateur radio satellites in GPredict, as it has a very nice time control feature, which easily allows me to check what satellites were in the sky at the time of the transmission. Turns out that GPredict doesn't know this satellite, as none of the satellites it showed transmit at this frequency.

Turning to Google and looking through lists of satellites and their transmit frequencies gives a short list of possible candidates. Finally I find a match with a Russian military satellite Kosmos-2499! It carries a radio amateur payload called RS-47, which transmits on 435.565 MHz, and which was on the sky at the time of recording. There is also this YouTube video with the demodulated signal from the satellite. It sounds exactly like the signal I got. That's pretty cool.

The international space station transmits constantly, even when it is in the Earth's shadow. So in the evening I tuned the receiver to the ISS's frequency range and started to record a spectral histogram. In the morning I could clearly see signals corresponding with ISS passes, as well as several other transmission which also were clearly from satellites.

ISS data signals visible at 145.825 MHz. The annotations I've added are in local time (UTC+2). These times match with the passes of the ISS. The other signals have yet to be identified. There is some local interference, which produces the constant vertical lines. These are probably ghosts from the radio receiver, and not real signals.
I'll need to write some software for recording these signals in an efficient way. My idea is that the software would monitor certain bands and trigger the recording of those bands only in case there is something interesting. Currently I can only record the full IQ sample data from GQRX, which produces around 1 gigabyte per minute.

Wednesday, March 9, 2016

Modifications to a kids' electric scooter

Last summer my mother-in-law found an kids' electric scooter in the free section of a local thrift store. It was lacking a seat and a battery. Back then I quickly made a new seat by laminating sheets of polyethylene plastic together, and also hacked up a battery from my airplane lithium batteries and a DC-DC buck regulator. It was driven almost daily throughout the summer, until it had to be taken inside in the fall.

It was obviously not really designed to be an outside toy, as was evident from the decay of all the decal stickers from just one summer outside. We don't have the space play with it inside though, so it shall remain an outside toy. However, while I had it in for the winter I decided to clean the whole thing. It was already dirty from the thrift shop in addition to a summers worth of daily play. I took the whole thing to pieces and washed everything carefully. This made it look almost band new, but I also wanted to update some functionality.

The scooter originally just ran current through a foot pedal switch directly from the battery to the motor. This is quite hard for the transmission as there is a huge torque spike when the pedal is pressed. It also requires connecting and disconnecting quite large DC currents through an inductive load. This has left quite clear marks on the contact surfaces inside the pedal. Without any speed regulation, the scooter runs slow uphill and fast downhill. Finally, there is no reverse implemented, which together with the rather large turning radius causes problems in tight corners.

I wanted to address all of the problems through an electric speed controller. The speed controller can either limit the current through the motor to an acceptable level, or it can start the motor up more slowly. In both cases limiting the amount of torque through the transmission. Also proper driving of the motor ensures that current is continuous and hence no arcing will occur. Finally, implementing velocity feedback control allows the scooter to run at constant velocity.

I didn't want to add any sensors to read the motor velocity, so I had to do some reading on sensorless motor velocity feedback control. The main idea is that when the motor is turning without current flowing, the motor acts as a generator producing a voltage proportional to the velocity. The only downside is that in order to measure the velocity, we have to cut power to the motor and wait some time for the magnetic energy in the motor to dissipate. The time it takes for the energy to dissipate is also strongly dependent upon the velocity of the motor (which could be used as a secondary velocity measurement as well).

After some bread boarding of the technique I designed and etched a PCB to put everything on. To keep things simple I implemented the drive using a single N-channel MOSFET, while the reverse function is achieved through a DPDT relay. I went with a silicon diode for the freewheel diode instead of a Schottky one. This is a trade-off between efficiency and the time the motor takes to demagnetize. A Schottky diode would be more efficient, but it would take some time longer for the magnetic energy in the motor to dissipate than with a silicon diode. Also, I had silicon diodes capable of handling the current already lying around. The layout of the motor controller is shown in the figure below, while the schematic is available here.

Layout of the motor controller, view from the top side. Nothing special. Mixed through-hole and surface mount components. Footprint of the relay coil drive transistor is inverted... So don't use this layout directly. I had to bodge the part upside down, as I was too lazy to re-do the board.
These new features also needed new interfaces. As the electronics will be running even if the pedal is not pressed, a power switch needed to be installed. Although the electronics could be designed to be very very low power, just the concept of an ignition key is cool which my oldest son found very exciting.

My oldest son showing the position where he wants the ignition lock to be mounted.

The ignition lock in position.
As the scooter will have a new reverse feature, a switch is needed to choose the direction. The switch also includes an indicator light to show when the ignition is turned on.

Direction switch mounted. My son in the background supervising my work.
What was also lacking previously was any kind of fuse. This would not really be a problem if the only components in the system are a lead-acid battery and a motor, but with the buck converter and a lithium-ion battery there was a non-zero probability of an electrical fire. In fact, the lithium battery was never really meant to be anything else than a quick hack to get it going, but I never got into replacing it with something better suited. For this upgrade, however, I got a sealed lead-acid battery and added a 5A circuit breaker. 5A should be enough for normal operation, but also low enough to protect the battery and the wiring.

Connecting power wires. The black block at the back is the 5A circuit breaker. The reset button of the circuit breaker is accessible through the underside of the scooter.

A better view of the inside compartment, showing the speed controller board. The motor is just dangling from the wires for testing. The off-white part in the compartment is the gearbox to which the motor connects.

Flashing the software. The speed controller is seen dangling from the wires. The scooter is too large to comfortably fit in my hobby room, so all of this was done in the living room and on the dinner table.
Taking it for a test spin. Works great!
The biggest requests by my son still has are to get flashing lights and a police siren. So those will be up next. He also wants a speedometer, which I think I'll do some time later using a 128x64 graphics LCD module I've had waiting to be purposed for something.

Tuesday, March 8, 2016

Changing the color wheel on my DLP projector

One evening, just as we were about to turn off the projector, it made a horrible glass breaking sound and the picture went black and white. My first reaction was, that the lamp exploded, but realized a second later that the picture was still there. Only the colors were gone. Obviously it was the color wheel that had disintegrated. The reason for it failing is unclear, as the projector is mounted on a solid concrete wall isolating it from most vibrations.

I contacted the manufacturer to obtain a replacement part, as it is not sold as a standard replacement part. Their Finnish representative replied that they only sold the part together with servicing. They also said that it would cost 60e to do an estimate of the cost of repair. Ugh. I didn't want a service, I wanted the part. I would have happily paid 100 euros or more for the part. No wonder the Finnish economy is in crisis. I would have wanted to buy, but no-one wanted to sell.

So, since the official source didn't want to sell the part to me, I had to look at alternatives. Turns out there are very helpful eBay stores, which sell all sorts of parts for projectors. I found the correct part for about 30 euros and decided to pay some more for expedited shipping through DHL. So for about 70e all together, I got the part shipped to me.

I had checked online how the repair was done before ordering the part. The whole process is very trivial. The whole assembly is removed and the motor removed from the assembly. The new motor with the new color wheel is then put in and the assembly reattached.

The color wheel assembly. I had already removed the old motor and the glass shards from the old color wheel when I took this photo.

Second view of the color wheel assembly. I had already removed the old motor and the glass shards from the old color wheel when I took this photo.

The old motor. No pieces of the color wheel are left. It got completely destroyed.

New motor with the new color wheel attached.

New color wheel fitted in the color wheel assembly.