I’ve had to re-remember a lot of old math that I haven’t used since probably sophomore year in high school; my jr year and beyond was all calculus…which is past what I’m doing here (so far).
I ran across Grapher.app on Mac OS X. I haven’t seriously used it before, and usually use my TI85, but I gave it a shot. Oh my gosh; it is amazing! I kept having trouble with a simple x^2 fade in/out equation I was writing. It needed to vary the output value based on: time, number of LEDs per gradient, and the LED position in the strip of LEDs. I wanted the color to ramp from 0 (off) to 1 (the full color), and then ramp back down on each cycle. Vary this over time.
Grapher.app let me add a variable controlled by time to simulate running the pattern and figure out what was wrong. It took me a day to learn the program (it has quarks, and bugs) and remember old-math, but it was worth it!
I took the equation above and converted it to C/C++ code for my app. Awesome.
I’m still working on my LED cyr wheel. I’m creating a desktop application to edit patterns, and eventually simulate POV (persistence of vision). For now, it just runs the pattern in a mock-display. I simply re-wrote the LED graphics C++ class (AdaFruit_NeoPixel.h) that forwards to an associated NSView subclass on OS X. I did a lot of work on the code while in India, and had no way to test the hardware, so it was essential that I create a simple simulator. This also allows me to *way* more easily debug issues. I also created a wrapper for the “SD” class to read files from an SD card. The app itself uses CoreData and exports a custom file format to an SD card that I can then read with the teensy/arduino.
The document UI is pretty basic table:
Lots of popup options (and I’m coding more):
Many I wrote or re-wrote based on some demo code, however, some are stock examples (such as the ones past warm white shimmer). Originally a lot of the Adafruit demos simply use hardware timing and delay(XX) (essentially an Arduino sleep), which makes it hard to do specific timing. So, I had to re-write them all to be timing deponent.
The simulator screen shot:
And a video of it in action:
The Adafruit_NeoPixel library has issues. I’ve been fixing problems on my Adafruit_NeoPixel git hub repository. The most important fix has to do with timing; the library has to disable interrupts while it updates the strip. This unfortunately disables the interrupt that updates the the internal timer from millis()..and is dependent on how many LEDs are in your strip. I need more exact timing, so I fixed it (well, pretty close). Each LED takes about this much time to update:
// about 27.36us/LED. See https://learn.sparkfun.com/tutorials/ws2812-breakout-hookup-guide/ws2812-overview for datatransmission of 24 bits using the specified timing
#define MICROSECONDS_TO_UPDATE_EACH_LED 27.36
So at the end of the AdaFruit_NeoPixel::show() method before the enabling of interrupts I fix the value:
// Before we update the interrupts, we want to update the timing so people who depend on millis() being correct will get (somewhat) correct timing.
uint32_t amountMillisIsOff = (uint32_t)((MICROSECONDS_TO_UPDATE_EACH_LED * (float)numLEDs) / 1000.0);
systick_millis_count += amountMillisIsOff;
interrupts(); // original code…
Feel free to use this fix…
Not as nice as light as the last picture (which was taken later, closer to sunset). But still interesting.
I took a three week vacation to see India and visit my girlfriend, Costanza. She does PhD research work in Assam, a north east part of India.
The Taj Mahal in Agra is amazing, and was one of my favorite things to see in India.
This picture is an HDR from 5 exposures using my Canon 5D Mark III. I sort of wish the tree wasn’t in the picture, and in hindsight I should have been more centered. However, the off-centered ness adds a unique vantage point from the typical head-on shot you see of the building.
I got my LEDs today! I did some basic testing, and they seem okay. That’s awesome..I saved like half the cost of buying them from a US supplier.
The new wheel is bent; I used my Harbor Freight bender. Here are a few pictures of the setup. I have been using a fan to keep the hack/motor cool. It works extra hard when going in one direction. My first wheel I bent with it got quite a bit of spiral, and I thought it might be due to the dies not lining up quite perfectly. So this time, I used the mill to make some shims that would center them correctly, and then pulled the top part together with some clamps. Still..I was getting spiral!! GRRRR. I think it is because the motor pulls down on one side, and makes it slightly off center. This became clear later on when I bent the insert; the bearing on the other side was trashed, and allowed it to be off-center. That might have been the problem.
The roller is attached to some 2×6′s to allow me to bend a full 20′ piece without hitting the top of my carport.
The bender has the Swag Offroad “extension wings” welded on, and the “pipe threader motor attachment” added. It works really hard in one direction…but easy in the other. Next time, I’ll roll it through only going in the “good” direction, and build something to keep it aligned a little better. I can also attach a micrometer to it to measure how far i’ve move it and repeat the setup.
I’m only making 5 piece wheels from now on; they 3 piece are super light, but hard to travel with.
Below the pieces is the steel insert (3/16″ wall).
Here’s my planned wire diagram (it will probably change a bit)
It may only make sense to me. I’m wonder if the LEDs that are furthest from the power source will be equally bright. This is for a 5 piece cyr wheel. Based on the diagram, it is now clear to me that the segment furthest from the battery will have its power inlet at most 2/5 of the circumference away. A 5v power ring will run throughout the wheel to power each section, with an on/off switch close to the battery.
My wheels have about a 34″ inner radius. The final tubing OD is 1.725″ with PVC. The center line for the LEDs will have a length of: (34 + 1.725/2)*2*3.14 = ~219″. Two fifths of that is: 87.6″ (roughly 7′ 4″).
Each LED segment will about 44″ long, and based on my 60LED/m strips that is: 67 LEDs (total 335 total per side, 670 on the entire wheel) (HMM> I think I want an even number per side…so maybe 66 per segment, 330 per side, 660 total per wheel).
I did some tests, and supplying current via an extension that is 7’4″ 22 gauge seems to keep it bright enough…hopefully 20 gauge will be okay, as that is the final size I may use (or drop to 18g if it isn’t)
I was going to use molex micro fix connectors; they can carry up to 5amps…but I think that isn’t enough, as the wheel could draw 10+ amps. So, I ordered some Molex Mini Jr connectors.
However, I used some of the micro fit connectors to test stuff, and I literally spent 3 hours trying to crimp the pins on! They just were not “clicking” into there plastic housing. I destroyed several pins, tried the male side, the female side, and even ground them down to see how they work.
I then looked at the molex diagram and realized what I was doing wrong. I had assumed the male looking pins went in the male connector…but it was reversed! The female pins (the ones with the hole in the pin) go in the male connector. Geez…so stupid of me. Worse, I spent $70 for a molex pin insertion tool and pin removal tool..and I totally don’t need those! Oh well.
I also bought a ratcheting crimper; it should make it a little easier to crimp than what i have today. I didn’t want to buy the $300 molex crimper, and have the $40 crimper — which works when you do it right — but instead, I found a $40 ratcheting crimper to make it a little easier. I probably didn’t need this either…but it is too late! $110 extra spent on tools for the LED cyr wheel project.
In one of my last posts, I discussed power draw. In theory, 360 LEDs on each side of the wheel (720 total) might draw a ton of power (20+amps) based on the specification for the LEDs.
UPDATE: Scratch what I have below. I wasn’t measuring full on, but only half! I have two 67 length strips (about 2/5ths of my wheel on one side), and it draw 5.56amps. So yeah, about 0.04149 amps per LED, and I will have: ~330 per side, ~660 total: 27amps.
I’m going to probably have to software limit full brightness to never reach this high, as it will kill battery life, and maybe melt wires if I’m not careful. I’m starting to think about running an 18 gauge 2-wire through the wheel for power delivery. This also means I need to (again) re-think connectors. Molex Mini-Fit Jr are rated for 9amps (or 13amps with better terminals!). I think this would work, as current will be split from the battery to each half of the wheel; meaning the connector on a given side of the battery has to dish out at most half the current needed so a 13 amp max terminal. Damn..now I have to order these terminals. I’m getting the 18g and 16g ones (they say the wire needs to be 16ga to carry 13 amps).
So, I bought a 40amp 5v power supply (they are cheap) to cover my bases. I hooked up my 6meters of LEDs that I have and ran them at full white. They drew 2.72 amps. Totally way less than what it was supposed to. This is only half the wheel, so let’s say the entire wheel draws 5.5amps. That’s not much! Then I realized the LEDs were dim on the second half of the 6meters. Oh doh, they have loss when run in series. So, I could easily power each end and tested that; 4.32amp draw at full white. Significantly more power use!! I’ll probably power each segment of the 5 piece wheel separately (roughly 1.25m), which will ensure brightness, but also cause more power draw. My rainbow pattern is drawing 3.48amps at most; definitely less than full white, but still quite a bit of power.
So, I need at least two decent size batteries to make this work. Ideally 2400-3000mah. Looks like the thing that will fit in the wheel are 1400mAh turnigy nano-tech cells. I can have two on top of each other in parallel:
1400*2*7.2*.95(efficiency of converter)=19.152whrs. Let’s say 9amp total draw at 5v: 0.42hrs, or 25 minute calculated run time. Not much! But spare LiPO cells will be easy to put in, and actual run time may be better.
A monkey wrench thrown into the equation is that my connectors I bought are rated at 5amps. I spent another $20 bucks at mouser ordering 4 wire Molex MiniFit Jr connectors — they can carry 9 amps of current; in reality, I shouldn’t see more than half the total current through the wire, because the battery will be centered in the wheel and deliver power to each half of the wheel. If I have trouble with getting the full voltage to the other half, I may have to put the second battery for one half the wheel on the other side…but I’m hoping to not do that, as it would involve having two power switches (or more wiring — in which case, I should just wire it with thicker gauge wire).
I experimented with current loss over 14’6″ of 22 AWG wire; the 5.06v at the start reads 4.67v at the end, and this affects the LED brightness. I’m hoping to use 20AWG gauge wire, but I can only do it if I don’t get that large a voltage loss for half the wheel circumference (less than 10′ for me).
11.1v 1200mah Lipo battery compared to a 9.6v 1400mah NiMH 8-cell pack:
And the rainbow pattern on my LEDs:
I wear out brake pads faster than normal since I don’t have regenerative breaking or a normal “ICE” engine to slow me down. I replaced my first set of pads really quickly, but the second set seemed to be lasting a lot longer. I would keep an eye on them and see how they were doing every now and again, and a month or so ago they looked good. But today, the bug’s brakes were screaming (a crunchy metal on metal sound), and I knew something was up. The bug has also been pulling slightly to the right when braking, so I wasn’t too surprised.
The front right disc brakes looked like this:
The cheap EMPI disc brake calipers aren’t as smooth on one side, and the wear was twice as much on one pad as the other half! Of course, when I checked them, the pad with good wear was on the outside, so it was the one I could see and verified looked okay.
Doh! I replaced them tonight (I had a set on hand just in case!). The ‘ol Electric Bug has 32,170 pure EV miles.
I got about 20k miles out of those pads; I could have gotten at least 2-3k more if the wear was even.