10/07/2021

PROJECT: Half-Life 2 AR2, Update #11 - Receiver Sensor PCBA's


"Quick" update, I have just finished designing the left & right reciever sensor PCBA's (the ones that figure out position of solenoid plunger/firing pin). Next step was to place them into the AR2 assembly to check for possible collisions (see first section), and to see how well the IR LED & IR sensor pair are expected to function (see second section)


PCBA & Solenoid Plunger Collision


From my AR2 prototype I noticed that the solenoid plunger (pink thing below) has quite a bit of slop, and at the extreme case can move around by ~1mm


The components that are of most concern are the electrolytic capacitors (Nichicon UCQ1E100MCL1GB), as these are the highest items on the PCBA (coming in at a whooping 4.6mm). Below I found that on the IR sensor PCBA was heading for a collision, so I had to move the electrolytic capacitor (on both PCBA and AR2 assembly) as far down as I possibly could


IR LED & IR Sensor Viewing Angle

As mentioned in a previous post, I am using two IR LED & IR sensor pairs (in a line of sight arrangement) to figure out the location of the solenoid plunger


Doing a quick test with my selected LED (Stanley Electric VTAN1116P-TR) I saw that the 40° viewing angle should not be an issue, as at no point can a single IR sensor see light from both IR LEDs (think viewing angle cones having too much overlap)


However if you increase the IR LED viewing angle to 60° (SunLED XZTNI53W-8) you will have issues with loading configuration D and possibly E, as here the viewing angle cones overlap too much and so can confuse the IR sensors


But wait there is more! If you have a closer look at the datasheet for 40° viewing angle IR LED (Stanley Electric VTAN1116P-TR), you will see that: 

  • At 40° the LED has a 50% relative intensity
  • At 140° the LED has a 20% relative intensity

Meaning I am likely to run into the overlap issue with configuration D, as the IR sensor will probably pickup the stray IR light. I won't know if this is a problem till I build the reciever assembly, but if it is then I could either:
  1. Narrow the viewing angle of IR LED by making a cylindrical cover
  2. Read the analog voltage of the IR sensor (via ADC or comparator) and then trigger on a set threshold


To finish off... Believe it or not but the IR sensor (WE 1540601NEA200) also has a viewing angle, which is 120°. Luckily with the IR LED & IR sensor PCBA configuration (not angle between the two boards) should not have any issues

22/06/2021

PROJECT: RCA TV Adapter for Record Player

Recently my significant other got a record player (SONY PS-LX250H) to play her childhood records. However there was one minor issue, we did not have any speakers that supported the relatively old-school RCA audio connector

Well as luck would have it, our TV (Samsung UA50J5100) has an RCA input. But again there was a catch, the TV expects to see a video signal before it gives access to the speakers. So a new project was born, a box that generates a "fake" RCA video signal to trick the TV into sharing it's onboard speakers 

To achieve all this I used the super nifty TVout library along with an Arduino Nano, which I also programmed to display 4 different items (controlled by two switches):

  1. Blank screen
  2. Pictures of our cat =^..^=
  3. Pictures of us ;^)
  4. Conway's Game of Life (which I got from Emily Velasco)

With all that said, here is how the box looks as well as the "pixel art" it produces:


3D Printing Text

Now for some advice on 3D printing text. I find that using an "equal width font" works best, for example when I design items with text in SOLIDWORKS here is what I use:

  • Arial Rounded MT (bold)
  • At least 5mm high
  • 110% spacing


Basically the taller/higher the font, the better it will come out. Also if you are dealing with smaller/shorter font (≤5mm) then it's worthwhile removing any "islands" to improve readability (think difficulties when printing smaller features). For example, with above I had to clean up A, B, O, & P to get a nice print


Finally, to make the text stand out I debossed it by 1.5mm and then filled the cavity with nail polish. The trick here is to use a fine-tip flat-head screwdriver to dab the nail polish into each cavity, then wait for the nail polish to dry before cleaning up the edges with an IPA soaked cotton swab

UPDATE: If you want to stop the inter-layer/capillary action bleed then add a coat of clear spray, as this fills in the micro-grooves - ubermeisters

06/06/2021

PROJECT: Half-Life 2 AR2, Update #10 - Power Filter v2


Turns out my pi-filter simulation from the previous post does not tell the full story, as with a power filter it's best to first look at the step response before looking at the frequency response. With that said, here are the updated simulations which now include two decoupling capacitors at the load (both ceramic, one 100nF and other 10μF)


Chosen Pi-Filter Configuration

Here is the step and frequency response of the chosen pi-filter configuration. If you want to know how I came to this conclusion then see the following sections

Comparing no filter to pi-filter, note how there is no drastic phase shift and the attenuation is grater, with the -3dB point starting at 70kHz instead of 170kHz


Pi-Filter Step Response

For the step response I am using a current load configured with a pulse function, with the step/pulse looking something like this:

To help with comparison, below is what the step response looks like without any filter present

NOTE: This plot is a bit deceptive as it looks like the circuit is able to respond well to transients, HOWEVER if you also look at the frequency response (see next section) you will see that we can do better


Here is the initial pi-filter configuration I have chosen, a 10μF electrolytic capacitor, a 33Ω (@100MHz) ferrite bead, and a 10μF ceramic capacitor

NOTE: This is not my final configuration, if you have a look at the last section you will see that lowering the ferrite bead impedance drastically helps with step response


And here are some configurations that did not did not make the cut. Again, it's a bit harder to see why if you just look at the step response; if you also see the frequency response (see next section) you will note that some configurations have sharp phase shifts that lead to a "peaky" attenuation

NOTE: I realise that ELEC/CER & CER/CER configurations have a similar step response (with CER/CER actually having a better frequency response). However I am fairly certain that in the real world ELEC/CER will give better performance due to the relatively large ESR of the electrolytic capacitor, as with low ESR capacitors it's much easier to introduce oscillations/ringing with fast transients 


Pi-Filter Frequency Response

Same order as before, first we have no filter (to help with comparison). Note how we have a tolerable attenuation up to 10GHz where he see a drastic phase shift and the peak that comes with it (though I suspect we don't really care what happens after the 1GHz mark)


Here is how things look if we implement the chosen filter from the previous section. Note how there is no drastic phase shift and the attenuation is grater, with the -3dB point starting at 90kHz instead of 170kHz


And for completion, here are the frequency responses of the configurations that did not make the cut. The -3dB point for these (in order) is 230kHz, 170kHz, & 65kHz


Pi-Filter Step Response vs Ferrite Bead Impedance

From here on out I am trying to see what impact the ferrite bead impedance has on the filter performance, the results will shock you ;^)

As before, to make comparison easier here is the step response without any filter present


And here are our candidates. Note how drastic the difference is between the 8Ω (@100MHz) & 120Ω (@100MHz) ferrite beads. As you might guess, am leaning towards the 8Ω ferrite bead for the pi-filter


Pi-Filter Frequency Response vs Ferrite Bead Impedance

Again, to make comparison easier here is the frequency response without any filter present


And here are our candidates, the -3dB point for these (in order) is 70kHz, 90kHz, & 70kHz. Note how the 120Ω ferrite gives +2dB amplification (not attenuation) around 40kHz


Tips For Power Filter Simulation

Here are some things to keep in mind when simulating a power filter:

  1. Make sure to include parasitic elements in your simulation. This would be the parasitic resistance/inductance/capacitance of cables, connectors, tracks, planes, decoupling capacitors, relays...
  2. Include a series resistance in your AC/noise source when doing a frequency response. With my simulation is set it at 10mΩ. If you forget this element (or set it to 0Ω) then your simulation would show amplification before you see the roll-off, while in the real world you would not see a response like this as the source would have a finite series resistance (which I guess is a parasitic resistance)
  3. Know what a typical current transient you are bound to run into looks like for your circuit. For example, if you are switching a relay and you know the could current is 10A then you can better understand what sort of filter response you need
  4. In addition to above, see if you can figure out the constant current consumption of your circuit. Again knowing this will give a more authentic simulation
  5. It's useful to know the input/output impedance of the filter, as with this information you can figure out what filter topology will be best. For example, a pi-filter is designed to "match" a high input impedance with a high output impedance, whereas a T-filter is the opposite, a CL filter is high/low, and a CL filter is low/high

03/06/2021

PROJECT: Half-Life 2 AR2, Update #9 - PCBA Block Diagram & Power Filter


Having completed a good portion of the AR2 receiver model I decided to put on my Altium hat and work on the PCBA's. The first board I designed was the RECEIVER_SENSOR-LEFT, which houses the:

  • IR LED emitter pair (used for sensing the solenoid plunger position, see here for explanation)
  • Trigger debouncing circuit (I am using a snap action switch which is notorious for being "bouncy" when changing states)

You can see the location of this board below:


As I was designing the first board I realised that I did not have a solid overview of what other PCBA's will be inside the AR2. Looking back this is something I should have figured out earlier on, especially with a multi-board design like this. And though I had a simple overview posted here, I figured this was not detailed enough...

With all that said here is how each PCBA will be connected, as well as where it will be located:


Power Filter

From the block diagram above you can see that the reciever will house 3 boards:

  • RECEIVER_MAIN-BOARD (primary/mother board)
  • RECEIVER_SENSOR-LEFT (secondary/daughter board shown in video)
  • RECEIVER_SENSOR-RIGHT (secondary/daughter board)

The plan is to generate the power rail (3.3V) on the primary board and then feed it into the secondary board via a ribbon cable, the length of which would be ~30mm. Now, under normal circumstances (as in with a simple project) I would feed in the rail directly as the ribbon cable is relatively "short", but this time I wanted to have a bit of fun and play around with some pi-filter combinations in LTspice. To make the simulation more "realistic" I also accounted for cable, capacitor, & ferrite bead parasitics (resistance, inductance, & capacitance), as these would have an impact on ripple/noise attenuation. For example here is how it looks without any filter present:

NOTE: Below simulations are not ideal for a power filter (should be using step response), see next blog post for new simulations

I should note that with my simulations I am assuming that most of the parasitic elements come from the cable (as in parasitic elements from connector interface and PCB traces/planes are "negligible"). Anyway, after doing a fair bit of research and running many simulations this is the pi-filter combination I narrowed in on:

Here I form a pi-filter with a 10μF electrolytic capacitor, a 33Ω (@100MHz) ferrite bead, and a 10μF ceramic capacitor. The "high ESR" electrolytic capacitor helps to dampen/attenuate any ripple on the power rail; you can achieve similar attenuation by adding an inline resistor but as you would imagine this adds voltage drop to the rail. Also, I went with this configuration as it has a fairly steady phase shift across all frequencies, as in there is no sudden 180° phase shift which would introduce sharp peaks (see below)


Finally, here are some extra combinations that did not make the cut (kinda interesting to see what happens if you only use ceramic or electrolytic capacitors):


And for those still curious, here is what happens when you add a 100nF ceramic capacitor at the output: