PCB Milling

I'm making photodiode (transmipedance) amplifiers, and here is the first PCB being milled today. In the foreground a test-run where the cutter-height was too low resulting in too thin or vanishing PCB-traces. Note how the PCB material is not held in place along the Z-axis at all. The PCB-blank is just located in X/Y on the table using two locating pins/holes. In the Z-direction the idea is that the pneumatic cylinder pushes the lower flange of the spindle into contact with the PCB-material, and the exact cutter-height is adjusted relative to this flange only.

The toolchain is (old!) commercial software: PADS PowerLogic for schematic design, PADS PowerPCB for PCB-design, CircuitCam for converting the gerbers to HPGL, which BoardMaster uses to drive the mill (over RS232).

pd_amp_pcb_top pd_amp_pcb_bottom

For general purpose 3D CAD at work we have Vertex (a Finnish Inventor/SolidWorks clone) and I used it to draw a model of the amplifier:
pd_amp_assembly pd_amp_exploded

The size of the PCB and enclosure is mostly limited by how much of the powersupply one wants on-board, and how big connectors one wants to use. I'm using a standard BNC connector (SMA would have been smaller). The board is powered by a +9...18VDC supply which is DC2DC converted into +/-12 V and then regulated to +/- 5 V for the op-amp circuit. The box at the front is an RF shield for the amplifier itself. Light enters through an 8 mm hole in the face-plate and hits a TO-18 mounted photodiode. More on the circuit later.

The enclosure is 48 mm in diameter with a 16 mm thick face-plate, a 4 mm thick back-plate, and the body (55 mm length) bored out to an inner-diameter of 34 mm. The body should fit a 25x54mm PCB. The end-plates are attached to the body with five M3 screws on a 40 mm diameter bolt-circle. There is an M6 thread on the bottom of the face-plate, for attaching the amplifier to an optical-table or other instrumentation. I made two of these from 50 mm aluminium round-bar on a manual lathe and mill (using a rotary table for the holes/threads).


Note: for manual machining five evenly spaced holes the angle-sequence is: 0 - 72 - 144 - 216 - 288 - 0.

I'm thinking about polishing these a bit and then anodizing them. But for RF-shielding the contact-surfaces of all three parts would then have to be sanded/milled-down after andoizing. to ensure good electrical conductivity between the parts.

Lathe Electronics Cabinet

A bit of progress with the electronics cabinet for the lathe. Some components have been bolted to the back wall of the cabinet. From left to right: a Bonmet servo-drive for the main spindle servo, a Siemens VFD for the live-tool spindle motor, and to the right two Brushless PWM amps for the X and Z axis motors from pico-systems. Below these there are two 350W 48VDC switched-mode powersupplies. Today I made holes for two 220VAC 120 mm fans which blow air from both the left and right side into the cabinet directly on the heatsinks of the servo drives. There are plenty of holes in the bottom of the cabinet through which the air can exit.

Heater fix: SSR replaced

The heating elements on this heater just kept on heating and heating independent of the temperature. I first checked the thermocouple that measures temperature - but that seemed OK, so the next thing I suspected was the solid-state relay that turns on/off the heating. Turns out this initial guess was right, and I was lucky we had a replacement on the shelf, so now the heater works again. The picture above shows the broken SSR on the right.

New SSR in place.

8-channel 4th-order 60 kHz anti-alias low-pass filter

I used this Sallen-Key design to build an 8-channel 4th order low-pass anti-alias filter for a 16-bit 200 kS/s +/- 10 V AD-Converter. I calculated the components for the 60 kHz low-pass Butterworth design with this on-line calculator. Previously I've used the MAX274, but that component is limited to +/- 5 V signals. Here I really need the +/- 10 V voltage swing. The exact design calls for 2872 pF, 2452 pF, 6935 pF, and 1016 pF capacitors, but I looked at the transfer function with what values were available in 1% tolerance from Farnell, and the response looked fine with (R= 1 k, C1=C2= 2700 pF for the first stage and C1=6800 pF, C2=1000 pF for the second stage). Both the resistors and capacitors (~1.5 eur/pcs!) have a tolerance of 1 %, which according to a monte-carlo simulation should not affect the response that much. I'm using OP42 op-amps with a unity-gain bandwidth of 10 MHz, which should be adequate (100x the cut-off frequency was recommended in a guide I read, that would be 6 MHz in this case).

For testing I hooked up a signal generator and an oscilloscope and wrote a LabVIEW program to loop trough around 250 different frequencies while recording the peak-to-peak value of the filter input and output signals. The oscilloscope only has an 8-bit AD converter, but I adjusted the analogue gain between 5 V/div and 2 mV/div to achieve effectively around 16-bit dynamic range.

This is the result of testing all channels with a 20 Vpp sine wave between 100 Hz and 10 MHz. The blue curve shows the design response and the red and green curves show the maximum and minimum expected response from the monte-carlo simulation (I drew all component values from normal distributions with 1 % standard deviations). Pretty nice agreement until ~500 kHz. Here's another view of the data:

This figure shows the deviation of the real filters from the design response, again confirming that everything works as it should up to 500 kHz.

Log-log plots can be confusing, so here's a semilog plot and a linear plot of the same data:

Here are the source files for this design:

The box actually looks like this.

E-stop circuit

This is the E-stop circuit I am going to use when upgrading the cnc-mill to servo control. The idea is to use a wire-OR circuit (series connection of NC switches) for things that cause an E-stop followed by a wire-AND circuit (parallel connection of relays) for things I want to happen at E-stop.

The E-stop out signal from EMC is wired to the top right of this board (labeled E-stop IN...). When this signal goes high it closes the rightmost relay which has +12V wired to it. The 12 V then goes through a series of NC switches, which I've here just shorted out with the black wires. In reality the black wires will be replaced by one E-stop button on the main enclosure, one E-stop button on the jog-pendant, X/Y/Z limit switches, NC servo-amp fault relays, and a VFD NC fault relay.

When all is well +12 V is supplied to the three other relays, and these provide NC or NO outputs. One is used to tell EMC everything is OK (E-stop IN signal in EMC), one is used to enable the power switch of the axis servos, and one is spare for now.

This should make the machine reasonably safe. If any of the E-stop buttons are pressed, a limit is tripped, or the servo amps/VFD are not feeling well we should go into E-stop, and that will cut power from the servos. EMC will also notice this and I'm relying on EMC to shut down the coolant pump and the VFD.

Spektrum DX6 antenna mod.

By popular demand, some notes on how I've placed the antenna of my Spektrum DX6 transmitter inside the case. I've been using the radio like this ever since I got it and provided that you hold up the radio more or less vertically and not hide behind large metal constructions or things like that the range is fine. The benefit of the internal antenna is that I don't have to worry about breaking it while sailing it or storing the protruding thing in the toolbox. When it rains it's nice to fit the whole transmitter into the rain-cover which doesn't have any (potentially leaking) holes (other than the two holes for my hands!). A plug for the antenna hole to prevent dirt etc. entering the Tx would probably be a good idea.

If someone has a feeling for what theoretically a 2-3 mm wall of plastic does to an RF signal at 2.4 GHz, let me know.

Here is the back cover and six screws that hold it removed along with the battery (I've put Deans connectors on the Tx battery to simplify charging). With a stock DX6 the antenna would be sticking out at the top and there would be a few extra pieces of black plastic supporting it. I remember I broke some of those black plastic parts when I disassembled the antenna - so proceed carefully if you think you want to go back to the stock configuration sometime. I didn't touch the electrical connection of the antenna at all, the thin grey coax that comes out of the antenna attaches to the RF PCB just like it does on the stock Tx.

Here's a close-up of the antenna. You can see a part of the old antenna-hinge around the grey coax to the left (a bit dangerous to cut it away with a knife or pliers since you risk damage to the delicate coax). I've taped the antenna upside down to the RF board. There are probably other places inside the case the antenna could fit as well, but this seems to work OK.

If anyone has done something similar do let me know! I'd be happy to post pictures here if you send them to me.

Spektrum: I hope you are taking notes, I expect your next radio to have an internal antenna!

Talking about DX6 modifications, I did order the voltage regulator for the improved runtime modification, but the runtime with 2700 mAh NiMH's is just fine so I haven't installed the improved regulator yet.

Update 2007Nov17:

Olle Martonen sent me this pic of his modified Spektrum DX7. He mounted the antenna horizontally behind the regulator/switch PCB. Also note the wooden plug in the antenna hole. Not much sailing done with this system yet, but range-checking on the ground indicates there should be no problems.

I also got some observations be email on RF issues from a mobile-phone perspective: A few mm of plastic will not attenuate the signal measurably. Conducting materials are worse, like some mobile phone shells that are covered with carbon-containing paint, or your fingers on the back side of the transmitter. My placement of the antenna close to the RF-box (the metal square), and the PCB (also metal-coated), is not optimal, and could lead to an attenuation of 3-5 dB. A distance of 2-3 cm to the conductive parts would be better, so I'll maybe look for other places inside the Tx where the antenna could fit (Olle's example above is a bit better since the antenna is farther away from the RF-box).

Update 2007Nov22:

Winston Mathews sent me this picture along with a description: "Here are our modified DX6 radios. 2200 mAh batteries, new voltage regulator, jib-trim potentiometer and now "internal" antennae (mounted horizontally). Range is unaffected. Thanks for the idea and your help. I would advise to install the voltage regulator. We can sail for two days without recharging. " Photo by Jack Wubble, owner of the open radio in the pic. Discussion on this is over at the EC12 discussion forum.

Update 2007 Nov 23:

Some text and images on modifying a Futaba 2.4 GHz radio on the EC12 website.

Spinning the DC Servos

Some good steps towards driving our cnc-mill with DC-servos taken today. I got the pico-systems servodrives wired correctly, the new 50 kHz PWM m5i20 configuration loaded onto the fpga, and updated my pyvcp test panel a bit. I'm using three 19" rack enclosures. The lower one has a 1.8 kVA transformer, the middle one houses the servodrives, and the top one has differential encoder cards for the motors and optoisolator interfaces to the m5i20.

One small setback was that the servodrives wanted the PWM in reverse polarity compared to what I had available. There's nothing in the m5i20 driver to reverse the polarity of the DAC output PWM. Fortunately the drives have optocoupler inputs so instead of GND-PWM I wired them in a PWM-Vcc configuration and it worked OK. I did an open-loop no load test (below) where I monitored the RPM while changing the DAC output. There's a bit of dead-band in the middle where nothing happens between DAC values of about -0.2 and +0.2. After that the curve is pretty linear up to +9.7 after which the PWM pulse becomes unacceptably short for the servodrive and at DAC=9.8 or above the motors just jump and stutter. So eventually with EMC and PID control I need to limit the DAC range to [-9.7 , +9.7].

Next is probably trying out closed-loop PID control, and after that I need to look at the E-stop chain, home switches, a relay for the flood coolant pump, and controlling the VFD/Spindle.

Transformer test

There was something strange going on when I measured the transformer last time, and since that I've gotten a few pointers from visitors to the blog and the CAD_CAM_EDM_DRO list.

I now did a test without the inrush current-limiter, and it does make a difference. It is rated for 8 A continuous current, but apparently it limits current much before that...

Now the 'AC load' line is measured by hooking up resistive loads to the secondary windings (no rectifier or caps), and it shows a series resistance of about 0.3 Ohms, or similar to what can be measured with a multimeter over the secondary windings. So at least the transformer seems to be working.

Then I hook up the secondary to the diode bridge and the caps and connect the same set of resistive loads as before. That's the 'DC load' measurements above. There again I see a big drop in voltage at first that then levels off somewhat. For the points above 5 A current the voltage drop is around 2 V per amp, or about a 2 Ohm effective series resistance. Also, the transformer does not emit any sound at all during the AC test, but now with the rectifier and caps when I load it up there is a slight 'humm' sound(probably 50 Hz and its harmonics).

I wonder if that 2 Ohm is typical or if there still is something strange going on? (could the rectifier bridge be too small? Anything wrong with my 4x 10 000 uF 100 V electrolytic caps?)

I tested this with one bridge rectifier GBPC5004 rated at 400V/50A and another one, a GBPC5010 rated 1000V/50A, but the results are the same. Looking with an oscilloscope at 6 A load at the DC voltage there is about 1.4 V of ripple.