# Hello World

I co-organized a hackerspace at RIT. There, I invented a new means of making x-rays, and have left college upon the receiving a $100k fellowship to found an imaging science company in California. http://aperture.systems When I’m not building something, I’m either out hiking or reading. This is my blog. Enjoy! “To thine own self be true, and it must follow, as the night the day, thou canst not then be false to any man.” Sadly, such truths are often obscured ಠ_ಠ # Luldlum Model 12 Restoration Recently I’ve been restoring a Ludlum Model 12 rate meter. What is that you might ask? The best ratemeter on this side of Si Valley, that’s what! I say this, because it’s one of those rare instruments built with “user serviceable” in mind, much like old tektronix oscilloscopes. Along with its bare, “don’t touch this lest you get shocked” circuit board, it contains trim potentiometers and for nearly everything one could wish to adjust; the high voltage power supply, the pulse discriminator, the integrator dividers, as well as a switch to change the integration speed and to reset the integrator entirely. But those are just big words for people who don’t know what the hell a survey meter is! ## What is a rate meter / survey meter? A survey meter is a radiation measurement device; something that provides for a measurement probe; • A high voltage power supply. Most radiation detectors (eg, geiger-muller tubes) require a high operating voltage, typically on the order of 700 to 2,500VDC. Geiger-muller tubes typically require a potential of 400-700V, photomultiplier tubes a potential of 900 to 1500V, and proportional counters a potential of 1200 to 2500V. • A pulse discriminator. During a count events, an electrical pulse is formed across the radiation detector. On some detectors, such as neutron proportional counters, this magnitude of this pulse is co-relates to the detected particle’s energy. The discriminator is a circuit capacitvely coupled to the probe’s high voltage power supply which monitors these pulses, and triggers a count event if the pulse exceeds some magnitude. By adjusting the reference voltage, one can discriminate between say, a neutron, and a gamma ray. • An integrator. This is just some display mechanism that integrates the pulses, to give a “counts/minute” measurement. The accuracy of the integrator is of course, highly dependent on the length of time which it is active. • A speaker. Click-click. Click-click-click-click. Naturally, being able to adjust all of these things means you can use a Ludlum-12 with any probe you wish! ## My rate meter Ludlum-12’s in working condition are notoriously hard to find, as they’re highly coveted instruments, and no one lets go of a working one easily! As such, I bought mine semi-broken and much beat-up. The meter I acquired had lost its voice at some point in its life, and was in much need of a face-lift. In all her pride and glory Analog dreams By “losing its voice”, I mean that my meter had no ability to make sound. This is rather unfortunate, because while it might seem like only a minor inconvenience, those clicks could be the alarm one needs to learn whether or no one is in a radiation field! The Ludlum-12 is an entirely analog instrument. Nowhere on its board exists any form of proprietary turing machine, which is rather fortunate as this makes it quite repairable. So where was the damage? Here! Ludlum-12 Audio Circuit, courtesy Andrew Seltzman The audio circuit in this machine is rather simple. An astable multivibrator (CD4098) is triggered by the pulse discriminator (not labeled), which creates a few-kHz audio tone that’s fed out of Q2 into a NAND gate (CD4093). This NAND gate, being of the schmitt trigger type, squares-up the signal a bit, where it’s then further buffered by a second NAND gate and sent into a piezoelectric speaker. The audio “mute” switch is simply an SPDT toggle that holds the multivibrator’s RES2 (reset) pin low. These are the two ICs that somehow failed in this meter; likely due to some sort of electrostatic event given that they’re old and of fragile design. Interestingly, the multivibrator failed in such a way that pulses were able to make it out of Q2, but not periodic square waves. Weird. Replacing these ICs fixed the issue. ## The Facelift Whilst fixing this meter I was convinced by a fellow artist to make it snazzy. Get Funky The above was done with rust-oleum enamel, masking tape, and a razor blade. ## Testing Though I will eventually use this as a scintillation meter, I needed a probe for testing purposes. Not having one on hand, I decided to use a Navy surplus GM-tube that had been collecting dust for some years. Since the Geiger tube runs at a high potential (700VDC, in this case) it’s required that the tube be insulated lest I shock myself while using it. My solution, given a lack of tools was a composite tube built from paper, epoxy, and vinyl tape. Given a small coat of polyurethane for strength, it’s just about as good as one made from aluminum! A DIY Composite Tube Fits my Geiger tube snugly And hosts a nice BNC connector To make one sexy probe ## The Video No sir I don’t want spicy Mexican; I want hot. Add a dash of Radium Chloride please. ∎ # The Bass Cannon Every once in a while I build something ridiculous, and this would be one of those whiles. Ladies and Gentlemen of the internet, I present to you what I understand to be the world’s first Bass Cannon. What is a “Bass Cannon” you might ask? It’s a weapon of mass destruction. A party on your shoulders. Something to frizz your hair with. Something to peeve your neighbors. It’s when you get when you take • An AirZooka • A pair of voice coils • Epoxy • Miscellaneous analog parts • A class D amplifier • A lithium-polymer battery • Birch plywood • Threaded rod • A physicist with too much time on his hands And put them all together in a room with a soldering iron, and a laser cutter. I’m not going to try to flaunt, nor will I make a step-by-step guide on how to construct one of these contraptions. That said, if you’d like to make a portable party for yourself, the above photos, and the below schematic should be enough to get you started! In truth there’s not a whole lot of fancy engineering that went into this project. It’s a mono audio system with a pair of x-pass filters, a power amplifier and suitable drivers. It has no battery management or protection circuitry, though, that’s a simple thing to add if you do feel it to be absolutely necessary (hint; use a relay, a BJT, a zener diode, three 1% tolerance resistors and a comparator). Two potentiometers set the channel gains for the the pair of first order filters; one high-pass for the midrange driver, and one low-pass for the woofer. A PYLE “PLPW8D” voice coil conveniently seats snugly within the case of the AirZooka, leaving just enough room for a mid-range driver to be placed in front of it with threaded rod as a support structure. Initially I had concern as to whether or not this assembly would shake itself to bits upon use, but fortunately that was not the case. Instead, it shakes the windows. ∎ # -18dBm of cats I moved California. More about that on another post. Since then, I’ve (well, we’ve) had wifi problems, specifically ones emergent of what I consider to be some terrible MIMO radios. Periodically, our router [Netgear WNDR3700] would dump everyone on the 5GHz band, and disable the radio for some 20 minutes. This turned out to not be a software issue, as openWRT did not solve the problem. This was my solution; I figured it was worth sharing. Don’t tell the FCC, but our house now has a 1W wireless N connection. ∎ # Engineering Bootcamp “Rhythm, you either have it or you don’t; that’s a fallacy”. Every tile below is a link to a wikipedia article on the subject. # Heisenberg’s Uncertainty Principal: The actual content of quantum theoretical kinematics and mechanics Preface: Upon reading chapter four of my assigned physics textbook [Modern Physics, Krane], I grew both tired and annoyed with the generalizations, or “leaps of faith” which author continually made. I soon found it more useful instead, to spend time reading the papers upon which these principals have been derived. Astonishingly however, I failed to find a modern, usable English translation of Werner Heisenberg’s landmark paper! More unfortunately even, the closest I did come on the hunt for such a translation was the discovery of a broken-english, NASA OCR script from 1988 hosted on the web archive. That won’t do. Thus utilizing a day’s time, Google translate, MathJax and my personal skills at reading broken-english datasheets, I below have provided a modern translation of W. Heisenberg’s paper. For convenience of the reader, I have replaced some original variables used in the paper to more represent those found in common texts today. New notations such as euclidean norms (i.e, $$|f(x)|$$) have been instated, as well. Dr. Heisenberg’s various justifications alone make for an interesting (and perhaps, very useful!) read, but for those short on time I have prepared also, a “too long, didn’t read” summary immediately preceding. ## TLDR Summary If we are to derive a model that quantizes space, perhaps to cells with lengths some finite dimension $$h$$, then we are left with in the space $$\mathbb{Q}^2$$ for example, a 2-dimensional grid of possible positions. Objects in this grid then, may be given some arbitrarily-defined co-ordinate, $$q$$. q of course, is a function of $$(x,y)$$ inside $$\mathbb{Q}^2$$. $$x$$, and $$y$$ may only be integer multiples of h, or specifically: $$q = \left \{ \forall (x, y)*h\in\mathbb{Q}^2 \right \}$$ (don’t be scared, I’m just having fun with LaTeX!) Now, if $$q$$ is a function of yet another quantized variable, $$t$$, then $$q(x,y)$$ may be broken into $$q(x(t),y(t))$$. Thus if it’s fair to say “$$q$$ can move as time advances integer multiples of h”, then it is possible to define some distance $$q_x$$, that $$q$$ has moved in that elapsed time $$\Delta t$$. We may thus define a 1-dimensional “velocity” $$v_x = \frac{\Delta q_x}{\Delta t}$$. $$q$$ however, is not a continuous function in this space, as it may only take on discrete values, themselves integer multiples of $$h$$. Therefore it is useless to define “the velocity at a point”. More generally, $$q$$‘s average velocity for any time interval, $$\Delta t$$, smaller than $$h$$, is not definable. Restated, only values of $$q_x$$, or $$v_x$$, can satisfy the below statement; If time advances as $$(integers) * h$$, then $$\Delta q_x \geq h$$ if our definition of “velocity” is to make any sense. By extension, momentum in this direction, which is defined as $$m v_x$$ must satisfy $$p_x \geq h$$, if $$m$$ can be no smaller than $$h$$ as well. Now consider the thought: What if we were to look at the object $$q$$, with absolute precision? That is, $$q_x$$ is exactly defined, and $$\Delta q_x = 0$$. Then, if $$v_x$$ is a function of $$\Delta q_x$$ then as $$\Delta q_x(t \rightarrow 0)$$, or “the change in $$q_x$$” approaches zero, then the function $$v_x(\Delta q_x(t \rightarrow 0))$$ becomes indeterminate. This relation works on the converse as well, such that the relation: $$\Delta q_x * m \Delta v_x \geq h$$ is justified! In our 3 dimensional world $$\mathbb{Q}^3$$, this equation becomes the familiar Heisenberg uncertainty principal: $$\Delta q_x\;\Delta p_x \geq \frac{h}{2 \pi}$$ The factor of $$2 \pi$$ is a geometric normalization. The origins of this relation’s elegance are plain to see: it is one derived from simple principals! Below, Heisenberg purports similar arguments exist for an energy-time relationship, and proves both relations are just as true for wave-functions as they are for discrete, “particle” functions. I’ll leave that lesson to be a test of your reading comprehension skills, however. ## Über den inhalt der quantentheoretischen anschaulichen the kinematik und mechanik (or, the actual content of quantum theoretical kinematics and mechanics) W. Heisenberg, a modern translation by Adam Munich # How many things can we build (and burn) in one week? Last week I was quite annoyed, due to excessive homework among other things. Now what do we do when that happens? WE IGNORE THE IMPORTANT THINGS AND BUILD STUFF ᕕ( ᐛ )ᕗ So by forgoing sleep, how many things can we construct in one week? As one would have it, a good deal of things. ### Thing 1: A UL approved power box for bigcoil Ignore the wire-nut e-stop. There’s really not a whole lot to see here. It’s little else but a laser-cut box, a contactor, a breaker, some buttons, LEDs and a phasing switch for operation on Y-only, or Y,U,V hookups. Yes wood is flammable, but quite frankly, there’s not much that can go wrong in a box like this. If something does go wrong, I’ll be right there to act, anyway. ### Thing 2: A pulse generator This one is a little bit more interesting. Sans one missing knob, it’s an optical (fibre) pulse generator for bigcoil. Dubbed, ‘the turboencabulator’, she’s capable of generating up to 300us pulses at either timed intervals, or to the tune of 4 channels’ worth of midi music [4-polyphony]. The four possible super-positioned notes, each run from a dedicated interrupt timer, are FIFO scheduled (that is, scheduled on a first-come, first-serve basis). The turboenecabulator is powered from a lithium battery and may either enumerate as a USB device, or accept a legitimate DIN-MIDI signal from whatever source you so choose. There are still some bugs, but hey, what do you want from one days’ work? ### Thing 3: A second monitor for my tablet. It’s very inconvenient to split-screen my tablet while doing math homework. After all, we only have 1080 lines to play with here! As a solution, I put together a USB-powered, second display for my tablet. It is an iPad Retina-display™®© (specifically, the Lp097qx1-spa2 from LG), powered from USB, and fed video through a specially-shortened displayport cable. Conveniently, the LG glass supports embedded displayport as its video signal input, so, this project was little else than a bit of level-shifting, and constant-current LED driving. Sadly, I cannot run this panel at above 50% brightness or we’ll blow the polyfuse in my tablet’s USB port. But my, that glass is purdy nonetheless. ### Thing 4: More segue-boards Advanced circuits managed to get my PCBs in by Friday, which of course means they’re populated by 3AM Saturday morning! Overall there didn’t appear to be many design errors with this run, and in fact I’m quite happy with how Brushbuster IV turned out. We’re still waiting for my ST-Link JTAG programmer. UNFORTUNATELY, Linear technology seems to have overstated the reliability of their LTC6802-1 DACs, that is, their “we can float them at 45V and use current to daisy-chain the SPI lines” promise. I don’t know why I believed that; the first few moments of real pack loading made short order of the the ICs, and the$60 pads they were connected to. Dang.

Luckily, it wasn’t too hard to redesign the BMS to use the addressable LTC6801-2 ICs, and *real* optoisolators for their communication. I hope then, to order new boards sometime this weekend.

### Thing 5: Bigcoil herself

Bigcoil version two finally got tested -the good news is that she worked. The bad news is, we:

• Melted the capacitor-discharge relay.
• Replaced that relay, then melted it again.
• Broke the $2 AliExpress e-stop button. • Tripped some GFIs, a couple times* • Eventually, caught one of my sketchy ebay switches on fire, and by extension, exploded my gate drivers. There are still issues that need to be solved :-3 * This one is interesting actually. In bigcoil, there is no, non-catastrophic method for GFI-tripping differential currents to form. It’s concerning then, why the GFIs actually tripped! It’s even more concerning, that try as we might, we were unable to trip the AFCI breaker on the circuit bigcoil was tested on! Cool protection products, Leviton. Well that was fun. Now it’s time for five exams. (•_•’) ∎ # Evolution of Segue: Δt = 2 Hardware development is painfully slow. But it does consistently, albeit slowly carry on. (or at least I try to convince myself it does) ## Le’ Software: Motor Modeling What is a brushless motor? Well, in it’s simplest case, it is the following: 3 coils, configured in either a wye, or delta arrangement, each having an inductance, and a mutual inductance with the other coils in the network. Surrounding these coils is an arrangement of magnets; rare-earth, usually, which create a static field upon which the stator coils interact. In a plebeian sense, it’s the ‘job’ of the stator, to generate a rotating dipole vector that the rotor will do its best to ‘follow’. Now, because the total flux in the system is constant, it’s possible to write a kirchoff voltage relation for the stator: Where VR is the voltage drop due to ohmic losses in a coil, VL is the voltage dropped across a coil’s inductance, and Vgenerated is the motional back-emf generated by the rotor’s flux lines transversing the stator coil. For fun, we can break this up into the following matrix form assuming a 3 phase motor: Where VR becomes a [resistance matrix] * [current vector], VL becomes an [inductance matrix] * the time derivative of the [current vector], and Vgenerated remains unchanged. Take special notice of the inductance matrix however, specifically note that “L AC” (et cetera), are the mutual inductances between stator coils. That is, the transformer-like inductance which will induce voltage in neighboring coils, when the voltage in the coil of interest is changing in time. This can be broken up further: And, assuming that all of our stator windings are reasonably equivalent, and that our windings are magnetically distributed 120 degrees apart from each-other, we may simplify to a somewhat-nicer looking equation: ~Where~ R = the average stator winding resistance L = the average stator inductance M = the average stator mutual inductance I dot = the time derivative of current Vmax = the maximum back-emf that will be generated Theta_e = the electrical angle which describes the current back-emf, and also, the currents I(theta_e) and Idot(theta_e). For aesthetic reasons, I do not write I or V as functions of theta_e, but they indeed are! The above equation also assumes that back-EMF is generated sinusoidally. That is, when you spin the motor and look at the voltage across a stator coil, you’ll see a sine wave. Due to reasons I won’t delve into here, this *is not true for every motor*. With these substitutions made, it’s a bit more convenient now to smash everything back into as few matrices as possible: Admittedly though, this equation still doesn’t do us much good. It requires explicit values for every current in the circuit, and who even knows what the value of “M” is? What if however, we assume our currents to be balanced? That is, there is some relation Ia + Ib + Ic = a constant, which in theory, would let us simplify our matrices a bit. Could this be the case? Well… certainly not if the motor is grounded! Just refer to the left figure, and you’ll soon see why. ( For those bad at where’s waldo: If a ground exists, Ia and Ib and Ic can all leak out through it, independent of each other! ) A simple solution to this problem is to *not* ground our motor. In doing so, we end up with the relation Ia + Ib + Ic = 0, which lets us make the following simplifications: Which then becomes the rather trivial relation: Look at that, our inductance matrix is now isomorphic to an inductance scalar. Hot damn! There are still some more unknowns to kill, however. Specifically, what exactly is Vmax? Well, Vmax, by our prior definition, is the maximum electromotive force generated by the rotor’s magnets flying past the stator’s coils. As such, per one of maxwell’s relations it’s a linear function of the rate of change of magnetic flux in the stator coil. With this argument in mind and the constraint that no magnetic components are changing in physical size, Vmax must then only be a function of flux linkage and angular velocity of the motor! And with that… Look at that: a model which contains quantities that are either all constants, or physical elements we can directly measure. Nice! But, this matrix representation is still not all that useful to us. I say this because it’s impossible to fully represent the model in this form, with conventional engineer’s tools like phasors. So, we need some sort of transform to take us from this balanced, 3-phase representation into something of the form e^ix, or restated, from a 3-tuple representation into a 2-tuple representation. Thankfully, a lady by the name of Edith Clarke figured out how to do this in the 1960’s. Yay, we just gave one component in our current/voltage tuples the boot! Edith’s transform can be thought of as a geometric transformation: three vectors, rotating synchronously in space, are projected onto the complex plane. Assuming these vectors are “at theta=zero”, that is, oriented in such a way that vector A is co-linear with the real (alpha) axis, then we are left with a situation in where the two other vectors are pointing the other direction, and are offset 60 degrees from the real axis, or correspondingly, 30 degrees from the imaginary (beta) axis. Now what is the real part of a 30-60-90 triangle on the complex plane? sin(60) = sqrt(3)/2. What is the imaginary part? cos(60) = 1/2. That in mind, take a look at the transformation matrix, and it all should make a lot more sense :-). Now, we still have that ugly back-emf vector, |cos(x), sin(x)|. What can we do about that? Well, in vector space, a 2-tuple is for all intents and purposes isomorphic to a complex number, which is also a 2-tuple. (read: “ordered pair”). So, with the convenient relation: e^ix = cos(x) + i sin(x) We can say that: |cos(x), sin(x)| for our purposes, is equal to e^ix Ain’t that somethin? In hat notation, our equation is now beautifully simple! Where V_hat, or any other similar vectors are equivalent to ( V_max e^i theta ). One might ask though, how is this two-dimensional equation useful in our 3-phase motor? What good does it really do us? To answer that question, it does us good, because instead of three phase shifted cosines, we now only need to keep track of one sine, and one cosine component. This is a much easier proposition for DSPs to handle, and, because we used a linear transformation to get this equation, it’s possible to use an equally trivial transformation to bring us out of the complex plane, and back into three-phase space. Specifically like so: I_phase_a = 3/2 Re[I_hat] I_phase_b = 3/2 ( -1/2 * Re[I_hat] + √3/2 * Im[I_hat] ) I_phase_c = 3/2 ( -1/2 * Re[I_hat] – √3/2 * Im[I_hat] ) Where I_phase_n is a current, itself linearly related to the PWM value you’d feed to some leg of a mosfet bridge. But that’s enough of this, let’s toss everything into mathematica to prove I’m not giving you crap! Bam, would you look at that. Those curves sure look like a brushless motor to me. With the proper constants chosen they should represent any motor, even a Segue motor! ## Le’ Hardware: Another$100 worth of power electronics

It is often the case that something you discover during a project, completely invalidates all prior work on the project. Sometimes this may happen more than once.

After modeling my motors we soon needed to fill in the constants, flux linkage in particular. How does one go about finding that?

Well, you use lots of scotch tape, a power drill, aluminum foil, two LEDs and an oscilloscope.

SCIENCE.

Too much of it to handle.

Anyway… in this case, the maths above soon revealed that my 44V of lithium power was not going to be enough for Segue. That is, the back-emf generated by my motor will equal 44V, when Segue reaches a linear speed of 21 km/h. …which is *not* 40 km/h!

So ladies, gentlemen and children of the internet, I present Segue v5.

After getting fed-up with de-, then re-soldering hundreds of components every time a board was revised, I decided it was in my best interest to go back to the “multi-pcb-with-ribbon-everywhere” solution. That is, Segue will have 5 independent boards:

Cellsniffer – A 24 cell (88V) lithium-ion pack monitor and balancer.

S.T.S. Whitetail – A board full of buck converters, and an 88V 4A boost converter.

Brushbuster(s) 3 – A new motor controller board, equipped with super-badass 8mohm 150V mosfets and a C2000 DSP

Seguebrain – A board with a bluetooth radio, an IMU and a cortex-M4, among other things.

“Lolomgwaffles it’s a penis” screams the internet. Yeah, get over it.

Now, as much as I would love to say I’ve gotten things working; IE, having a nice stochastically-spun motor available to show you, I don’t.

Why?

Because, programming a C2000 piccolo is evidently quite a pain in the ass. That is, code composer studio for some reason likes to hang during flash erases, which just so happens to brick my DSP.

I’ve yet to figure out why this is happening, but to be honest, I’m a bit fed-up with these ICs already. I mean really, *WHO STORES LOCKOUT PASSWORDS IN PROGRAM FLASH*. Is is really that much more expensive to have a 64 byte bank of EEPROM memory, explicitly for storing such configuration data? Evidently so!

Assuming all other TMS320 products do the same, remind me to *never* use a TI DSP inside an aircraft, or some other similar mission-critical system. I say so, because it would be really, really bad if you locked-up such an IC, buried deep inside an apollo-computer construction actuator control box and/or something of equal “this is going to be really hard to repair” stature.

“Oh hay guys, our JTAG flash bricked ur airplane”

ಠ_ಠ