Category Archives: Electronics

Electronics

TWS-N15 Noise Source 10 MHz-2 GHz: a few more sets

Coming back to an earlier post, Noise source design, I wanted to post the final results, and the looks of these noise sources.

The case is an aluminum extrusion design, and the lids are milled to accomodate the BNC and SMA connectors. The SMA is a really high quality connector. No point in using a noise source with a cheap connector – you are normally going to connect and disconnect this often.

The constant current supply is optimized for the maximum noise output, normally, about 8 mA. The design is a current mirror, with a TL431 precision reference.

The noise section is soldered with 0603 SMD mostly, on a FR4 board.

Foam and copper tape to avoid any foreign signals getting into it. Spurious signals can mean big trouble with noise measurements.

Return loss, I think it is pretty good.

SWR.

After some optimization of the circuit, the ENR output is now pretty flat, even with no specially expensive noise diode.

After all, pretty happy with the device, and others are happy two, as I give them away at low cost. If you need one, let me know.

Crimping Molex Contacts: 3.96 mm KK Style, new capability add to my workshop

For year I have been using various Molex style connectors, 2.5 mm, 3.96 mm, and so on, but never by crimping own contacts. Criming is a special art, and if not done properly, it can cause all kinds of reliability issues. So I usually purchased pre-crimped wires, and just assembled them for contact blocks. In other cases, I just used regular pliers to mount wires to contacts, and soldered them in (best, to pre-tin the wire, then mount it in the contact with small pliers, then solder it in – this will result in a very reliable connection. Also, never use low quality wire, only full copper core, heavily tinned wire, UL 1007 or similar.

But why not try to crimp contacts ourselves and add a new capability to the workshop? So I went ahead, and ordered a low cost pair of crimping pliers, EUR 12, not bad.

It made it from China to Japan very quickly, delivered by a friendly postman (here they are very friendly). That’s the tool: quality looks quite OK, and the steel is pretty hard. Sure this is not a high throughput production tool – I am looking at a few 10s of contacts every year, not 1000s.

Step 1, remove the insulation from the wire, and get the contact and pliers ready.

Step 2, insert the contact in the pliers, and close it until flush (don’t apply much force).

Step 3, insert the wire, and crimp the inner connection. Don’t get any of the insulation caught up by the crimp. It is a bit inconvenient to get the contact out of the pliers, probably will make a special tool for it (a U-shape bent piece of steel sheet metal to push out the contact).

Step 4, Inspect the inner crimp. Use a magnifier if necessary (make sure no plastic and insulation got into the crimp area). Pull on the wire, it must be firmly held (a properly crimped wire can’t be pulled out by any reasonable force).

Step 5, slightly close the insulation crimp using the tip of the pliers.

Step 6, establish the insulation crimp.

Step 7 – It’s ready. Inspect. Carry out pulling test.

HP 8412A Phase Magnitude Display: really unusal supply voltages…

Looking for the CRT front bezel and frame to fix another unit, I found this 8412A Phase Magnitude Display on a Japanese auction site for EUR 8 plus shipping, really affordable! Also, I believe it to be a great source of spare parts, because there are many of the HP standard semiconductors of the 70s inside.

The unit arrived in great shape, almost too good to take it apart – maybe we can use it for something cool, like a CRT clock or some soundwave visualization unit?

How to get it to work – checked the 8412A manual, and, unfortunately, it needs a whole lot of unusual supply voltages (the 8412A slides into the 8410A/B Network Analyzer mainframe) – not easy to operate it without the mainframe. 175 Volts AC, to drive the CRT and 6.3 VAC heater, and +-20 VDC, for the other circuits.

Some pictures of the unit…

The dangers of high voltage are fairly obvious!!

Quite similar to other HP units – amazing how often they recycled the design!

2.000 kOhm, +- 0.05% resistors, a matched pair – not bad! Definitely, a lot of good parts in this unit, including high voltage parts, a good CRT, many semiconductors and transistor pairs, mica capacitors, etc.

HP even supplied a small test board to make service and adjustment easier! Great!!

Si5351A + u-blox M7: Clock generator tests

With the Si5351A mastered, time for some tests with the actual application, the GPS receiver (and later GPSDO system).

Two tests were performed:

(1) Using the Si5351A clock generator with a standard, not specifically selected or particularly stable crystal. Presumably, an AT cut crystal, running at 25 MHz.

(2) With the Si5351A driven by a OCXO (HP 10811A, part of a 8662A unit – will be later replaced by a stand-alone unit using a HP 10811A with power supply and distribution amplifier, but essentially, to the same effect).

The first test, we need to set the registers of the Si5351A (check the Silicon Labs AN 618 Application Note – check it in a quiet hour, because it has a lot of heavy content…). 25 MHz clock input, 26 MHz OSC0 output – can be achieved by running the VCO at 650 MHz, and integer-only dividers.

For the calculation, I use a self-made Excel sheet, which allows me to play around with the numbers to figure out the best combination of dividers and VCO frequency.

Here, the over test setup:

That’s the Xtal used – it came with the board, and I couldn’t find any data on it. Appears to be an AT cut crystal. Starting from room temperature, frequency, will go down with increasing temperature, and up with colder temperatures.

Such temperature variation is easily introduced here in Japan. First, keeping the room at 22 degC by the aircon (A/C) unit, then switching it off overnight (cooling the room by a few degrees, maybe down to 17 degC), then, next morning, heating up again to 22 degC (and a bit more as we had a sunny day).

The detail below also shows the small thermal mass of the Si5351A, free-hanging in air. Better to enclose it or to add some thermal mass later, to avoid thermal-gradient introduced noise or instability. You can clearly see the on-off cycles of the A/C unit regulating the room temperature.

After all this study, we find out that we can use the GPS and Xtal as a quarz thermometer (such thermometers really exist!)!

Test 2, now running with a 10 MHz reference clock, and still 26 MHz output to the u-blox M7 (in all cases, the u-Blox has been modified by removing the TCXO, and feeding the clock signal directly to the GPS chip). Sure I known that I am running the Si5351A outside of the specified range – but after all the research, Si5351A Spec, Myth and Truth, I believe this is OK.

The test setup – note the dotted additions – this will be the later phase locked circuit.

The register settings – running the Si5351A VCO at 780 MHz allows the use of integer-only dividers.
Capacitance set to 4 pF (the lowest value possible for the Si5351A, but it has little effect on sensitivity, 10 pF default setting works as well, maybe 1 dB decreased sensitivity, but we are anyway feeding more then enough power to the Xtal A input of the Si5351A).

The GPS clock drift data – not very exiting – no drift at all, less than 1 ppb over a few hours. There is a slight frequency offset, because the electronic frequency control (EFC) of the 10811A OCXO set to 0 Volt, rather to the proper value for exactly 10 MHz, only for convenience and to avoid any artifacts from EFC DAC noise or drift.

The position accuracy also seems better with the stable oscillator, but may need to check this again after acquiring data for a full day or so.

All in all, more than a proof of concept. Next steps include setting up a stand-alone OCXO (I have a couple of spare 10811A OCXOs around), a distribution amplifier (nothing special, planning to use some 74HC14 with small signal transformers for isolation), and getting the PLL code into a microcontroller. For the DAC, I will use a fairly basic model, and provide a low pass filter at the output (much faster than the digitally-generated long time constant low pass of the PLL loop, but still slow compared to common standards) to reduce noise.

So far, the bill of material is very low, just a few dollars, including the GPS receiver. My goal is to stay below USD 10 total, excluding the OCXO, to achieve better than 10-9 stability, and an output with no jitter or other issues.

Si5351A “Any-Frequency CMOS Clock Generator and VCO”: Specifications, Myths, and Truth

The Si5351 series of silicon-VCOs and clock generators is a quite remarkable achievement of technology. Earlier on, we needed two sets of dividers, PLL control logic, and a VCO – essentially a box full of parts – to realize the same purpose: generating one clock, from another.

While being quite adaptable to all kinds of circumstances and uses, the Si5351A (which is the cheapest, and most common chip – all the others have so many pins, and are in such small package that they are hard to use) has some limitations.

(1) It only has a crystal (XTAL) input, specified over a narrow frequency range. 25 to 27 MHz. Some forum comments suggest that there is a tuned oscillator inside, only working at such frequency, Myth or Truth? For my particular application, I need to drive it by a 10 MHz external clock, because that’s the main frequency source and signal I have available.

(2) The VCO range, 600 to 900 MHz should be selected, according to the instructions. Any chance to use lower frequencies, in case this is needed to get integer-only division ratios? Or higher frequencies? What are the limits?

To test the Si5351A, we can use one of the cheap break-out boards. I used the CJMCU-5351. Including SMA connectors, just a few bucks! I can’t really make it any cheaper, and this board also has level translators, and a 3.3 V supply, which is needed because the digital control will be running on good old 5 Volt logic. The I2C control signals are conveniently provided by a Atmel Atmega168PA controller, from a shared 5 Volt I2C bus.

Some modification is necessary – we need to remove the crystal, and add a small SMD capacitor, and a short wire. Once of the outputs, we cut the trace an re-purpose it as an input.

Before modification:

After modification:

The schematic, it is quite similar to the connection method suggested in the Si5351 datasheet.

Datasheet:

Actual modification and test circuit:

Obviously, to test the Si5351 over a range of reference input, we need to set the internal dividers (to lock the VCO to the reference clock input, and to divide it down to a suitable output frequency) to suitable values. Generally, 900 MHz VCO frequency, and 0.5 MHz output frequency has been selected. The low output frequency helps to see any glitches and jitter on my rather moderate scope I am using here (a 60 MHz Tektronix analog scope). At each setting, I increased the reference frequency until the Si5351 lost phase lock. Also, I reduced the power level at each frequency until some jitter showed up in the output.

The tests took more setting than expected – because the Si5351 can handle a huge range of reference frequencies – well beyond the 25 to 27 MHz, and even the internal divider can be set outside of the specified range (necessary only for the highest reference clock frequencies). A particular useful fact – the Si5351A can accept input frequencies of 100 MHz easily – I have some microwave PLLs running of a 100 MHz (rather than 10 MHz) reference.

As you can see, the internal VCO is working from about 170 to about 1100 MHz, so the 600-900 MHz is a good suggestion, but you can also run the VCO at, say, 500 or 550 MHz, if needed in some specific case of division factors (it is always much better to use integer-only divisors, rather than any fractional terms which introduce jitter and spurious signals.

After all this study, we can also plot the input sensitivity (signal from a 50 Ohm source, directly AC coupled to the XTAL A input, XTAL B floating, no other termination – probably, I will measure the characteristic impedance of the input later, no suitable test equipment currently available here in my temporary Japanese workshop).

As you can, see there is no tuned circuit or anything like it, the xtal input can accept any signal up to the highest relevant frequencies, and at lower frequencies, you just have to drive it a bit harder. 10 MHz may be the useful low limit (I suggest you drive it at 3-5 dBm when using 10 MHz, which will be about 6 dB above the sensitivity threshold).

Now, up for some long term test in the actual GPSDO application!

u-blox GPSDO: Update!

With the hardware already set up to provide a 10 MHz signal and electronic frequency correction, some optimization of the algorithm used for phase locking. It needs to be a really low frequency low pass filter (say, 0.001 Hz), and we need to deal with the discrete nature of the measurements and the quantization.
This is accomplished by three mathematical approaches
(1) The data is sent through a 32-parameter FIR low pass.
(2) The frequency drift is calculated for the last 32 seconds, and used as derivative signal, as long as the oscillator drift is less than 10e-9 (1 ns every second!).

The u-blox settings – these are no timing receivers, but I set the device for 2D stationary navigation, it gave the best results here. Also, better disable all messages you don’t need, it will be beneficial to avoid overloading of the slow serial interface (still running at 9600 baud).

Here some examples:

With the PLL open, the signal is drifting away, albeit, at a very small rate.

To check the stability and general behavior, I’m monitoring the 10 MHz signal on a scope, triggered by the time pulse (set to 100 kHz) of a 2nd u-blox receiver, sitting closeby. Horizontal deflection is 10 ns per div. Sure, the signal is broadened by the interpolation of the 2nd receiver, which has a free-running TCXO. Because of the synthesis of the 100 kHz signal from the internal 48 MHz, the trigger has about 20 ns jitter-no problem here, because the drift is much stronger and the phase of the 10 MHz signal relative to the 2nd receiver can easily be measured down to 1-2 ns.

u-blox GPS receiver: a self-regulating clock, and a GPSDO, and all of this, for the lowest cost

The quest for precise timing, it is a mainstay topic for all serious electronic enthusiasts, and for a good reason – it offers so much insights into receivers, oscillators, phase detectors, regulation theory. After mastering such design, the hobbyist has himself earned a masters (or at least bachelor’s) degree.

With the advent of compact and really powderful GPS receivers, like the u-blox devices, receiving GPS signals is no problem any more, and in fact, it has never been over the last 20 years, with various Motorola receivers, etc.

The u-blox devices have a feature that makes a reference frequency (derived from its internal 48 MHz clock) directly available, rather than just the 1 pps signal that is not all that easy to use for locking a 10 MHz reference to it. The u-blox signal, which can provide a jittery 10 MHz, or, preferably, integer-divided 48 MHz (e.g., 8 or 4 or 2 MHz), has been widely used as a reference frequency in the amateur world, and u-blox company and other recommend to use an external PLL to clean up the signal according to below scheme. This implies that the GPS will be running on a drifting local osciallator, and with a good amount of knowledge and software u-blox is mastering the drift prediction and corrections, and after all such effort an external oscillator, typically, an OCXO is kept in sync with the GPS true clock, by even more phase detectors and control loops. It is doable, logical, practical, but not very clever.

Sure there a better and much more expensive GPS receivers, and even special timing-related u-blox devices (about 10x more expensive than the regular receivers), which can control an internal VTCXO (voltage-controlled temperature compensated local oscillator). With such approach, the drift of the local osciallator will be small, and all in sync with the GPS frequency, but still, it is not as precise as a really good metrology grade OCXO. I am still relying on some well aged HP 10811A oscillators.

That’s the magic neo-7m device, or a Chinese copy of it, you never know – but all that really counts is good reception, and this can be easily checked.

Which secrets hide inside the metal can? Well, let’s find out. Most important part, the G7020-KT GPS processor, it is a remarkable piece of engineering, and u-blox must have a crew of the most well educated, highly paid and hard working people to come up with such devices. Also, they know that they must protect their inventions, and even the datasheet of this device is strictly confidential, although you can find it at many places. What you can’t find are some secret control codes that would allow us to use a 10 MHz clock directly as the clock source for this chip – it is running on 26 MHz by default, for whatever reason! Internally, the other frequencies are synthesized from this 26 MHz anyway.

The typical TCXO performance, it is not bad, drifting along, and we can do some further stability analysis on it. For such a small thermal mass, the performance appears quite good. Accurate to 0.5 ppm over temperature, and 1 ppm per year.

That’s the GPS with the TCXO…

With no effort, the TCXO can be removed, just by holding a soldering iron to it to heat it up.

After removing it, we just solder a thin RF cable in position. In my temporary workshop here, I don’t have better tools, so this must work for now. Ideally, you add a decoupling cap, and solder a wire to a solder post or other propper connection or contact.

We have no good information what level of power is needed at this input, ideally, a 0.8 V p-p min. signal, DC coupled, but we don’t have such signal generator here, only a HP 8662A, which has sinewave output. Using the u-center software, and experimenting, the receiver works well from about -5 dBm of coupled power at the clock input. Operating at 0 dbm, that’s enough, we don’t want to fry this chip.

Even with a small antenna, good reception, within the (wooden) Japanese house.

Now, the feature we are going to use – not the reference frequency output of the u-blox, but the UBX NAV-CLOCK message, which is no less than a phase detector and drift measurement device, of the clock signal, relative to the GPS true-software-reconstructed clock. Marvelous.

As the new 26.0000000 MHz source, we use a 8662A generator with HP 10811A reference, and an EFC (analog frequency control input, about 0.1 Hz per Volt). On top, a 35601A interface, only using the DAC portion of it to generate a tuning voltage from the host computer (connected via GPIB). It is not the most handy DAC, but the only one I have around at the moment.

First, we try without any feedback – Allen deviation. First, the plot using the original TCXO, next, the same receiver (at the same location and setting), with the 8662A (freerunning).

The 8662a – not yet fully warmed up, but already one decade better – or even more, because of the resultion of the phase detector (1 ns!).

Next, we need to do some programming – this will later be put into a microcontroller, but for now, we use a regular PC, running a C program. This program reads the NAV-CLOCK message from the u-blox receiver, does a magic calculation, and then sets the EFC voltage of the OCXO, which in turn determines the 26.000 MHz clock for the same u-blox receiver. And after not too long time, all is frequency looked.

Here, some first results (using a rather small bandwidth regulation loop, just to proof the principle without waiting for too long time).

Introduced some artificial disturbaces, and the system is reacting well.

Next – using a Silicon Labs clock generator, and a stand-alone OCXO to do the same thing, and then, the software needs to be put in a small microcontroller (currently running a rather calculation intensive floating point algorithm). Stay tuned.

US TEO Power Suppy: you want to get killed by a USB charger?

This is one of the worst electronic gadgets that my workshop has every seen, a US TEO Brand A5951 USB charger. Usually, not much can go wrong with the design of a 5 V switchmode power supply, but with this device, all went wrong, a combination of bad design, bad manufacturing, and non-existing sense for product responsibility.

Can you see the wires – right hand side is low voltage side, left hand side is mains! Can you see the solder stuck to the board – almost connecting mains and low voltage?

The only “safety” function I can see if a PCB trace fuse (left hand side zig-zag) on a mildly flammable paper board.

Even the case isn’t sealed – the manufacturer is even saving the glue!

That’s the brand name and numbers, if you have one of these, take it out of service immediately!

Seems Canada has some clever authorities – they found a whole lot of unsafe USB chargers. Remember the good old days when it was illegal to import just any kind of crap?

AB Arboga Maskiner U2508: a simple DRO (linear glass scale readout)

Recently, I have moved a U2508 milling/drilling machine to my Ludwigshafen workshop (from the remote workshop, where there is more space for heavy machinery). It’s a really good machine, slim, but very well built and useful for all kinds of drilling and milling work. It has an automatic feed in in one direction, and the dials are usually quite accurate.

Still, it will be a great advantage of time saving and some accuracy improvement to add a linear scale, at least in the manually-moving direction, so I can mill shoulders and similar features to a very high level of precision and repeatability.

Also the quill will get an electronic readout – but this will be covered later.

Luckily, I had a simple readout around, dating back to 2007, based on an ATmega8515, with some logic, and MAX7219 display drivers.

The case was made from melamine composite boards, these are oil and grease resistant – excellent for workshop use.

Here, the schematic of the input section. The sampling frequency of the counter is about 62.5 kHz, so the TTL signals from the glass scale first pass through a ~160 kHz low pass filter, and are then squared up by Schmitt triggers, 74LS14.

The main processor is running at 16 MHz, and very few extra parts are needed to drive the LED 7-segment displays, using two MAX7219 in chain configuration. The LED segment displays are much preferred for workshop and DRO use, because speed and clarity is everything for this application, and nothing can really replace the good old LED 7-segment displays here.

The power section, note that the regulator will need a heatsink of about 10~15 K/W capacity
– the unit is drawing up to 0.5 Amps at 5 Volts.

The input section…

The drivers…

The wiring, all quickly soldered together with some copper wire.

The code – it uses a gray code approach with continuous sampling of the A/B inputs. This approach is easily coded, and has very deterministic timing, and noise immunity. Any errors found (like, if both lines change state within on sampling cycle) will be indicated by a red LED.

dro_simple1

Now, I only need to mount the glass scale (found one that fits in may parts collection…), and replace the “minus” LED (a 3 mm LED) with a minus bar-shaped LED, just for the better looks.

Note that the software has provisions for a matrix key-pad, but for the present application, the “zero” buttons are all that is needed.

Length Endcoder Interface: reading the Heidenhain

This little post may help those that are dealing with rotating or linear encoders, and have been wondering how to build a circuit that actually works, and with a degree of reliability useful for industrial applications. Around machine tools, and similar equipment that rely on such encoders, there is a lot of electric (and audible!) noise, so most hobby circuits that just take some TTL signals and do some quick stuff and calculations won’t work. Let’s try with a real circuit and some good code.

Here is the device, it’s a Heidenhain ST1278, 10x interpolated TTL output micrometer.

According to the datasheet, it has a 20 micron grating, which will lead to a 2 micron signal period, allowing us to get 0.5 micron resolution.

After carefully opening the plug, which has the Heidenhain logo, and secret Heidenhain electronics inside, I can tell you, Heidenhain uses a 75ALS194 line driver, to drive the RS422 output.

We will be using a DS26C32ATM line receiver, to get the differential signal converted back to TTL level.

The differential lines is terminated in 120 Ohms (watch out for their dissipation, if you consider building this in SMD), and has two 220 pF capacitors to absorb and high frequency noise. This thing is running at 100 kHz max.

The output of the DS26C32 is going right to a ATmega328P, sitting on a Arduino nano clone, for convenience. This uses the common CH340G seriell to USB converter to talk to a host computer.

This is the full board. USB power is enough, even for the Heidenhain, and a HX711, which is also used in this device, for other purposes.

How to get the Heidenhain signals decoded into position. Well, we follow a sampling approach here, rather than using any of the rising edges, triggers, etc. – we just sample the two Heidenhain lines at 125 kHz, and compare the sampling result to the last result (of sample N-1), to determine if the Heidenhain moved forward, backwards, or not at all. If both lines change status -we know that something went wrong (e.g., if Heidenhain is moving to fast, or if some noise comes in despite all the effort to keep the noise controlled by the high current differential line).
The 125 kHz sampling is running on a timer-triggered interrupt routine. The duration of the interrupt can be monitored -at least in debug mode- by watching a test pin of the mega328P, by setting the test pin high when the interrupt is called, and clearing it once the service has been completed.

The initial software still used more then 4 microseconds for the sampling, a bit too much, this can be reduced to 2.4 microseconds, even without any special tricks.

Below, you can see the effect of a sampling error (introduced by very quickly pushing the sensor arm inwards), it takes slightly more time to handle the error.

Finally, all that remains is to communicate with the host – this is done at a data rate of 12 Hz, plenty for this application. The data interval is triggered by the HX711 load cell converter, and the the full dataset, including, current encoder reading, error count, load call reading, and time-stamp are transmitted to the host all in one packed, as hex encoded data, and at 19200 baud. All pretty fail-safe and slow, but working just fine, and still a lot of idle time on the line (see transmission pattern on the scope below)!

Below, the avr-gcc code performing all these wonderful tasks.

hhenc hx711 _180128.c