|
Post by kennedylanduk on Sept 30, 2010 16:41:44 GMT
I've just built one of the kits.
When I connect it to the track, the motor is constantly on.
Is there something obvious I might have done wrong?
Thanks in advance for any help,
Tony.
|
|
|
Post by kennedylanduk on Sept 30, 2010 16:44:47 GMT
PS. I did put in D1 even though it was not shown on the strip-board layout diagram.
And the motor only goes one way (pressing the reverse on the controller makes no difference).
|
|
|
Post by Paul Harman on Oct 2, 2010 23:59:34 GMT
There is nothing obvious. Have you done the static voltage checks? They are a good indication of most of the likely problems. Beyond that it is just a process of elimination.
What happens when you connect the decoder to a DC supply? Does the motor reverse OK then?
If you have a PIC programmer you can try programming the address to something other than 3 and then reading the EEPROM location 01 in the PIC programmer to see if it has changed. If it has take a look at the motor drive circuit, if not take a look at circuitry between the track connections and pins 6 and 7 on the PIC.
|
|
|
Post by kennedylanduk on Oct 5, 2010 6:33:59 GMT
Thanks Paul.
I have done the static voltage checks.
It looks like it is a dodgy programmed chip, I've ordered a new programmer (a JDM programmer I had in a drawer can read but not write the 12F629), but it will not be here for a few days. I'll report back once I have it.
Tony.
|
|
|
Post by kennedylanduk on Oct 11, 2010 18:59:28 GMT
I've just built up the 2nd of the kits I bought, exactly the same result. Motor constantly on.
All voltages are correct again, and I programmed the pic using my new Pickit2 programmer. The pic verifies ok as well.
I've programmed the chip using "DIY Motor 629.hex", is this the correct hex file?
|
|
|
Post by kennedylanduk on Oct 11, 2010 18:59:54 GMT
PS, if it helps, I'm using a Hornby Elite controller.
|
|
|
Post by Paul Harman on Oct 12, 2010 8:41:32 GMT
It sounds a little like it is not decoding any DCC data. I think that the next thing to try is to see if it works on DC to rule out any incompatability with the Elite.
1. Remove the L272 chip from its socket (or disconnect the motor).
2. Install the function decoder firmware.
3. Connect the red and black wires to a regulated DC supply (anywhere between 7V and 20V) and measure and note the voltage on pins 2, 3, 6 and 7 of the PIC.
4. Reverse the polarity of the red and black wires. The voltages on pins 2 and 3 should have reversed, following the reversal of pins 6 and 7.
This will demonstrate that the PIC is functioning OK in DC mode and that the track signal is getting to the PIC. If this is the case it looks like there may be an incompatability with the Elite.
If you are not seeing the correct voltages at pins 6 and 7 check the values of the resistors connected to those pins and check for shorted tracks.
|
|
|
Post by kennedylanduk on Oct 12, 2010 12:43:53 GMT
ok, I've got some results.
Connected the 1st decoder up to DC supply (a standard Hornby one), and no life in it.
Connected the 2nd decoder up to DC supply, and no matter which way I connect it (or flip the switch), the motor only spins anti-clockwise. The speed control works though, the more voltage I give it the faster the motor goes, but only anti-clockwise.
The 2nd decoder was missing the jumper from pins 6-7 on the L272. When I bridge these, I get no life from it. When I un-bridge pins 6-7 on the 1st decoder, it behaves the same way as the 2nd decoder.
Does all this make sense?
Both work in one direction only on DC power (no matter what the polarity is) as long as pins 6 and 7 on the L272 are not connected.
I'll measure the voltages in a moment (once I can find my multimeter).
Tony.
|
|
|
Post by kennedylanduk on Oct 12, 2010 13:29:21 GMT
ok, I've got some voltages. How do these look? The only one that really reversed was pins 6 and 7.
PIC was still in circuit, and 17v was coming from the Hornby controller.
----------Normal------Reverse Pin 1 ------3.5V------3.5V Pin 2------0.3V------0.3V Pin 3------0.2V------0.3V Pin 6------1.7V------0.3V Pin 7------0.3V------1.8V
|
|
|
Post by Paul Harman on Oct 12, 2010 18:56:12 GMT
I would expect to see 5V on pin 1 if a 5v regulator is being used. It looks like a problem with the power supply section. Voltages on pins 6 and 7 look OK.
Remove the PIC and check that the regulator and the bypass diode are in the right way round. These components are likely to be damaged if they have been put in the wrong way. It is also worth checking the polarity of the tantalum capacitor.
|
|
|
Post by kennedylanduk on Oct 12, 2010 19:06:26 GMT
The regulators are 78L05 (came in the kits). I was very careful with those, looked at the datasheet to make sure I had them the correct way around. I'll see if I can get a couple of replacements tomorrow and see if it makes any difference.
The tant is also the correct way around.
|
|
|
Post by Paul Harman on Oct 13, 2010 10:00:39 GMT
Check the input voltage to the regulator and make sure it is at least 7V.
|
|
|
Post by kennedylanduk on Oct 13, 2010 12:46:53 GMT
I've replaced the regulator and the cap (I used a 1uF electrolytic as I had one to hand).
Voltage into the regulator hovers around 17V. I'm still getting 3.6V on pin 1 of the pic. I've tried two different (brand new) regulators, both give the same result.
Just out of curiosity, I removed the regulator (I put some sockets in so I can swap it out quickly), and I get the same results (motor only going one way). The voltage at pin 1 of the pic is 1.5v if I remove the regulator.
|
|
|
Post by kennedylanduk on Oct 13, 2010 14:41:38 GMT
I've drawn out an image showing exactly what I've made (including the orientation of the diodes). R15 is over D7, but apart from that, this is the circuit I have made (twice now using the kits). Does it look correct?
|
|
|
Post by Paul Harman on Oct 14, 2010 8:08:09 GMT
Apart from the cuts being missing under the L272 it looks OK at first glance. You need to investigate why you are not getting 5V out of the 5V regulator though. I think that is fundamental to what is wrong. The output from the regulator should only be connected to R14, C3 and pin 1 of the PIC. Only C3 is required to be connect to the output for reliable operation of the regulator. R14 is 10K so should not provide a big load - have you checked the value of R14?
|
|
|
Post by kennedylanduk on Oct 14, 2010 8:15:02 GMT
The cuts are under the L272 (I don't have any tippex so ended up sellotaping white paper over the drawing before scanning).
I'll check again for any shorts (although I'm getting really fed up with this now).
|
|
|
Post by Paul Harman on Oct 14, 2010 8:23:05 GMT
You should be able to get the 5V power supply working. It is quite straightforward and it is always worth checking the 5V is OK before plugging in the PIC and L272.
|
|
|
Post by kennedylanduk on Oct 14, 2010 13:12:18 GMT
Can you tell me which components I need to check for the power supply part?
I cannot spot any shorts, as far as I can see the kit is put together correctly, and both kits behave in exactly the same way. So I've either made them incorrectly or some components must be faulty/wrong. I think.
Could C2, C3 and C4 be the problem? I cannot make out the numbers on these (but assumed as I got 2 small ones and 1 larger one, that the small ones are C2 and C4, the lager being C3).
|
|
|
Post by kennedylanduk on Oct 14, 2010 13:53:15 GMT
I've checked those caps, they are ok (can see the numbers fine outside in natural light, 104 and 474).
Also checked the rest of the components.
D1 - Correct (1N4148) D2 - Cannot make out the numbers due to position D3 - Correct (1N971B)
D4, 5, 6 and 7 - all 4003
R1, R2 - Both 10k. R3, R4 - Both 1k. R15 - 4.7ohm R14 - 10k
|
|
|
Post by kennedylanduk on Oct 14, 2010 14:22:00 GMT
R15 is one of the small blue Maplin resistors, could that be the problem?
|
|
|
Post by kennedylanduk on Oct 14, 2010 14:59:47 GMT
I'm going to attempt building it on breadboard, but cannot find a 4.7Ohm resistor locally, will a 10ohm do instead?
Thinking about it, would two of the 10ohm in parallel be ok instead of 4.7ohm?
|
|
|
Post by Paul Harman on Oct 15, 2010 12:26:30 GMT
For breadboarding you can omit R15 and replace it with a link, leave out D3 and D1 as these are only required 'in the wild' for supression of nasties such as track voltage spikes over 30V and high capacitance loads on the 5V constant brightness lighting units.
You should be getting at least 7V (but less than 30V) into the 78L05 regulator and exactly 5V out.
C2 and C3 should be physically close the the 78L05 on short leads.
|
|
|
Post by kennedylanduk on Oct 15, 2010 18:36:20 GMT
I give up.
I built up just the power supply part on breadboard (using new parts) and got 4.9V out of the regulator. Transferred it to some strip-board and got 4.9v. Added R1, R2, D2, C4, R14, C4, R3 and R4 plus the jumpers, tested the voltage again and now I'm getting 0v. Disconnected R14 and D2 (which should have completely disconnected the new components from what was working previously), and I still get 0v.
I give up. I've wasted hours and hours trying to get both the kits and now a new build to work and just failed miserably.
|
|
|
Post by kennedylanduk on Oct 15, 2010 22:49:35 GMT
ok, I didn't give up (I've spent far too much money on it to just bin it, 2 kits, a pickit programmer, etc etc). And I really want it to work after investing so much time in it. I made up a 4th one (just the PSU section) to see if I could get the magical 5 volts. But it came out at 3.5v again (similar to the two kits I bought from you). So I searched the web for 78L05, and found stuff.nekhbet.ro/2006/06/18/how-to-build-a-5v-regulator-using-78l05-7805.htmlThis circuit has a 100uF cap on the way in and 10uF on the output side of things. And on the datasheet here w3.id.tue.nl/fileadmin/id/objects/E-Atelier/doc/Datasheets/Spanningregelaars/78l05.pdfIt shows .1uF on the output and .33uF on the input. But on the circuit for the motor decoder, the cap values seem to be reversed (large cap on the output, small on the input). So I swapped C2 and C3, and now I am getting 4.9v. Could this be why I've been having no luck? And is there any harm in matching the values from the datasheet? Another thing I noticed, my multimeter reads 4.9v, but leave it for five seconds or so and it drops to 3.5v. Turn the meter off/on and it's back to 4.9v. Maybe I need a new meter.
|
|
|
Post by Paul Harman on Oct 17, 2010 15:41:54 GMT
There is no harm in copying the application notes on the datasheets.
The capacitors are there to stop instability. Generally you can put as much as you like on the input, but it is the little ceramic one (C2) that stops the oscillations due to being much lower impedance at higher frequencies. The tantalum capacitor is quite low impedance so you could probably replace both C1 and C2 with a high value tantalum and put it in the C2 position.
Sometimes putting a big capacitor on the output can cause instability. I would recommend that you always have a bigger one on the input than the output, although there should be no need for a really big one on the input since the current consumption of the PIC is very low. If you are using a big one on the output I would recommend a low impedance type such as a tantalum rather than an aluminium type which have a large effective series resistance. Large value ceramics tend to be very big and very expensive
If you are getting oscillation in the regulator, it will cause your meter to display strange values, and only an oscilloscope will confirm what is actually happening.
There is a possibility that the load on the regulator is too small, so it may be worth trying to reduce the value of R14 (just put a 1K in parallel as a test) to see if that makes a difference.
|
|
|
Post by Paul Harman on Oct 17, 2010 16:21:42 GMT
|
|
|
Post by kennedylanduk on Oct 17, 2010 17:04:48 GMT
So should it make any difference if I swap C2 (100nF on the output) and C3 (470nF on the input)? I'm not quite sure if the problems I've got are due to dodgy multimeter readings or something else. There is a possibility that the load on the regulator is too small, so it may be worth trying to reduce the value of R14 (just put a 1K in parallel as a test) to see if that makes a difference. On my latest experiment, R14 is not even in the circuit. Could this cause the dodgy multimeter readings?
|
|
|
Post by Paul Harman on Oct 18, 2010 9:29:49 GMT
I would always recommend putting some load on the output of a regulator when measuring the voltage in order to ensure it is stable.
|
|
|
Post by kennedylanduk on Oct 19, 2010 12:59:16 GMT
Just an update.
Bought a cheap multimeter on ebay. The two newer decoders I have built are now showing a steady 4.9v coming out of the regulator, so hopefully that is ok.
Now I need to put in the rest of the resistors/caps which go next to the PIC. Probably will not be today though.
I feel like I'm getting somewhere at least. The worst thing is I probably had the correct voltages earlier on (Pin 1 ------3.5V------3.5V), my multimeter was giving me dodgy readings!!!
|
|
|
Post by Paul Harman on Oct 19, 2010 15:00:15 GMT
You are getting there, and will get them working.
|
|