Dave Landers

Dave’s thoughts (such as they are)

Jet 1642 EVS Remote Control

I was looking for a remote shutoff for my Jet 1642 EVS, so I could shut the lathe off without having to reach around a spinning chunk of a tree.  During my search, I saw a picture somewhere on the net where someone had simply remoted the entire control panel.  Brilliant.  It’s simple to do, and I have full control of power, direction, and speed anywhere I need it.

Materials

  • About 10’ of 5-conductor cable.  I think I went with 12 ga.  And the best cable I found had 7 wires, so a couple just didn’t get used.

  • PVC electrical box – I found a corner box for ¾” conduit that was the right size for the panel.  The screw spacing matches the panel, and it is just big enough inside for everything to fit.  You don’t use the cover.

  • PVC cable strain relief adapter.

  • PVC plug for extra hole in the back of the box (plumbing dept).  It should fit (or be modifiable to fit) from the inside.

  • Crimp-on Spade connectors – about 10 ea Male and Female.

  • Big magnet (with screw attachment) – probably in the tool dept next to pegboard and other organizers.

  • PVC pipe cement (epoxy or CA should also work if you don’t have PVC cement).

  • Some electrical tape (maybe).

  • Something to cover the hole in the headstock where the control panel is now (surely you’ve got some nice-looking scrap wood laying around that’ll do nicely).

Construction

Plug the hole in the electrical box from the inside.  Cut off the excess conduit so the back is flush.

Unplug the lathe.

Remove the control panel from the lathe headstock.  On my lathe, some of the wires had spade connectors and others wire nuts.  In either case, carefully mark which color wires go where.

Disconnect the wires and remove the panel.

Add male spade connectors to all the wires on the panel.  On my lathe, the reverse switch already used spade connectors, so I added connectors to the other three.

Feed the cable in from the back of the headstock.  I was able to get mine in the same hole with the motor control cable.

Add spade connectors to the lathe and cable wires females on the lathe side and male on the cable (so you could reattach the panel if ever you desire).  Match up the colors of the wires as best you can.  Tape any exposed bits of the connectors, if necessary.

Feed the other end of the cable thru the strain relief into the conduit box.  Add spade connectors, and attach the wires.

Secure the magnet to the back of the box. Fit all the wires in and attach the control plate to the box.

Add a plate to cover the hole in the headstock where the control panel used to be.  I just used a scrap of walnut to make one.

Now you can move the control panel anywhere you need it.  Safe and convenient access to power off and speed control.  With the control on the side of the lathe bed (shown) I can shut off the lathe with my hips (although in this position, I will sometimes lean on the speed control – which is not good, so I position it to be where I can easily hit it, but don’t lean on it while turning).  You can also put it on the top of the ways or anywhere else.

Hope that helps somebody.

Comments are off for this post

Last (hopefully) Lion issue

I was getting frequent lockups – I wasn’t sure initially what was going on, but it became apparent that it was something related to Eclipse.  While eclipse was building my projects, it would crawl to a halt (always at the same place on the same project).  Other apps would be responsive- for a while, but eventually everything would crawl to a halt.

I think the ultimate issue was actually with the Java VM.  I had two entries in my eclipse.ini: UseConcMarkSweepGC and UseCompressedOops which I had added per the ScalaIDE docs.

Once I removed these, things started behaving again.  I didn’t like using the concurrent mark and sweep algorithm anyway, as I thought the pauses were worse.  But something is certainly misbehaving in that algorithm (or in the VM as a whole) with Lion to allow it to lock up the entire machine.

It seems that the JDK available for Lion has at least changed some defaults (like the memory sizes I discovered earlier) and possibly some other things (memory/gc/hotspot-related).

Comments are off for this post

And another thing

The Lion upgrade deleted all (except one random guy) in my address book contacts.

I restored the ~/Library/Application Support/AddressBook folder from the TimeMachine backup pre-Lion and everyone is back now.

Update – No, it’s not back.  This was not Lion doing this, but iCloud.  Every time I turned on iCloud to sync Contacts, it deleted everybody (apparently preferring the empty list on iCloud to the full list on my Mac).  The solution (after many restores from backups) was:

Turn on iCloud on my iPhone (I had not done this previously).  Sync contacts from there (after a short prayer).  That did preserve my contact list (whew) and got everything up to iCloud.  Then, turning on iCloud at the Mac did sync properly.  Finally.

Apparently, this whole business of trying to make my computer work like a phone is not quite there yet – my computer is now in some ways less-capable than my phone.  At least (for now) I can still do software development on the Mac.

Comments are off for this post

Lion upgrade issues

I just upgraded my MacBook Pro to Lion yesterday – and thought I’d summarize the things I’ve found so far:

The first thing to note is that, except for some issues noted below, this was a pretty smooth upgrade.  I usually don’t like upgrades and prefer to do a clean install and reconfigure or move stuff over.  But the upgrade install itself was pretty good.

I had terrible problems with Spotlight indexing – I think mdworker crashed about 10 times yesterday trying to get through the initial indexing.  It is possible that it was colliding with Time Machine trying to backup the 9Gb or so that changed during the upgrade.  Not sure, but now that it has (eventually) finished the initial index pass, it seems OK.

I had things just plain lock up several times – usually I was trying to get my Eclipse projects refreshed and rebuilt, and maybe that was deadlocking with the Spotlight vs. Time Machine issue.  I don’t know, but it really annoyed me to reboot and have Lion reopen the very thing (Eclipse) that caused me to reboot in the first place.

Reboot (or even logout/in) should start you off clean, IMHO, not “where you left off”.  If I wanted to be where I left off, I wouldn’t have rebooted in the first place.  I should at least have an option to turn this off (globally and per-app).

I had trouble getting my work calendar (CalDAV) to sync.  I eventually fixed it by deleting all the entries for that server in Keychain.  We hit the same server for Calendar, Mail, and IM, and several of the keychain entries were accessible by Calendar, and a few of those were old – so maybe it was confused about which one to use.

Something changed in Java (other than the install location).  I have stumbled upon two issues with WebLogic Server:  First, I now need to bump up my MaxPermGen even for a basic web app to deploy – I’m now using -XX:MaxPermSize=256m (before Lion these apps were getting by with the default).  Also, WLS is now not happy with Lion’s IPv6, and won’t bind to any port unless I specify a v4 listen-address (127.0.0.1).

I don’t really want my laptop to look/act like my phone.  That’s probably why I don’t like the new look in Mail.  So it’s Classic layout (under Prefs -> Viewing), and View -> Show Mailbox List.  Then, System Prefs -> General -> Sidebar icon size to Small so my mail folders (yes, I’m old-school and still use folders for mail organization) fit in the window.

I do think I might like Launchpad – although it could sure use some tooling to help make the configuration better.  But I finally think I got it usable enough to trim down my Dock.  A couple of hints:

  • You can drag an app from Finder onto the Launchpad icon (in Dock) to add an app (outside of the Application folders) to the Launchpad.   I got Eclipse.app into Launchpad like this.
  • You can bind Launchpad to a key shortcut in Sys Preferences -> Keyboard -> Shortcuts -> Launchpad.  Check Show Launchpad and enter a shortcut.  I went with Command-F12.
  • There doesn’t seem to be a (good) way to remove icons from Launchpad, and it’s pretty cluttered with everything.  So I made several groups/folders (whatever they’re called) to hide the junk, and tossed them on the last page.

The biggest surprise for me is that I am almost used to the upside-down scrolling thing.  I thought I’d hate it, but it seems like it might be ok.

Comments are off for this post

Network Location Switching

Been quite a long time since my last post, and I am not going to try to catch things up.  But I did want to archive this information:

At work, we have an http proxy – an idea from the 18th century it seems.  So I have to have two Network  Locations (one for normal configurations, another for the work proxy).  We also use Cisco AnyConnect VPN to connect from home.

I had been using MarcoPolo for switching locations.  This worked great for home and work, but I wasn’t happy with how it worked with the VPN.  All I could do was detect if the VPN application was running or not – so I couldn’t leave the VPN app open and connect/disconnect.  Also, the process was to launch the VPN app, wait for MarcoPolo to switch the network to VPN, make sure it was stable (not switching back and forth), and then connect to the VPN. Disconnecting has to be followed by exiting the VPN else MarcoPolo wouldn’t switch things back to my no-proxy Location.

I took inspiration from this and created a LaunchAgent and a simple script to switch Network Locations.

The LaunchAgent plist file goes in ~/Library/LaunchAgents/com.srednal.netswitch.plist, and looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.srednal.netswitch</string>
        <key>EnableGlobbing</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
            <string>~/bin/netswitch</string>
        </array>
        <key>WatchPaths</key>
        <array>
            <string>/Library/Preferences/SystemConfiguration</string>
        </array>
    </dict>
</plist>

The script, in ~/bin/netswitch, is something like this (names and addresses may have been changed):

#!/usr/bin/env ruby
# Test network and switch locations based on vpn and ip address
require 'ipaddr'

# see if VPN is connected
def vpn?
    connected = false
    IO.popen( '/opt/cisco/vpn/bin/vpn status' ) do |out|
        out.each do |line|
            connected = true if line =~ />> state: Connected/
        end
    end
    connected
end

# are we on work network?
def work?
    # Work IP will be within  10.345.678.00/24 - obviously this is something you need to tweak
    work = IPAddr.new('10.345.678.00/24')
    work.include?(local_ip)
end

# lookup local ip addr
def local_ip
  orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true  # turn off reverse DNS resolution temporarily
  UDPSocket.open do |s|
    s.connect '74.125.45.99', 1  # IP is anything
    s.addr.last
  end
ensure
  Socket.do_not_reverse_lookup = orig
end

# set network location config
def location(name)
    system "/usr/sbin/scselect '#{name}'"
end

if __FILE__ == $0
  # let things settle down
  sleep 2
  if (vpn? || work?) then
    location 'Proxy'
  else
    location 'Automatic'
  end
end

The script can be run manually to test things.  Then load the launch agent with launchctl load ~/Library/LaunchAgents/com.srednal.netswitch.plist.

After I got that working, I went into the Info.plist file of the AnyConnect client app, and added (to the dict element)

<key>LSUIElement</key>
<string>1</string>

That makes the Dock icon go away (but leaves the icon in the status bar), so now I can leave the AnyConnect client running and just connect/disconnect as needed – the LaunchAgent and script keep my network location set right.

1 comment

Next Page »