darker technotes.

Categories

Latest News

Monthly archives


Search




“Hello World” is Lame. My First C App, “inthetriangle”.

At some point, it was realized learning C is something that needs to be done before trying out anything ARM core based. Learning on an AVR, after already knowing how to do things competently on the microcontroller in ASM, was frustrating as it for the most part seemed pointless, introducing a whole other layer of issues that came with the compiler and had nothing to do with the hardware itself. Something tiny was written to test the WinAVR installation, then something better to do was found.

Then the other night, a friend came over and said his C class and the instructor didnt have a working algorithm to find if a test point was within a triangle. So I stared for awhile, convinced it didnt take very complex math to figure it out. The algorithm involved calculating the points that a horizontal line passing thru the test point intercepts the triangle sides (using slope equations and a difference equation) and testing if the test point is between these points. I decided I wanted to code my algorithm in C.

So here is the end result. My first C app, inthetriangle, will indicate if a point is on, within, or outside of a triangle. It will also indicate if the triangle points are invalid because of repeated points or if they actually describe a line segment. Input with scanf() is decidely ghetto. I’ll have to change that.

inthetriangle-0.2.c

Posted by rmrubin Posted in: Programming Comments Off September 2007


Shopping For A WWVB Synced VFD Tube “Nixie” Clock

After much hesitation (partially from them be listed as coming from “Moscow, Russia, Canada”), green 7-segment VFD tubes in small preamp tube format were purchased from eBay. The datasheet arrived via email, being about a page and a half of mostly white space, a part drawing without labeled segments, a short list of characteristic voltages and currents, and an even shorter list of absolute max ratings. From the specs, it does not seem like they need AC driving of the cathode filament. They should be here within two weeks to confirm this.

For the WWVB receiver circuits, suitable parts were located at Digi-Key, in decent stock quantities and prices. C-Max makes a range of low frequency tuned ferrite coil antennas with very small footprints, for under $3, as well as a demodulation IC suitable for use with the antenna, the CME6005. A module based on the IC is about $9, the IC itself is under $3.

Current plan for controlling the seven segment anodes and the grid on each tube, as well as interpreting the demodulated WWVB signal, is a large pin count AVR driving darlington transistor arrays. Multiplexing will be avoided in order to use the tubes at maximum illumination. The cost of a large pin-count AVR is offset by not having to purchase latches needed to drive the tubes at full duty cycle with less GIO. The TQFP-100 parts look suitable.

Information on NIST’s WWVB atomic clock synchronization transmitter in Boulder, CO is here.

Following are linked Digi-Key part numbers and datasheets for the C-Max WWVB parts.

Posted by rmrubin Posted in: Electronics Comments Off September 2007


Mathless LED Driver Tested

Broken SD Cardreader replaced, picture taking capabilities restored. Most will probably agree by the quality of the pics that soon is the time for a new camera.

The circuit was changed, replacing the R2 of 1K for a 10K. This drops the current required for the reference transistor, Q1, to under 200uA, an insignificant level compared to the LED current draw.

Testing was done with a LM317/LM337 based cigar box PSU, and a Fluke 110 DMM. The assembled circuit acted as expected, and as simmed by LTSpice. The Vbe of the reference transistor, Q1, was tested as being .65V, giving a forward current of slightly under 10mA with a 68R resistor for R1. Current, and thus brightness, was consistent from 3V to 18V, althought higher voltages are possible while still keeping the LED driver transistor, Q2, within its absolute maximum power dissipation spec.

Possible Mathless LED applications include dynamic input LED lighting for people with no clue about electronics or even basic math, or in an academic lab as a current source experiement.

Mathless LED Board Close Up Mathless LED Assembled Mathless LEDs

Mathless LED Test Setup Mathless LED 3V Test Mathless LED 18V Test

Mathless LED Schematic Rev2 Mathless LED Board Rev2

Posted by rmrubin Posted in: Electronics Comments Off September 2007


Amazing Stunt Rd Views. Also Creepy Saddle Peak Bunker.

Some pics from a recent trip to the top of Stunt Rd., where it intersects Schueren Rd. and Saddle Peak Rd near Saddle Peak. Google Map. The site has parking for for a few cars, and offers views of West San Fernando Valley, Malibu, and Los Angeles. I’ve never been alone with the people I went there with for very long. It’s a more well known view, so there are often people already there.

There is a gated fire road here as well, which is normally locked, but not always. You probably don’t want to drive on it, because like many roads higher in the Santa Monica Mountains, its kinda falling off the mountain. If you took Sheuren Rd. up recently, you already know this. In the city’s defence, they do fix the disintegrating roads pretty regularly. A short hike down the fire road it splits. The high road leads to a Cold War era looking reinforced bunker on top of the peak. Much graffiti to appreciate, although I don’t know if this is still a government building, so possibly the graffiti doesnt belong there. Next to it is a transmitter tower of some sort. Maybe radar or microwave. I saw a clean, functional one recently in Northern California. When we were there, the bunker was buzzing loudly, so something in there is switched on. Directly adjacent to this is a smaller, more modern building, a water tower, and several smaller antennas. The lower path leads to the Northern hump of Saddle Peak. Good hiking and more views of the San Fernando Valley are here.

This is by far one of my favorite secluded places in the city. Anyone visiting Los Angeles looking for sites should go.

Stunt Road Saddle Peak Fire Access Road Stunt Road Saddle Peak View of the Malibu Coast Stunt Road Saddle Peak Lower Path Stunt Road Saddle Peak Tree Eats A Rock

Stunt Road Saddle Peak Concrete Reinforced Bunker Stunt Road Saddle Peak Bunker Close Up 1 Stunt Road Saddle Peak Bunker Close Up 2

Stunt Road Saddle Peak Antenna Tower Stunt Road Saddle Peak Modern Building Section Stunt Road Saddle Peak Bunker From Below

Posted by rmrubin Posted in: Los Angeles Comments Off September 2007


Very Low Cost Mathless LED Driver

Intended for people with interests in LED lighting, but are allergic to the math needed for calculating current limiting resistors, and have very little money. A good example would be an art student or custom car person, although it its ease of use could be appreciated by anyone. If you’re not so allergic to math, the equation is:

R_led=(V_input-Vf_led)/If_led

The device should regulate current through an LED, with a wide range of input voltage. The design uses a pair of PNP transistors as a current source with a target output of 10-15mA with 3-20V the target. Simulation in LTSpice predicts the circuit is sane. Dissipation in the LED drive transistor is under 200mW, and should be within specification of the MMBT3906 used to 155F ambient temperature.

BOM:

PARTS TOTAL: $.07

The board design is single sided SMT, to be milled on the taig using Eagle’s pcb-gcode ULP.

Fairchild MMBT3906 Datasheet

Mathless LED Schematic Mathless LED Board Layout Mathless LED Axis Screenshot Mathless LED Milled Boards

Posted by rmrubin Posted in: Electronics Comments Off September 2007


Xylotex Microstepping vs. EMC2 BASE_PERIOD

Microstepping setup notes. Hardware is a Taig 2019cr micromill with a 20TPI leadscrew and 200 steps/revolution motors, driven by a Xylotex 4 Axis stepper driver. The host for EMC2 is an Athlon XP, a 1700+ or 1800+. After calculations, the step mode jumpers on the Xylotex board were configured for eighth-step mode, and BASE_PERIOD=10000 was set in the EMC2 configuration file.

Initial impressions of the setup are quieter and smoother operation. Performance is comparable with the full step configuration: 60 IPM somewhat works, locking up towards the end of the tables travel, 45 IPM seems stable, and maximum working jog speed will remain 30 IPM. Testing the new configuration in the immediate future will likely be done milling circuit boards with a 30deg conical cutter, and .250″ endmilling acrylic. I’m excited already.

60 IPM = 1 inch/sec

200 steps/rev * 20 TPI leadscrew (full step mode)
= 4000 steps/in
= 4KHz step rate @ 60 IPM
= 250us step period / 2
= 125000 min BASE_PERIOD

400 steps/rev * 20 TPI leadscrew (half step mode)
= 8000 steps/in
= 8KHz step rate @ 60 IPM
= 125us step period / 2
= 62500 min BASE_PERIOD

800 steps/rev * 20 TPI leadscrew (quarter step mode)
= 16000 steps/in
= 16KHz step rate @ 60 IPM
= 62.5us step period / 2
= 31250 min BASE_PERIOD

1600 steps/rev * 20 TPI leadscrew (eighth step mode)
= 32000 steps/in
= 32KHz step rate @ 60 IPM
= 31.25us step period / 2
= 15625 min BASE_PERIOD

Xylotex 4 Axis Stepper Controller Datasheet

Posted by rmrubin Posted in: CNC Comments Off September 2007