Enduro Computer Project

WAIT!  Before you start reading and get disappointed, this is my research blog.  At this point, there is no enduro computer, it's not finished.  If fact, I'm still roughing out the design.  It may never get finished.  And, it's low priority for me.  I'm starting this now because I'm having to work through some technical issues and maybe somebody else might find my notes useful.  That's all.

Current status: Pre-Alpha, just planning at this point.

The plan: To set up a 2.4" TFT LCD display shield on an Arduino Uno with a Hall Effect sensor and some code and mount it on the handlebar of my Dirtbike for enduro racing.  Total cost should be in the $20 range (and that's probably overestimating).

So, I picked up a 2.4" TFT-LCD touch-screen from Ebay.  Absurdly cheap, in the $5 range.  It's an Arduino shield for an Uno, and it leaves enough pins for me to run a hall effect sensor, which I'll just salvage from a bicycle speedo (another stupid-cheap Ebay purchase).

Problem 1: Drivers for the TFT-LCD.  It appears there are a great many variants of these shields available, and very few come with any kind of documentation or libraries.  Most happen to have "www.mcufriend.com" printed on the PCB, so that means very little.  That website is in Chinese.

Most of the available drivers I tried for this just left a white screen, though the serial output seemed to work.  I did find one, SWTFT, that mostly works.  I can run the tftpaint example, except there is a white bar down the side.  Running the graphicstest example show that it is trying to write under that white bar, and it is trying to write with a backwards font.

Solution 1: The key is to identify which control chip you have and then get matching drivers.  Identify your chip with a utility found here.  Open the Serial Monitor in the Arduino IDE to see the information.

Solution 1a: My TFT-LCD shield uses the '4535' chip.  I found libraries for it at:  Cee'z Blog.  If you use his libraries then buy him a cup of Coffee, I did.  It's worth it.  Everything worked great with Cee'z libraries and example sketches, except the touchscreen was backwards.  No problem though... just run his example calibration sketch and copy the resulting numbers into the config section of the sketch you want to run.  Yes, the "min's" end up being bigger than the "max's" but everything's good after that.

The 'calculator' utility makes for a great example to work from.  Next thing is to figure out how I want the main display to look, and maybe a few sub-displays.

Problem 2:  Using the shield on an Arduino Uno seems to use all the pins.  I've read that A2 is not used, but my shield has a label for that pin (LCD_RS) and not using that pin (bending it out of the way... hey, it's a $5 shield) leaves a white screen.  The Ebay seller states that "you can use digital pins 2, 3 and analog 4 and 5. Pin 12 is available if not using the micro." Some of those pins are labelled. It will not work with D2 and D3 bent out of contact, so the seller's information is not correct either.

Solution 2: The D0/D1 (RX/TX) pins are not labelled on the shield, bending them out of the way left the display still working fine, along with the touch screen, but I've not yet determined if they're needed for the SDcard.  A5 (not labelled) does not seem to be used either.  A4 is labelled as the LCD_RST (reset?) and while it will work bent out of the way, I'm not sure if the library is writing to it or not.  Of course, switching to a MEGA, instead of an Uno, gives a lot of useful pins... but also left a white screen.

Solution 2a:  Using the MEGA is actually fairly simple.  Just edit LGDP4535.cpp (in Cee'z library), commenting out the Uno line and uncommenting the MEGA line.  '//' means this is a comment.
This says to use a MEGA instead:
#include "mega_24_shield.h"
//#include "uno_24_shield.h"
Don't forget to switch back if you want to use an Uno.

Background:  Enduros, for those that don't know, are races where the object is to travel at a set average speed rather than as fast as you can.  The trick to winning them is, however, not just riding at that speed but rather as fast as you can at the start of a section, then guessing how far to the next check, and then calculating what time it should be when you get there.  Parts of the section are typically very difficult to maintain the correct speed while other parts are easy.  Thus, there is a lot of guesswork involved, and math at the same time.  It's pretty easy to figure out how far you should have gone in 15 minutes if the speed is 20km/h:  20km/h * 1/4h = 5km.  Figuring that out for a speed of 17km/h over 10 minutes: 17km * 1/6h... not so easy when you're crashing through the bush and scrabbling over rocks and roots at speed.  Yeah, people actually pay to do that.  Crazy people anyway.  Even crazier ones pay big money for a handlebar mounted computer to do the math for them.  Then, there's cheap and crazy people like me that set out to build their own.

The Interface:  There are a lot of different ways to present the needed information but what I think I want for the main display is simply +/-Minutes, as big as I can make them.  Negative minutes means I'm ahead of where I should be and have some slack.  Positive minutes means I need to run WFO and catch up.  It will have 2 on-screen buttons:  Error and Check.  'Error' means I've missed a turn, happens a lot in enduros, and need to subtract some distance while I get back to the marked trail.  'Check' marks the clock, displays my results, resets the minutes without resetting the seconds, and lets me set the speed for the next section.

More later...


Turning the End of a Big Bar

Say you need to turn the end of a bar that is too big to go through the lathe headstock and too long to fit between centers (or the center-rest if you have one)...

Here are some answers:

Arcane suggests:  If you have a milling vise setup that attaches to the cross slide for your lathe and a boring head with a MT3 taper, clamp the shaft in the vise, center it on the spindle and then use the boring head to reduce the end.

Dan suggests:  There was someone who did an interesting trick. They welded a smaller piece to the end and chucked it up. Supported the far end in a steady rest. Then they turned down the original bar and parted it. Rotate and repeat.

Better yet, just start with stock longer than required an part off the chucked bit.

My idea, specific to my 3in1 machine:
Using something of suitable height, like the angle table (level, just for the height), make a vertical clamp that hangs outboard the lathe.  Swing the head over to match and lock down, then use the X/Y to center.  Once centered, use the boring head as above, with the cutter pointing inward.  This would give me about 4' of length, and it would be easier to set up than removing the tailstock to use the lathe spindle.


Making SS Springs

Interesting post on HSM by Dorn:

Using annealed stainless steel wire (aka safety wire) that is not springy in this state, it can be work-hardened by stretching.  Once work-hardened, it can be wound into a spring.

Rich added:

I also use a "Drawing" technique when I want smaller wire for a model or repair application.  I open my vise about 4 or 5 inches and then wrap the wire around the jaws ( 2-3 wraps ).  Now I open the jaws more and draw the wire down to a smaller size with out having the use my legs or arms, only the vise leadscrew.

Never tried it... but it's something to keep in mind for when that someday comes along.


My Linux for Kids Notes

This is not a "how to" guide, a definitive list, nor even a recommendation for what to do for your kid. It's simply my notes. I needed to keep them somewhere, I needed a place where I could update them easily, and I wanted it "in the cloud" so I could always find it. Oddly enough, a blog is actually a good place to do this. I don't mind sharing my notes and if you find them useful... good for you. If you have some other recommendations, feel free to comment.

I'll be updating this as I go...

The list of linux apps I install, suitable for cut and paste into a sudo apt-get install command for a debian-based linux distro, because that's how I do it:

sudo apt-get install gcompris tuxpaint tuxpaint-config tuxmath tuxtype ktuberling stopmotion playonlinux extremetuxracer neverputt pingus funnyboat pysiogame stellarium stellarium-data supertuxkart sugar connectagram

Via playonlinux, install:
  1. 3d train studio - downloads free version via script. Pretty awesome for kids that like trains.
    - 20 trains (running) is a fun one to download. 
What each app is:
  1. gcompris - a big bundle of kids games, puzzles, and educational activities. Highly recommended. 
  2. tuxpaint - awesome painting program with lots of stamps. The config allows various settings. 
  3. tuxmath - still seeing if my kid likes it. 
  4. tuxtype - my kid loves this typing tutor, from about 1yr old. Seriously. 
  5. ktuberling - Mr Potato Head goes cyberspace. 
  6. stopmotion - makes stopmotion - still testing this one 
  7. playonlinux - scripts to install many Windows apps under wine. Most, but not all, require the CD 
  8. extremetuxtracer - 3D racing game, with Tux sliding down a ski slope. 
  9. neverputt - a minigolf game 
  10. pingus - a funny game for kids that like penguins, and what kid doesn't? 
  11. funnyboat - great kids game. 
  12. pysiogame - another educational game suite like gcompris, slightly more advanced. 
  13. stellarium - study the planets and stars. 
  14. supertuxkart - 3D racing game in go-karts. 
  15. sugar - the One Laptop Per Child OS.  Still experimenting.
  16. connectagram - word de-scramble game.

Other stuff to remember:
* Celestia - no current install candidate.


Flexture Clamps

Idea from a Dan Gelbart video (Building Prototypes, part 13):

If you want to clamp something, cut a slot near it, then drill in the middle of the slot, then tap the hole for a pipe thread.  When threading in a plug, the taper will expand the slot, which will move the metal to clamp the part.


New Directions

So, I've decided to start a new experiment.  I like reading about workshop tips and tricks, 'kinks' as they used to be called, and I've read a lot of them.  So many, in fact, that I don't remember anywhere near half... seems the good ideas spill out faster than I put them in these days.  I'm forgetting so many it's starting to bother me.  Thus, I've decided to write them down. 

After some consideration I came up with a basic criteria list: I want the ideas to be easy to enter, I want them accessible from any web browser, I want them to be backed up to the cloud, and want to be able to put in tags for easy searching.  From that, and considering that I don't really care if anyone else makes use of them, a blog seems about the right tool.

Thus, hopefully as long as I can keep learning, I'm going to be putting tips and tricks in this blog.  They generally aren't mine, and I'll try to cite where I can.  If anyone find them useful, so much the better.  I don't mind sharing my aggregation efforts.


KingSing S2 Review and Notes

So, I bought a new phone, a KingSing S2 to be precise. What follows is a living document that covers my impressions and the lessons I've learned with it on the way. I am not a smartphone/tablet expert and this is not intended to be a serious review of all this phones' features. I wrote (and will continue to update) this as a form of documentation for myself and I thought sharing it might be useful to others.

Basic specs: 5" screen (960 x 540), quad-core 1.3Ghz, 1GB RAM, 8GB ROM, dual-SIM, dual-camera (8Mpixel back with AF), GPS, Bluetooth, magnetic compass, and proximity sensor. It runs Android KitKat. It's primary claims to fame are a skinny bevel around the screen and back-mounted buttons with nothing on the sides.

I bought it from DealsMachine.com for a little under $100 USD (plus shipping). In the box there was the phone, battery, usb cable, 2 screen protectors (one mounted), a European-plug USB charger, and an NA to European adaptor.  The mounted screen protector does have one small spot of debris under it, but it's probably better than I could do myself.  At this point, I'm not worrying about it.

Side by side with my old 5" phone is a bit odd... Because of the reduced bevel, the new one is smaller overall than the old one, but somehow it looks bigger. It's a strange optical effect, hard to describe, but I like it.  The camera seems decent, the screen looks good and is responsive.  I like that the 3 soft-buttons are off-screen and not lit. That makes it better for using as a night-clock when charging as it gets reasonably dim.

The first problem I ran into was with the reduced bevel.  I found it hard to hold the phone without accidentally touching the screen edge.  This thing needs some kind of case and it doesn't come with one.  As DealsMachine typically throws in silly "free gifts" with purchases, I had chosen a case, knowing full well that it wouldn't fit.  But, by ripping out the plastic retainer, cutting a bigger window in the back, and using double-sided tape to stick it to the back of the KingSing, it fit well enough.  Good enough for my sense of aesthetics anyway.  It works surprisingly well as a stand too.  One problem solved, two if you count the stand.

The next problem was the compass, which basically didn't work at all.  After some googling, I found the "secret" calibration routine that settled it down.  Basically, you just turn the compass on and wave the phone around in figure-8s.  Yeah, that's it.  Yeah, it works.  Second problem solved.

Next up was horrible GPS reception.  It just would not get a lock and I was beginning to think it was broken.  But, it finally did, after leaving it searching overnight while on the charger, and it seems okay now.  Actually, what I've taken to doing is leaving it in tracking mode (I use Orux Maps) and I've been surprised at how much of my daily travels are being accurately recorded, even without pulling the KingSing out of my pocket.  Leaving tracking on doesn't seem to impact battery life that much either.  So, that's another problem solved.

Battery life is not all that great, but not bad either.  Using it as a tablet, running the screen and playing with apps, seems to kill the battery fast.  I really noticed this in the beginning while messing about setting things up.  The last 15% goes very quickly.  But, in my regular daily use, I'm still left with around 50% charge at the end of the day, which is a little worse than the last phone, but acceptable.

One other thing against this phone is that the radios seem to be less sensitive than most.  In side-by-side comparisons, it shows less cell radio strength, less wifi sites to connect to, and reduced GPS signals.  They all work, but not as good as my last phone, nor some others I've had.  Not much can be done about that.

I tossed in my pay-as-you-go SIM and it works fine.  It also happily plays with my CallCentric VOIP account using the CsipSimple app.  That gives me 2cent/min outgoing calls when I'm in a wifi area.  I only do voice over cell, as I'm too cheap to pay for a data plan, so I can't vouch for how the KingSing supports the 3G stuff. 

It does come nicely loaded with crap-ware but Google play is there and works.  It also allows installing F-droid for easy access to opensource apps.  I was having issues with unwanted and unaccepted apps suddenly appearing on the phone, Baidu Browser among them, and uninstalling them didn't help.  They just reappeared in a few hours, getting pushed by some unknown force.  By long-pressing the status message and then hitting the App Info button, I learned that the offending app was "Galaxy S5" and disabling that seems to have cleared up this issue, for now.  I've also disabled playApp and Bluego Apps.

The Gallery app is crashing on me now... not sure why but I don't care as I prefer QuickPic anyway.  Google Maps, after an update, is now crashing as well.  That's a little more annoying.  Uninstalling the update seems to have cured that.  Oh, and the stock camera app was locking up as well, possibly due to a gallery link.  I'm now using OpenCamera and quite like it.

I'm still getting used to the back-button thing, and find myself relying on the screen double-tap much more.  I do like the air-wave to transition between pages, mostly because it eliminates accidentally starting an app while swiping.

Overall, I'm happy with it.  It's a lot of phone for the money.  This is my second China-phone, my third order from DealsMachine (used to be called AhappyDeal), and I've yet to be disappointed.  I am realistic in my expectations though...  I'm not expecting a $600 phone for $100.  I'd just rather pay $100 for a decent but cheap unlocked phone with no contracts and then upgrade every year.


The battery died... and there is no available replacement, none.  Being the kind of guy I am, I started looking into making this thing a DRO (Digital ReadOut) head for my lathe... but it doesn't seem to do bluetooth properly.  I noticed the bluetooth was a bit weird while trying to attach a smart watch.  Thought it was the watch at the time, but it seems the KingSing has issues.  Oh well, I bought another smartphone with similar specs for $50. New review coming soon.


Hal 9000 will turn 16 soon, will he drive?

Something silly just occurred to me...

In "2001: A Space Odyssey", the ship was run by a computer called HAL 9000.  HAL, they said, was "born" in 1997, January 12th to be precise.   Yes, I'm one of those geeks that celebrates HAL's birthday.  So, HAL's 16th birthday is coming up.  Time to get a drivers license?

Yes, a fictitious computer in an old film that really has nothing to do with driving, except for the minor fact that autonomous cars are on the prowl.  Those cars, or rather their computer drivers, are pretty much at the "time to get a driver's license" stage, coincidentally.

Yes, it's not really a drivers license but rather the long, slow process of changing laws to deal with silly things like cars that drive themselves.  But, semantics aside, it really is time for HAL (or his cousins) to hit the road.  Somehow, even considering HAL's villain status, I find that more comforting than the idea of the kid down the street getting his license.  After all, I remember what I did on the road back when I was 16.


NSA Was Here

what else can you say?