## Bootstrapping myself into RF

I’ve dreamed radio dreams for many years.

I think I’m closer than ever to being able to goof around in the RF.

Previously I’ve taken a too low level approach, trying to build my own oscillators and amplifiers. Certainly doable, but not the easiest, and not actually the thing I’m most interested in.

The revelation came when I saw this mit radar building guide. They’re using little blocks that I understand from microcircuits. I think that’s one of the easier ways into the high frequency regime.

So I went a huntin on ebay and bought anything that sounded reasonable. VCO, mixer, LNA. One tripping point was that I had no way to measure anything. My oscilloscope only goes up to 100Mhz.

So I bought a frequency Counter and Power Meter for real cheap.

The frequency counter works. Try wiggling between high and low mode and turning the filter off. It picked up my 2Mhz function generator signal and also the signal off the VCO I bought, which goes from 90Mhz to 190Mhz ish.

With the pin connector on the left the top is control, the two middle are ground and the bottom is power

## Folgertech Prusa update

Folgertech sent us free replacements for our broken thermistor and two new motor driver boards. Fast response, Fast delivery. Good on you, Folgertech.

So we got it a printin! For a while we were getting stringy garbage that seemed to not really match any problems we found. Problem turned out to be that the print head came preassembled with the gear set screw untightened. Kind of a wonder it was printing at all. Had noticed that manual extrusion was rather sporadic. Maybe should’ve suspected sooner, but I guess I assumed that repetier was being wonky.

The built in slic3r in repetier crashes on my mac for some reason, so I open up an independent instance and use that instead.

Also, SD card printing is preferable. We’ve killed a couple prints when my computer goes to sleep.

We’re using Onshape. It is pretty awesome. Ben whipped out some mounts for our lcd screen in like 10 minutes. Then we didn’t have enough M3 nuts, so we printed them. PLA is soft enough that it can be threaded by the screw. Needed to be 105% scaled in Slic3r.

Also press fit some spare 606Z bearings into a little cup. No scaling needed. Also press fit a little 6mm cylinder into the center. Not an insanely permanant tight press fit, but definitely needs so force to take out.

Made some cubes, some octopusi, a sloth.

Onwards and upwards!

## Problem 2: Schutz chap 5

1.

Redshift from gravity. Fire a photon up. Convert into mass and let mass drop. If energy conserved then you gain mgh of energy where $m = \hbar \omega'$, the freqeuncy at the top. Hence you have $\hbar \omega = m+mgh=\hbar \omega (1+gh)$.

The frequency at the top is reduced by (1+gh), i.e. it is redder.

2. Uniform gravity raises no tides? That’s odd. naively I would think that the water would flow towards the lowest energy configuration, which would be at the bottom of the external potential. On the total gravitational potential (+ centrifugal force) constant surface. Which does get distorted by an external field.

Oh. I see. Looking at the text, the earth would be freely falling as well.  Wow. That’s an important point. The earth is falling towards the moon at exactly the rate of free fall. It’s the differences of force that cause the tides. A little stronger on the front, a little weaker on the back. This is sort of the same thing as a draping cloth in a falling elevator.

7.

Can’t raise an lower $\Lambda$ using the metric. They are coordinate transformations. I believe upper indices are components of vectors and lower indices are components of 1-forms. $dx^\mu \partial_\mu$ and $\partial_\mu \phi$

$x = r\cos(\theta)$

$y = r\sin(\theta)$

This matrix will convert the gradient into new coordinates

$\begin{bmatrix} \cos{\theta} & -r\sin(\theta) \\ \sin(\theta) & r\cos(\theta) \end{bmatrix}$

$\theta = \arctan(\frac{y}{x})$

$r = \sqrt{x^2+y^2}$

This one will convert vectors into new coordinates

$\begin{bmatrix} x/r& y/r\\ -y/r^2 &x/r^2\end{bmatrix}$

Multiplying the two should give an identity matrix, since inner product should stay invariant under coordinate change. Quite miraculously they do. Try multiplying the two matrices. Nice.

## Problem 1: Free Particle

Let’s solve the free particle

I guess

Newton’s Law $F = ma$

$d^2 x / dt^2=0$

Hence $x = x_0 + vt$

At least that works. Not sure I derived it particularly. Or proved it unique.

Whatever. Lagrangian version

$L = T-V = \frac{1}{2}mv^2$

Euler Lagrange Equations

$\frac{d}{dt} \partial L / \partial \dot{q} = \partial_q L$

How do you get that? By varying the action with fixed endpoints it’s the one that minimizes the path.

$S = \int L dt = \int \partial/\partial\dot{q} L \delta \dot{q} + \partial_q L \delta q$

Nice.

$H = \frac{p^2}{2m}$

$\dot{p}=-\partial_x H=0$

$p = Const$

$\dot{x}=\partial_p H=\frac{p}{m}$

Okay. What about the quantum version?

Well $p = \frac{\hbar}{i}\partial_x$

How do I know that? In particular it’s hard to remember where the i goes. Well, I memorized it at some point. It follows that

$[x,p]=-\hbar/i$

But what is

$i \partial_t \psi = -\frac{\hbar^2}{2m}\nabla^2 \psi$

$E\psi =$

Whatever. I’m bored.

Maybe I’ll do the path integral some other day

## Folgertech Prusa i3 Printer

So we bought the Prusa i3 with the aluminum frame from folgertech about two weeks ago. Was tempted first to get a Chinese version off of aliexpress, but I’ve heard tales of long shipping times, plus possibly some kind of importing fee. WOuldn’t have saved much money anyhow. Definitely the way to go. It shipped pretty fast. Got it in about 3 days or so. Noice.

Box was surprisingly heavy and small.

There were some small problems, but nothing super major

The thermoresistor leads were overcrimped. The bot is totally unresponsive if it is freaking out about the thermoresistors (including motor control. Odd.) They should measure ~100k if they’re correct. We tried resoldering them, but too brittle. Hopefully getting a replacement from folgertech.

A little confusion about what the extra molex connector was for. For attaching to the thermistor

Missing 20mm screws

The 3d printed mounting piece for the extruder had its holes with poor spacing. We dremelled out some material in order to get both screws through.
The triple screw mounting of the Z-axis motor mounts torques the linear guide rails. We found just using the two upper screws to be better and leaving the third that goes into the vertical beam out.
We had a couple things that we changed in the firmware Configuration.h file  in order to get it working.
Our motors were only going one way until we disabled the max endstops. I guess it must have been registering nonexistant endstops as being hit.
#define X_HOME_DIR -1
#define INVERT_E0_DIR true
#define DISABLE_MAX_ENDSTOPS
There are no teeth in the stage belt connector (There probably should be some?)
Two of our motor drivers did not work. We were tearing our hair out over why the extruder motor wasn’t turning until we popped another one in.
Also a brief moment of panic when the entire board would not respond, but removing motor driver that had blown brought everything back up.
We also bought a lcd screen. I recommend it. Pretty nice.
Used repetier and slic3r on mac and grabbed some models from thingiverse.
I think the nozzle is 4mm, based on the folgertech website selling the extruder unit with 4mm attached. Not super sure how I’m gonna measure that.
http://reprap.org/wiki/Calibration
Maximum layer height of .4*.8 = .32
extrusion width <= .4
#define DEFAULT_AXIS_STEPS_PER_UNIT   {80,80,3840,90}
http://reprap.org/wiki/Triffid_Hunter’s_Calibration_Guide
I wonder how much stretching will change this?
Hmm. 3840 in the stock firmware vs 4000 in Triffid’s guide?
“Personally I go for layer height of 0.2mm, and extrusion width of 0.5mm regardless of which nozzle I’m using.”
Tried 200C extruder temp
With painter tape on unheated bed. Seemed to be working until thermistor fix snapped
Triffid suggests printing at decremental temps
Also 65C bed for PLA.
Gotta try that.
So close.
So very close now.

Let’s try to give an explanation of superconductivity a go.

First off, there are at least two prongs, the microscopic and the macroscopic. This is ubiquitous under many topics. Hypothetically the two are linked, but in practice you don’t need one for the other. For example, the microscopics of magnets coming from the electron spins and why the spins like to align vs the forces felt by refrigerator magnets. Or why electrons respond to electric field in metals vs. circuits.

On the macroscopic level you have the London equations. They are essentially just telling what the response of the material is, kind of like ohm’s law for superconductors. You can derive the Meissner effect, the expulsion of magnetic field from inside the superconductor, from these guys.

On the microscopic level, you have BCS theory. The electrons are attracting each other, and they form bound states a little like a hydrogen atom called Cooper pairs.

In between the two, on what you might call the mesoscopic level, is Landau Ginzburg theory and Bogoliubov de Gennes. These more or less describe that the electron fluid is more or less moving as if the superconductor.

I think I’ll start with the microscopics.

For bosons, the condensation is conceptually more straightforward. Bosons need to be in wavefunctions that are fully symmettric between the particles. If you flip any of the coordinates between particles, the wavefunction stays the same. $\psi=x_1 x_2$ for example or $\psi=e^{i k x_1 + i q x_2}+e^{i q x_1 + i k x_2}$.  It is possible for all the bosons to just be in the same wavefunction $\Psi=\psi(x_1)\psi(x_2)\psi(x_3)...$. Cool. Alright. This is a good variational wavefunction to try (the variational parameters being the entire single particle function $\psi$. Quite a lot of wiggle room! But also very constraining. Many particle physics Hilbert spaces are huge.). Maybe the bosons will like it, maybe they won’t. In what situations do they like this thing? Basically, attractive potentials. In He-4 this comes from van der Waal forces (dipole dipole forces).

One of the characteristics of bosons is that they clump. They have a statistical likelihood to be near one another . The wavefunction we’ve picked feels extremely bosony, and it is. It exacerbates this clumping. So attractive potentials between particles will energetically prefer this wavefunction.

## More with RTL-SDR

http://web.stanford.edu/class/ee179/labs/Lab.html

http://aaronscher.com/

Seems hella useful

puts some data from my boy and puts it in file ab120_10.dat

-g sets gain. -f sets central frequency. Defaults to 2.048 samps/s. The n is number of samples which is 10x that so that means 10s.

I basically reimplemented the example code from matlab into  numpy.

A surprising glitch is that using pcolormesh with the fft/spectrogram is that you need to use the fftshift function for it to work right (hypothetically, it feels like this shouldn’t be necessary).

I was confused for a long time by this. The example code for spectrogram doesn’t use a complex signal so I figured that was the problem, but I could see the spike if I just plt.plot() a slice of time. This is bad behavior. I do not see this documented anywhere obvious.

Radio reference. Interesting listing of local radios. I don’t know how to decode p25. Some kind of digital radio standard

https://github.com/szechyjs/dsd

Maybe this is the right thing

How did people do anything before the internet?

The Raw IQ data is unsigned byte alternating I then Q

The rtl_tcp server serves up this data stream.

It also accepts data commands, but I do not see where this is documented.

## Playin around with ESP8266

So I tried tying my esp8266 to the 2\$ nano i just received in the mail. Was getting nothing for a while. Needed an external power supply to work. Too bad.

http://rancidbacon.com/files/kiwicon8/ESP8266_WiFi_Module_Quick_Start_Guide_v_1.0.4.pdf

Set serial monitor to both NL & CR line returns and 9600 baud to get it to respond to AT with OK.

firmware version

AT+GMR
0018000902-AI03

AT+CWMODE=3

sets it into some mode? Necessary for the next step to work

CW stands for?

List Access Points

AT+CWLAP lists local access points

Join access point

AT+CWJAP=”local access point”,” password”

I’ve noticed that the esp is available from my computer

AT+CIFSR tells me the IP addresses

I belive one is its ip as a client and one as an access point.

I do not have a great success rate with commands. The serial is getting garbled

Gonna try loading up that custom firmware

https://github.com/tommie/esptool

Looks like there is a python script to load the firmware

https://github.com/nodemcu/nodemcu-firmware.

Or Maybe I’m done for today.

## Getting Going with RTL-SDR (A computer radio thingy)

Using a Mac kind of adds a little bit of shit to every encounter I have with open-sourcy projects. The really mainstream ones fully support macs, but the sort of off road ones need tweaking and digging, even though by and large OS X is compatible with linux as far as I can tell.

Install macports. I tried using homebrew and failed

It’ll install an explosion of stuff.

run gqrx

select the device.

192000 sample rate

leave the other stuff at 0. Do not yet know what that does

When I change the output device it crashes hard for some reason. Default works though

You can click and right click on numbers to change them

Around 100Mhz you’ll see some fm stations

Pick a demodulation. WFM mono or stereo.

http://gqrx.dk/doc/practical-tricks-and-tips

Here’s a bunch of garbage that didn’t work:

Followed these instructions:

https://github.com/robotastic/homebrew-hackrf

build failed on gr-baz. Hmm. Error

Tried doing some stuff. Apparently not updated to gnuradio 3.7? Optional So maybe ok.

Reported that it can see my stick (A NooElec R820T2 NESDR Mini 2)

Screw it. i don’t know how to get this working. Let’s try a different tact.

Fired up my ubuntu virtual machine. Go into settings and add a usb filter for the SDR dongle

Alright After some significant hiccups, changing tacts

https://github.com/roger-/pyrtlsdr

I’d bet that one of the previous stages was necessary to get this going.

Checkout demo_waterfall.py. Pretty cool

## ngspice, huh

Got tipped off to ngspice. Circuit simulation. Not bad. Can’t get it to graph properly on my computer though. I vastly prefer specifying the circuit in a file to specifying it in a schematic. That sucked.

http://www.ngspice.com

is a solid online doohickey

Hypothetically this is a copy of that code. Wonder how long that’ll last

http://www.ngspice.com/index.php?public_circuit=T6XqVE

Axebot Lives.