Tuesday, December 4, 2012

Chipping an AUTOart Peugeot 307 WRC 2005

I found this car on eBay quite cheap, and as I had a saloon chip laying around I figured it was time to get a car to put it in.
It was a bit of a gamble as I didn't know if I could fit the chip inside it. But as I've managed to do it on a Mitsubishi from the same manufacturer, I figured I could give it a try. However, when I got the car and popped the body on it, and desperately trying to find a suitable spot for the chip, I just had to give up with the conclusion that it's not possible to fit the saloon chip without destroying quite a bit of the nice looking interior.
I had to get a one-seater chip instead and hope that it would fit...

So, today I got the F1 chip and took a new look inside the car, and this time I found a spot to mount it in! So, let's get started.

Car's body removed

 The place that I found for the chip will be just underneath the hood of the car, i.e. above the car's guide blade. In this spot, the chip can be mounted without having to do any sort of modifications to the car's body or chassis, which makes it a bit easier. The downside, on the other hand, is of course the risk that it will touch the gears on the front axle.

I begun with stripping away everything on the chassis, i.e. both wheel axles and the motor. The wheel axles have some kind of locking mechanism on top of the bearings. These have to be twisted about 45 degrees to get loose.

Remove the bearing locks by turning them counter-clockwise
To get rid of the motor, the connections to it must be soldered off.
Now with everything removed, it's a bit easier to get the work done. I started with drilling the 3mm hole for the IR LED just in front of the holder for the driving shaft's bearing.

Everything in the chassis removed and the 3mm hole for the IR LED drilled

 To get the IR LED kept in place, I added a small amount of glue,

A bit of glue keeps the IR LED in place
Next I added a bit of extensions to the motor cables, and soldered them to the chokes on the motor (the resistor-like things). I let the original cables from the guide blade to be where they were and soldered the green and yellow cable to each of them. Every solder got a bit of heat shrink tube to protect from short circuits. I added some small strips of electrical tape to protect the cables from contacting the axles. The back-side of the chip also got some tape to protect it from a metal mesh in the hood and the LEDs for the driving lights.

Everything put in place. Note the chip upside-down in the front of the car.
To get the chip to be kept as high up as possible (and hopefully not touching the gears), I added a rolled piece of tape on top of it (see picture above) which will make it stick to the inside of the hood. When I had mounted the body, I gave the chip an extra push upwards with a screwdriver through the wheel arc to make sure it really stuck to the hood.


And the final result:
The underside of the car, where the IR LED is visible.

The finished result

Thursday, November 29, 2012

Fixing a Canon CA-910 battery charger

A friend of mine (and also neighbor) came by the other day. He had borrowed a MiniDV and with it, of course, a battery charger. Now, when he connected the charger to the outlet, it just "poffed" and didn't of course work after that. That's when he called me ;-)

The Canon CA-910 battery charger
What I first noticed was that there seemed to be something loose inside it, because when I shooked it I could clearly hear something rattling inside. If this something was of some kind of conducting material, then that could very well have caused the failure.

Well, nothing else to do but to open it up I have a look. And this is what I found.

The loose objects inside the charger (above the pcb).  Note the missing ferrite core on one of the coils.
It was the ferrit core of one of the coils/chokes that had split into three pieces and fallen out of the coil housing. Now, those ferrit parts are indeed conducting, and if you take a closer look at the resistor to the right of the fuse, you see that it's been burned. So this is probably what's happen.
The loose piece that short the charger.
The good news was that nothing was really damaged, because the current went straight through the fuse and blew it. However, after taking a look at the other side of the pcb, I saw this.

Track burned off due to the short circuit.
The fix was i.e. quite easy. With some quick glue the pieces was replaced where they belonged, and the PCB track gap was bridged with a piece of cable.

New fuse and the ferrite core glued into place.

A piece of cable to bridge the track gap.
After those fixes, the charger was working again! Job done =)

Tuesday, November 20, 2012

Reparing an Airam Cooler 262T cool box

We bought this "active" cool box to keep the food in good shape on longer car trips. The box can be used on both 12V DC and from a 230V AC outlet. The 12V side sports a voltage guard, keeping the ~60W peltier from draining the car's battery.

The Airam Cooler 262 T

The box haven't been used that much the 2 years we have owned it, but there already seemed to be something fishy with the voltage guard this summer. I didn't mind taking a look at it before our planned trip to Lapland was closing in in September.

Verifying the fault

I begun by testing it in the car, with the engine running, and as I feared the box didn't start but only complained about low battery level. I then took it inside and hooked it up to a wall outlet, and to my big surprise the same "low battery level" LED lit up. What?! Nothing else to do but to open it up and see what's going on. However, that was easier said than done, because I couldn't find any screws that kept the top part of the lid in place. I almost broke it trying to figure out how to open in, when I realized that the screws must be underneath the lid's foam gasket...

Lid screw position under the foam gasket. One screw per side.

Reverse engineering the PCBs

Inside the lid I found two PCBs (actually three, but the third one is the 230VAC/12VDC transformer). One with a couple of relays, seemingly some kind of power board, and the other with some finer electronic components.

Relay and heat-or-cooling switch PCB

Under-voltage protection and LED indication PCB

I figured that it's best to just trace the tracks on the PCBs and sketch a schema over the circuits.

Sketched schema over the power PCB

Sketched schema over the voltage sensing/illumination PCB

Nice, huh? ;)


So, I realized that relay 1 (REL1) is a switch for battery or outlet power and REL2 is the safety switch for preventing the battery from draining. The thing is that I could hear a *click* when the outlet power was connected, which meant that the REL1 worked but REL2 didn't or wasn't just energized.

Next I tried adding 12V directly on the relay coil, and it clicked, which meant that the relay was working. This also meant that some part of the under-voltage protection sensor electronics was broken.

Finding the faulty component

By looking at my schema I quickly found a transistor grounding the relay coil on signal from the comparator (IC1). By measuring the voltage on the transistor's (Q1) base I saw that it sure did get the signal comparator, but it didn't lead current through to the emitter. Ahaa! There's the problem. I then tried to short circuit the collector and emitter legs, and voila! the fans started spinning!
Faulty transistor.

I replaced the transistor with one that I found in my drawer, which had kind of the same specs, but the collector and emitter legs where switched, so I just had to turn it 180 degree compared to the original one before soldering.
Tested with both 12V DC and 230V AC power source and both now works again!
Green light and a spinning fan, the thing is working again!

Thursday, August 23, 2012

Repairing a Philips Plasma TV

I was visiting my sister some weeks ago and their TV had given up. It was an almost 10 years old, first generation plasma TV which was state of the art when it was new. Now it was about to be part of the gigantic e-waste mountain the "planned obsolescence" industry and our crazy I-always-want-the-latest-gadget society generates every year. To my luck, they asked me if I wanted to have it, in case I could repair it and hopefully make use of it for still some more time. Said and done, I stuffed it into our car and brought it home.

The TV set comes with the plasma screen and a separate tuner/input box. The two are linked with a vga cable with integrated stereo audio cables with cinch connectors.

The problem they have had was that the TV had begun to take some time to start-up and after a few weeks it got worse and they had to turn it off on the power button on the side of the TV a couple of times before it kind of got warm enough to come to light up.

Fixing the tuner box

When I got home and connected everything together, it seemed to me that the tuner box didn't want to start, because the power LED did some blinking, both green and red and the ended up in an amber colour. A quick google search, and I found this thread on FixYa. Seemed that some PIP (Picture In Picture) board had a faulty fuse. One of the solutions was to disconnect the board completely, and to my big surprise the power LED did now stay green! However, now the SCART inputs didn't work. Only sound came through...hmm...however, replacing the fuse 1800 (MP40, 400mA) and re-connecting the board did the trick.
Tuner box's PIP board with "replaced" MP40 fuse.

Fixing the plasma screen

Next problem was the plasma itself. After removing a fairly large amount of screws, the back plate did finally came loose.
TV's back side.

TV with back plate removed. PSU in the middle.
The TV did take a couple of on-off cycles before it finally showed any picture. But google to my rescue! I was certainly not the only one trying to fix a similar TV. Turns out its a quite common error on these models (if not almost all plasmas) due to the high temperature they generate and is most often caused by some dried out capacitors in the PSU. On this thread at avforums.com (22 pages long!). As I read the first pages I found out that I should try to change what seemed to be the most typical caps to fail, i.e. 2662 (25V 1000 uF) 2663 and 2664 (both 50V 100uF), but without any luck.

The PSU with the caps that I canged marked.
However, on page 10, I found someone that had figured out the most fragile capacitors on the exact same model as mine. The post is found here. I marked all those caps with a marker pen and found out that the caps were in smaller groups. By using the old hair-dryer trick I quickly found out that about 5 caps in one group was failing, because when pre-heated, the TV fired up instantly! These caps (2465,2508,2540,2541) were surface mounted (except one, 2510), so it was a bit tricky to remove without destroying the PCB. Actually one of the tracks came loose, and I had to replace it with a small jumper wire. The new caps were for hole mounts, so I had to bend their pins to fit the pads on the PCB.
New caps in place.

Surface mounted caps replaced with standard ones.


When the caps were changed, the TV lit up instantly, the fix had worked!

TV stand

Next thing was to get a stand for it, because I didn't want to mount it on the wall. So a bit of carpentering, and voila! a nice TV stand. Sorry for the bad picture quality (taken with my mobile's cam in a dark room...)
TV on stand, back side.

TV on stand, front side.


Sunday, April 15, 2012

Chipping an AUTOart Mitsubishi Lancer Evolution VII WRC

I finally took the time to chip my Mitsubishi Lancer Evolution VII WRC from AUTOart.

After popping the hood, this is what's revealed. What one immediately notice is that it's very little space for the chip in here (as the car is apparently not designed to be chipped). Another problem is the placement of the IR LED as the drive shaft is in the center of the car.

I started by removing all the stuff inside the car, that includes both wheel axles, engine, cables and the switch with which you can choose the polarity to the engine. I then drilled the front-most hole to suitable size for the LED.

 The problem here is that the dive shaft will short the LED's pins, so I tried getting it as low as I practically possible, however not all the way down as that could risk it touches something on the track. A bit of electrical tape on the LED's pcb should protect it from shortening...


I found that the chip itself can only be positioned on the left side of the motor and as far to the front as possible. The chip does also need to stand flat on the bottom which requires some cutting of plastic enforcement aligned with the rear-end of the motor's fittings.

 Another problem is the light's pcb in the car body. This must be cut loose in one end and bent back as far as possible to make room for the chip (see blue frame in above pic).

After this, it's just a matter of soldering all wires together and below is the result:


 Underneath you can see the IR LED between the front axle and the motor.

Thursday, March 15, 2012

Scalextric Car ID Sensor

Of course I also have to build a car id sensor for my digital scaley track.
On the same great Electric Images site both electrical schema and PIC assembler program are provided for you to build your own.

My goal is to have support for at least four id sensor on the track. Two at the start/goal line of course,  and one at each end of a future pit lane.

Building a test setup

I've only tested the id sensor on my breadboard so far, but I had some problems getting it to work (as usual...).
After getting the components needed and the circuit built, I ran some first tests just to see if the confidence LED blinked, but no, nothing happened... I started analysing the assembler code to find out how it works. I measured the timing of the IR signal from the car with my oscilloscope and created a stimulus profile in MPLAB to simulate the same car. The simulation showed no signs of problems, so I just tried fiddling with the span for each car id that the program accepts. Suddenly I got some flashes from the confidence LED and thought I had solve the problem.


Sending the serial data to the computer

After getting the LED to show signs of successful id sensing I connected the PIC's 7th pin to the powerbase's USART port and modified its code to send the data over the USB cable so I could verify that the correct car id is actually sensed. After some struggeling with the USART configuration I got some garbage data sent to the computer. I blamed the PIC18F for the garbagage data and got a RS232 chip from the radio schack to be able to connect the PIC directly to my computer's serial port instead. What a disappointment when I realized that more or less the same garbage showed up through the serial port too. Now I tried to find the fault in the serial sending part of the code and did some more debugging in MPLAB, just to come to the conclusion that it seemed to work. The only strange thing was some undocumented OR:ing with the hex value of 0x30 and 12 bits package size, which in itself hadn't anything with the garbage data to do.

Finding the cause of the problem

I realized that I had to start debugging at some really basic level, so I modified the program to send the hex value of 0x55 (10101010) continuously on the serial out pin. I hooked up my oscilloscope and measured the bit timing. AHA! Now I finally found something that wasn't right. The bit timing was way off. It should have been 17.6uS (@ 57600bps) but it was something in the 25uS region. Now the question was, why?!
As the PIC contains a built in clock, it had to be something wrong with it...and yes, at the program memory address 0x3FF where the factory calibration value is saved, I did only find the value of 0x00. Not good....

Fixing the clock problem

Luckily I'm not alone with the problem, and after a short trip to google I soon found sites describing the issue and how to fix it. At this page a complete circuit schema and assembler program are provided to recalibrate the built in clock. Soon I had built yet another circuit and got a new calibration value. Using the tip at this page on the same site, I marked the pins on the PIC according to the binary value of the calibration value, to (hopefully) never have to the recalibration again =)
This time the original id sensing program worked for real and the data sent over the serial line worked perfect!

 
In the video the car is programmed with id 3.


Next thing is to figure out a way to support 4 of these serial data lines on one cable, preferably the same USB cable as to the power base.

Thursday, February 9, 2012

The Scalextric Digital Power Base project (Part 3)

The PIC software


The software running in the PIC processor is of course taken from the same site as the electronic schema, i.e. Electric Images. I didn't get it to work right away, but after some tinkering with linker scripts (that also takes care of not writing over memory space used by the bootloader) etc, I finally got it compiled and running on the device.

USB Interface

Next challenge was to implement the USB communication. Using this blog I got some inspiration and hints on how to make it work.  After some troubleshooting trying to get data sent from the device to the computer, I realized that I still had some errors in the linker script. This time regarding the memory position of the USB I/O buffers. After fixing that, the communication worked like a charm. Next step was to implement some functionality for the USB communication. In the ProcessUsbIO(void) function I added the following two commands:

switch(ReceivedDataBuffer[0])
{
  case 0x80: // Set remote controlling
    use_remote_data = ReceivedDataBuffer[1];
    break;

  case 0x81: // Send/Receive track/car data
.
.
}


The first command, 0x80 sets a boolean variable that tells the base station to use USB data for sending data to the cars. The other command, 0x81, sends the current handcontroller states to the computer and receives commands to be written to the cars.

Overriding the hand controllers

In the original digital base controller, when connecting it to a computer, the computer takes complete control over the power base. That means that all data from the hand controllers are flowing through the computer before being sent to the cars. So I made some changes to the PIC code so that it would send the commands through the USB interface and read them from there to be sent to the cars. To my surprise it was a quite easy task and did work pretty well without any notice of delays or lags, using 10ms read/write intervals.
The logic in the PIC to handle the data to and from the computer (command 0x81) looks something like this:

  case 0x81: // Send/Receive track/car data
    ResetToSendDataBuffer();

    ToSendDataBuffer[0] = 0x81;            // repeat command id
    ToSendDataBuffer[1] = PORTCbits.RC0;// track power enabled
    ToSendDataBuffer[2] = amps_read;    // amps used on track (raw ad value)
    ToSendDataBuffer[3] = live_buf[0];    // track packet type
 

    // loop through each car data
    for (car = 0; car < 6; car++)
    {
      BYTE breakData;
      if (pre_car_brakes[car].bits.on)
        breakData = 0x80;
      else
        breakData = 0x00;

      ToSendDataBuffer[car+4] = pre_live_buf[car];
      ToSendDataBuffer[car+4] |= breakData;
    }

    TransmitDataToHost();

    // only write to live_buf if remote data is set to be used and speed packets are written to the track
    if (use_remote_data && live_buf[0] == PKT_SPEED)
    {
      for (car = 1; car < 7; car++)
      {
        live_buf[car] = ReceivedDataBuffer[car];
        car_brakes[car-1].bits.on = ReceivedDataBuffer[car] & 0x80;
      }
    }
               
    break;


The basic idea here is to save the hand controller states in temporary variables called pre_live_buf and pre_car_brakes. From there they are sent to the computer. When the computer then sends the commands for the cars, they are directly written to the original live_buf and car_brakes variables used in the original code.

I'll post the full code at some later time as it's not so nice looking at the moment as it's still in a proof of concept state.

Tuesday, January 24, 2012

The Scalextric Digital Power Base project (Part 2)

The Electronics


PIC Programming

The first challenge I had building the Scalextric Power Base according to the Electric Images' blue prints was to get all the components and to "burn" the program into the PIC18F2550 processor. I thought it's best to buy just the PIC to start with and try to get it working. I found a test circuit board I created in vocational school for a PIC16F84 processor and thought that it must somehow be possible to use the Ludipipo/JDM programmer on it, even if it's as simple as a programmer can be (only three resistors and a diode). Because the test board was designed for a much smaller PIC than the 18F2550 didn't of course fit, so I taped a breadboard onto one side of the test board and connected power and data to it (see pic).

I had a very tough time getting the programmer to work with the PIC, I almost gave up. I probably tinkered with it for like 4 months! before I got it to work (but don't think I'm that crazy that sat every evening with it, after all it was summer so in total it took me perhaps one or two weeks worth of evenings). On the same time, I got to blow some dust off my rusty electronic knowledge.
The trick that finally made it work was found here, a short but very important notice about a low pass filter on the data line that decouples them from high frequent noise.
After I got the programmer to work, I burned a bootloader (such as the one described in this blog post) into the device to be able to program it via the USB interface instead of using the troublesome serial port. When the USB programming went smooth, I could concentrate on the program itself. It took some trial and error before I understood how the MPLAB IDE and the C18 compiler worked, and I didn't of course want to ruin the bootloader that I finally got into the PIC, which of course required some extra fiddling with linker scripts.

Circuit Board

Now that I got something into the PIC, the next step was to try getting all the required components for the power base. After trying hard to find a place selling the BTS7960B half bridge IC on the net I realized that it is discontinued and is replaced with another one, called BTN7960B. This made it a little bit easier as I now found it on digi-key. While waiting for the components to arrive from the states, I begun designing the more permanent stripboard on which the circuit would sit.

To do this I used an application called VeeCAD, which makes the design phase much easier than trying to figure out a working design on the physical board itself.

Download the VeeCAD file here

When I had all the components that I needed and the design was completed I soldered it all together and tried it out using a car directly connected to the output, and to my big surprise it worked the first time!!






When I later connected the power base to the track and added a lane changer (LC) to the game, some bug/design flaw appeared. When the car moved over the IR-sensor of the LC, the car stopped and the LC made some strange noise. Read more about the problem at SlotForum. I still haven't fix the root problem, but found a workaround (described in the forum thread).

Sunday, January 8, 2012

The Scalextric Digital Power Base project (Part 1)

Introduction


It all started last Christmas when I got a Scalextric slot car track as a present from my wife. Well, actually I was with her buying it, she just convinced me to take it =)

At first it was of course fun to just drive and re-live the childhood, but I had bigger plans for it! As my nephew already had one of these Scalextric tracks I had got inspired and already had came up with a few ideas of what one could do with it.

The first thing I did was to build a lap-time system using micro switches build into the track, sending the switch's state to the computer through a Toradex I/O card to my custom build application that then signaled a program called Ultimate Racer 3 that took care of the race setup, lap-timings etc.

This worked ok, but when I found out what the digital era of slot car racing meant and I stumbled upon a complete electrical schema and source code for the microcontroller at Electric Images, I thought that I just had to try to build one myself!

The goals that I put up for the project was that I at least should be able to do the following with my setup:

  • Control the cars with standard Scalextric hand controllers (duh!)
  • Interface it with the computer using USB
  • Be able to use existing software that can communicate with standard Scalextric power bases (like the C7042), such as SSDC and PC Lap Counter. The original power base uses the RS485 serial standard to communicate with a computer.

The two last bullets does of course require some custom software to translate my data flowing on the USB line to the protocol used by the C7042 device.

In the coming posts I will describe in more detail about how the project has gone so far, what problems I've faced and what new things I've learned.

Monday, January 2, 2012

My first blog post, ever!

After several months of thinking that I should create a blog to post things about my home projects and such on, I finally got it done. So here it is, a new fresh blog, just like the new year, ready to be filled with interesting stuff.

The current project I'm working on is a control and monitoring system for my slot car track and I'll post more info on that soon.

And no, the blog's name is not misspelled ;-)