<body bgcolor=#000033"><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=4830160160028833890&amp;blogName=DanShope.com&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F&amp;blogLocale=en_US&amp;homepageUrl=http%3A%2F%2Fwww.danshope.com%2Fblog%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>

Tuesday, November 24, 2009

Syncing up SolidWorks

As a man on the move who needs access to my data from many different machines, I had struggled to find a good solution to access my SolidWorks files.

The Requirements
  • Should be free or low cost (hopefully not subscription based)
  • Should synchronize files with minimal user input
  • Just works, never needs me to doctor it
I've worked with the professional solutions like Activault, but didn't need quite that level of functionality for my personal use. A subversion utility was intriguing, but generally required too much interaction (commits, updates, etc) for my general workflow.

After manually copying files onto thumb drives, remote desktop-ping, and trying to get a network drive up and running I decided enough was enough. So began a journey through several sync solutions.



Dropbox was my first solution, and worked nearly flawlessly. Updates were transparent, and I could share with other users as well as keep certain folders private. The versioning system was pretty nice and saved me some hassles a few times. I finally ran up against a few limits with the Dropbox service: storage capacity and directory limitations.

Dropbox Storage
You only get 2GB free, which is pretty sweet, but not really enough. My only other option was to purchase a subscription plan, which starts at a hefty $10 per month for 50GB. That's the same as my web hosting, which gets me unlimited storage!!

Dropbox Single Directory
One of Dropbox's most annoying limitations is the use of a single catchall folder. I wanted to retain my file structure which is a complex of files spread across multiple partitions. The more I relied on the service, the more this limitation made the service unusable. It just interrupted my workflow.



This service didn't quite get the full treatment as I was already a little jaded from my Dropbox experience. Overall it was a major step forward - I could impose my own file structure, syncing was seamless, and there were the nice versioning and web-interface features.

Syncplicity is a fantastic service, and probably cuts it for most people. It's gotten rave reviews, it just wasn't the right product for me. If you want access to more than 2 computers, you have to upgrade, again with a monthly subscription fee. It is also Windows only (for the moment)...

Which brings us to the winner,




Not quite fully cross-platform, this service allows syncing between PCs and Macs. Much like Syncplicity, you have full control over directory structure and updates occur immediately when machines are connected to the 'net.


The web interface needs a little work, but for the most part was snappy enough to keep me happy. The syncing occurs fast enough that I get versions of the little temp files (~XXX.sldprt) that SolidWorks creates while you're working. If you've just synced a large number of files and they aren't yet downloaded, double-clicking on the placeholder file will bump it up in the queue. Nicely it also alerts you when the file gets downloaded to your machine.

I found that full versioning control wasn't really necessary for my daily use. A nice trick occurs when you delete a file (this can be done from any synced machine, not just the creator). A deleted file will get moved to the recycle bin on any synced machines. This is generally enough of a safeguard to recover accidently deleted files.


End Result? Happily synced files! I've been using this for the past few days, and it's been quite amazing. I have to remind myself that I can access my files from anywhere. Best of all? It's all free!

Labels: , , , , , , ,


Wednesday, June 24, 2009

Sharp IR Rangefinders and Arduino: Make your Robot Smarter

Adding distance or proximity sensors to your robot is a great way to start exploring your environment intelligently. Rangefinders allow a non-contact method of “seeing” obstacles and can be employed in mapping and maze solving as well.

The Sharp family of infrared (IR) rangefinders is very popular amongst hobby roboticists because they are low-cost and easy to interface with (Voltage, Ground, and Signal). These hook up to a single analog input pin on the Arduino or similar microcontroller systems. There are a few caveats to watch out for though.

If your application is very time sensitive and needs tightly controlled, you’ll want to find out how long polling your sensor(s) takes. The Sharp sensors output an analog value (as a voltage), but microcontrollers only understand digital values (1 or 0), so that analog value has to be converted. Analog to digital conversion is pretty fast, but it can introduce some delays.

The sensors are also very noisy, meaning the analog output signal has a lot of "jitter" -- 20cm does not always equal 280, etc. Your code will have to account for this jitter, so you'll need to collect some real-world values to build your sensor model. This problem is exacerbated by the next issue, but can be overcome with a little bit of thought and time. I don't provide you the solution here because it's really dependent on your application. There is, however, a tool to help you evaluate your sensors (see below).

Moving on, take a look at this graph:

You’ll notice something interesting here – the graph has a weird curve and isn’t linear at all. This becomes tricky when trying to teach the robot to understand distance from the analog output of the sensor.

There are a few ways to get around this. If all you want is a simple threshold say “nothing closer than 20cm” then you can simply run a few tests with an object placed 20cm away from the sensor, and then hardcode that value into your program. Generally it’s a bit more complicated, if you want the program to understand varying distance.

Method 1:
Approach: Find a best-fit curve (generally exponential or polynomial) using a statistics package (Excel, R, Minitab)
Pros: Easy to implement, gets you started fast.
Cons: Requires floating point math, which isn’t natively supported by most microcontrollers. You can still use floating point, but it’s slow and inefficient in most cases.

Method 2:
Approach: Gather some data points and create a look up table of values. Your code will linearly interpolate values between each data point (ie, 5cm=600, 10cm=300, etc).
Pros: Uses integer math which is fast and efficient
Cons: Takes up more memory and doesn’t give exact values

Method 2 is the preferred approach as most embedded system developers take great pains to avoid floating point math. You can have some floating point math on the Arduino and be alright. I have a large (6KB) program right now that has floating point littered all over the place (it’s necessary for this code) and execution time runs just fine.

To help with gathering your data for both method 2 and simple thresholding I wrote a quick little application that interfaces with the Arduino’s serial connection. This app will pull your data in and calculate some basic statistics such as standard deviation, mean average, and range of values. You can store the data for future computation and reference.

Download the IRanalzyer at http://www.danshope.com/calton/ir.html

To use the IRanalyzer you need to send values from the Arduino. Here’s a sample sketch to get you started:


#define SerialSpeed 115200 //typical values are 9600 or 115200
#define SampFrequency 10 //sampling frequency in Hz (cycles per second)
#define AnalogPIN 0 //define your pin here

int mDelay;

void setup()
{
Serial.begin(SerialSpeed);
mDelay = 1000/SampFrequency; //calculate delay for proper sampling rate
}

void loop()
{
delay(mDelay); //delay in milliseconds
Serial.println( analogRead(AnalogPIN) ); //reads the analog port and prints value over serial
}

Labels: , , , , , , , , , , , ,


Subscribe to RSS Feed
Subscribe to DanShope.com
Who writes This Stuff?
Daniel Shope is the site owner and moderator of DanShope.com, a portal dedicated to robotics and engineering. Dan is currently a student at Carnegie Mellon University and is pursuing dual degrees in Mechanical and Biomedical engineering.

View Daniel Shope's profile on LinkedIn
Advertisements