Posts Tagged ‘Electronics’

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

Saturday, April 26th, 2008

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

Sunday, March 16th, 2008

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.

Pressure gauges

Saturday, March 8th, 2008

This 8-channel pressure-gauge card is a step towards proper control of fluid flow in microfluidic devices. The transducers (0-1 psi) are around 30 eur each and made by Honeywell. The mV-level signal from a Wheatstone bridge in the transducer is amplified by an instrumentation amplifier (INA111) to around 0-10 V for input to a 16-bit AD-converter.

Spektrum DX6 antenna mod.

Saturday, November 17th, 2007

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

Saturday, November 3rd, 2007

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

Thursday, July 5th, 2007

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.