Uncategorized

Using Rsync for Higher Quality (Error-free) Web Design

Why

It’s always best to test your machines before you send them into the wild. All my web clients have a test copy of their website on a password protected server where they can review and approve changes. Once the changes are approved I need to be sure that they all get copied to the live server. Miss a file and things could break. I need a bullet proof way to make sure it all gets sent and I’d rather not do it by copying the entire contents of the website every time I make a change.

I’m a big believer in eating your own dog food: I test all my parts before I ship them and I only recommend technologies I have used in my own work. One of the reasons I outgrew my old web host is that they wouldn’t let me run rsync, the tool I now use with my clients. Rsync will copy files from one machine to another very efficiently. It only copies the differences in the files, saving a lot of time.

How

The basic rsync syntax is very simple.

[code language=”bash”]rsync rdz /my/dev/folder [email protected]:/remote/folder[/code]

This is a bash command that tells the linux machine “use SSH to copy the entire directory of /my/dev/folder to /remote_folder/ on remote.machine.com and log in with account_name if you need to.”

Now I put this in a bash shell script and then run it whenever I need to update the store. I have a similar script for each of my clients. Hell, I might even make it into a web-console so I don’t have to edit copies of this script. We’ll see if I do it enough times that it’s worth automating.

Uncategorized

BionicOpter: An RC Helicopter that looks like a Dragonfly

While I wait for my 3D printers to heat up I do other stuff, like discover that Festo have once again made a robot that’s so gorgeous it’s almost poetry.

Yesterday I said I finally had SSL certificates. Turns out the one I got was lower protection than I wanted you to have, so I got a refund and I started applying for the more extensive version. I hope the process will be done today at which point the blog, the forums, and the shop will all be covered. The difference between the two is that one shows up as a little lock in firefox and one shows up as a green lock with the company name beside it, meaning someone has verified I actually exist and taken out an insurance policy that your info is safe.

On another unrelated note, it seems that if you order 20 of something from China it takes 6 weeks to arrive and if you order 200 of something they ship it express. Hidden unlock bonus level speed combo!

Uncategorized

A Drawing Robot that specializes in Handwriting?

This site I found through Hackaday.com featured a robot arm made from OpenBeam and laser cut bamboo.

I totally get to brag here: I know Terence, maker of OpenBeam. He’s a great guy! Did you know the stuff is used in the Tiny, too? What a world.

Uncategorized

Service Changeover Coming May 2013

In another amazing first, Marginally Clever has outgrown our current hosting service. We’re still big fans of sprinklercity.ca for their fast turn around and painless service. Heck, a few smaller sites I run are going to stay there. Sadly, our commercial needs have outgrown their systems and we suck up a lot of bandwidth. So we’re moving to Linode. If all goes well the changeover should be completed before the end of the month. This will let us add site-wide SSL, take on new payment processors, automatically balance the load on our systems, and generally serve you better. At the same time it means I have to dust off my linux admin skills. Ah, the challenges of being successful.

Edit 2013-03-27 10:00 – Change over complete! Please let us know if you find anything broke. SSL is already working in most places.

Uncategorized

What is Wrong with this 6DOF Joystick Circuit?

I’m having trouble with a circuit for a new product. Here’s what I’ve got. Can you tell me what I’m doing wrong?

Inspiration

For years I’ve been inspired by the great work of some other makers like InnerBreedFX’s Jonny Poole. A while back he published a video of a 6DOF joystick connected to a Rotary Stewart Platform. He could control the position and motion of the stewart platform by using the joystick. I thought this was fantastic. Now that I’ve got a platform I’m trying to do the same thing. As always, with an eye towards putting it in the store later.

Theory

I build two stewart platforms and call one a joystick. I rip the guts out of the servos in the joystick so that they work as sensors. Instead of sending a PWM signal to tell a motor where to go, the Arduino now receives a reading from the potentiometer inside the joystick sensor. In the other platform everything is normal. It could be connected to the same Arduino or another somewhere else in the universe. All that matters is the signal from the joystick gets sent to the platform so that they move the same. Later I could record and playback a movement or run platform 2 over the web. Remote surgery, anyone? Tele-operated paintball turret?

Implementation

servo to sensor

Then to prototype the workings I set up this breadboard. The screw terminals on the left receive 5v2a. The Arduino and the 5v2a share a common ground (the long blue wire).

6dof joystick circuit

Pin Function
13 joystick servo 1 signal to A0
14 joystick servo 1 5v
15 joystick servo 1 GND
16 joystick servo 2 signal to A1
17 joystick servo 2 5v
18 joystick servo 2 GND
20 joystick servo 3 signal to A2
21 joystick servo 3 5v
22 joystick servo 3 GND
23 joystick servo 4 signal to A3
24 joystick servo 4 5v
25 joystick servo 4 GND
26 joystick servo 5 signal to A4
27 joystick servo 5 5v
28 joystick servo 5 GND
29 joystick servo 6 signal to A5
30 joystick servo 6 5v
31 joystick servo 6 GND
36 RSP servo 1 PWM
37 RSP servo 1 5v
38 RSP servo 1 GND
40 RSP servo 2 PWM
41 RSP servo 2 5v
42 RSP servo 2 GND
44 RSP servo 3 PWM
45 RSP servo 3 5v
46 RSP servo 3 GND
48 RSP servo 4 PWM
49 RSP servo 4 5v
50 RSP servo 4 GND
52 RSP servo 5 PWM
53 RSP servo 5 5v
54 RSP servo 5 GND
56 RSP servo 6 PWM
57 RSP servo 6 5v
58 RSP servo 6 GND

Then I write a little code on the Arduino. There are many milestones on this road. The first is to read a sensor value from a modified servo. Here’s the code to read all six at once.

[code lang=”c”]void setup() {
Serial.begin(57600);
}

void loop() {
Serial.print(analogRead(0)); Serial.print(‘\t’);
Serial.print(analogRead(1)); Serial.print(‘\t’);
Serial.print(analogRead(2)); Serial.print(‘\t’);
Serial.print(analogRead(3)); Serial.print(‘\t’);
Serial.print(analogRead(4)); Serial.print(‘\t’);
Serial.print(analogRead(5)); Serial.print(‘\n’);
delay(100);
}[/code]

Results

When I plug in the servo on pins 13-15 and open the serial window in Arduino I see this:
[code]1023 1023 998 979 957 939
1023 1023 997 974 958 937
1023 1023 1003 981 957 939
1023 1023 1014 994 971 953
1023 1023 1023 1007 987 968
1023 1023 1023 1009 986 971
1023 1023 1017 1002 979 965
1023 1023 1004 986 965 950
1023 1023 997 977 956 939
1023 1023 997 975 957 937
1023 1023 1003 982 957 941
1023 1023 1014 996 972 956
1023 1023 1022 1006 987 968
1023 1023 1022 1008 985 970
1023 1023 1016 1000 978 963
1023 1023 1004 986 964 949
1023 1023 997 976 958 939
1023 1023 998 976 956 938
1023 1023 1005 983 958 942
1023 1023 1017 999 973 958
1023 1023 1022 1006 988 969
[/code]
Each column is the value read from an analog pin on the Arduino. columns 2-5 should be random and changing because the value is floating – there’s nothing giving a signal to those pins so they’re delivering garbage data. The first column should be deliverying the signal from pin 13 – I turn the servo horn, the potentiometer changes, the value goes between 0 and 1023.

…except that isn’t happening. Turning the servo horn does nothing, it stays at 1023. I thought at I was getting full blast because the GND line for the servo was not working, forcing the electricity to follow the only remaining path. My multimeter says the GND line is fine and the solder connection looks good so I don’t think that’s it.

I don’t know if I fried the potentiometer or if I’m missing something else. Do I need pull-up resistors at each servo or something? I’m out of my depth when it comes to electrical engineering.

If you have an idea, please comment below. I’d love to learn from your electronic mastery.