Friday, September 9, 2022

Integrating the T41-EP with GNU Radio

Before working with the Teensy while it is in the main board, remember to sever the USB power bridge on Teensy, Otherwise you will put 5 volts on the T41-EP 5 volt bus from both your computer and the T41-EP power supply.  Bad things will happen if you don't do that.

Everything is performing well right now with my T41-EP and the V015 software.  However, it would be nice to integrate with GNU Radio to be able to validate the hardware and also open the door to do some experimentation with DSP.  Reading up on Teensy, it has a rich development environment that I found here:

https://www.pjrc.com/teensy/gui/

I developed this flowchart.


I imported the code into Arduino and this is what that looks like:

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2SQuad        i2s_quad2;      //xy=293,148
AudioInputUSB            usb1;           //xy=329,306
AudioMixer4              mixer1;         //xy=491,148
AudioOutputI2SQuad       i2s_quad1;      //xy=660,303
AudioOutputUSB           usb2;           //xy=742,157
AudioConnection          patchCord1(i2s_quad2, 0, mixer1, 0);
AudioConnection          patchCord2(i2s_quad2, 1, mixer1, 1);
AudioConnection          patchCord3(i2s_quad2, 2, mixer1, 2);
AudioConnection          patchCord4(i2s_quad2, 3, mixer1, 3);
AudioConnection          patchCord5(usb1, 0, i2s_quad1, 0);
AudioConnection          patchCord6(usb1, 0, i2s_quad1, 2);
AudioConnection          patchCord7(usb1, 1, i2s_quad1, 1);
AudioConnection          patchCord8(usb1, 1, i2s_quad1, 3);
AudioConnection          patchCord9(mixer1, 0, usb2, 0);
AudioConnection          patchCord10(mixer1, 0, usb2, 1);
AudioControlSGTL5000     sgtl5000_1;     //xy=385,423
AudioControlSGTL5000     sgtl5000_2;     //xy=402,475
// GUItool: end automatically generated code


void setup() {    
  Serial.begin(9600);            
  AudioMemory(48);
  mixer1.gain(0,1);
  mixer1.gain(1,1);
  sgtl5000_1.enable();
  sgtl5000_2.enable();
  sgtl5000_1.volume(0.6);
  sgtl5000_2.volume(0.6);
}
void loop() {
  // read the PC's volume setting
  float vol = usb1.volume();

  // scale to a nice range (not too loud)
  // and adjust the audio shield output volume
  if (vol > 0) {
    // scale 0 = 1.0 range to:
    //  0.3 = almost silent
    //  0.8 = really loud
    vol = 0.3 + vol * 0.5;
  }
  Serial.println(vol);
  
  // use the scaled volume setting.  Delete this for fixed volume.
  sgtl5000_1.volume(vol);  
  sgtl5000_2.volume(vol);
  delay(1000);
}


It programmed the Teensy fine.  Then my PC detected and loaded an audio device named: "Teensy Audio".  One head scratcher is that the PC's audio output volume doesn't change on the Teensy.  I worked with the 10K pot on the main board and that is how I'm changing volume. That is fine for now.

Remember to sever the USB power bridge on Teensy, Otherwise you will put 5 volts on the T41-EP 5 volt bus from both your computer and the T41-EP power supply.  Bad things will happen if you don't do that.

I did some quick tests, by running audio into both the microphone and receive channels on the main board.  Those appeared on my PCs speakers.  I then played audio from my PC to the  T41-EP.  That audio was on both the speaker output and the Exciter port.  Yay!

With that I now have high confidence that my audio ports are working on the main board.  

This did force me to study the schematic and the main PCB.  I had neglected to jumper the Teensy Audio shield to the L, G, R, MIC GND, and MIC on the PCB.  Doh!  


Now off to GNU Radio.

I loaded it on my desktop.  It threw an error that revealed that my ancient desktop doesn't support AVX.  However, my Laptop did, so now both my desktop and laptop have GNU Radio loaded.

Regardless, my laptop works fine and in GNU Radio Companion, I developed this flow graph:


It loops back the audio source (both of the Audio input ports on the T41-EP) to the Audio Sink (The speaker and the Exciter port on the T41-EP). And it displays an FFT spectrum and waterfall.  I fed it audio from a handy source (audio from the my workbench FireTV) and this is what it shows:



Whoop!  With this, it opens the door to work with any signals and experiment with GNU Radio and to learn and proof DSP techniques which can be ported (I think?) to the T41-EP.

Very satisfying.

Building the T41-EP


 This is my first success.  The CPU is running V015.  The encoders work.  The switch matrix does "something".  Man, that 3.3 Volt regulator does get hot!


It runs!.  I ran a 7.030 MHz CD signal from my signal generator into the QSD.  I'm waiting for some 2n3904 transistors, so that is bypassed by a wire at this time.  The CW tone came through the speaker.  The waterfall shows the signal.


Wednesday, January 5, 2022

Building cases for my Sky-Watcher EQ6-R Pro mount

I have been working with my Sky-Watch EQ6-R PRO mount.  I don't want to  have the mount components drifting about, so I build cases for storage and transport.


Here is what I want to do:

1.  Have a rugged cases to carry the large components of my telescope mount. i.e. not cardboard boxes

2.  Wheels for the heaviest boxes.

3. Carry case for the tripod. It tends to splay open and is awkward.

4. As is always one of my mantras - cost effective.

I searched lots of different cases and couldn't find anything which overwhelmingly fit the requirements.  The mount was shipped in cardboard boxes with molded foam inserts inside.  Those foam inserts are very rugged. So I decided to build the cases myself and use the molded foam inserts.  This is what I came up with:

This is the case for the mount head.

Opening the lid shows how the molded foam fits.

This is is what it looks like with the top foam insert removed.

This is the case for the counter weights.

Inside you see the tops of the molded counter weight foam insert.

And the view without the top foam inserts and the counter weights nestled inside.

I use a 110 volt AC to 12 Volt DC power supply.  I added extra volume to the counter weight carrying case to accommodate that as well.

Parts include:

Strap hinges - Home Depot

https://www.homedepot.com/p/Everbilt-3-in-Zinc-Plated-Strap-Hinge-2-Pack-15289/202034111


Handles - Home Depot

https://www.homedepot.com/p/Everbilt-5-3-4-in-Zinc-Plated-Door-Pull-15181/202033999


Lid clasps - McMaster Carr

Corner-Mount Padlockable Draw Latches found here:

https://www.mcmaster.com/catalog/127/3153


I didn't take any pictures of the tripod carrying case.  I did order this:

https://www.highpointscientific.com/apertura-universal-tripod-case-with-zippered-extension-utc

It is light and works well, but is rather costly.  It is a nice product.


I used 18 gauge by 2 inch brad nails and wood glue to hold it all together.

It may be noted that the strap hinges will fold over the wooden side pieces and the screw heads interfere.  I did counter sink the screw holes on the opposite side so the flat head screw heads will not interfere.  The lid closes fine.

The paint is something I found in the garage.  As you can see, this is not furniture grade.  The paint should protect the wood from moisture.  

All in all, the cases work good.  With the mount head in the box, it is heavy.  I have a two wheel hand truck on order.  I may use it as is, or I may bolt it to the case.  Because it is heavy, bolting it to the case may put it over my ability to lift.  Stay tuned.