Uncategorized

New Camera Bought with Bitcoins

I finally have my new Canon Rebel T3 that I bought with Bitcoins. I’m going to use for new product photography. I’m just waiting for the batteries to charge now. So excited!

Uncategorized

Building a Better Product Catalog

Theory

As much as I love ZenCart, it has limitations. One of the things I’ve never seen in an online shop system is an understanding of package deals. For example, I have kits that are made of parts. Every part is available (or should be available) in the store. The price of kits should change whenever I change a part price, and the quantities of parts should change whenever I sell a kit. ZenCart doesn’t understand either of these things so I’m left to do a lot of manual work. Call me lazy but I don’t like doing work if I can make the machine do it. As my good friend Steven says, “if you have to do it more than twice… automate it.” Happy 30th, Steven!

Details

So, where was I. Oh right! So I’m building a new database that has all my inventory in it. The mysql table looks a bit like this:

Field Type Null Key Default
id int(10) unsigned NO PRINULL
SKU varchar(32) NO PRINULL
next_id int(10) NO 0
prev_id int(10) NO 0
name varchar(64) NO NULL
qty float NO 0
supplier text YES NULL
weight float NO 0
description text YES NULL
MSRP float NO 0
bulk_purchase_qty float NO 0
bulk_purchase_cost float NO 0
bulk_import_fee float NO 0
unit_cost float NO 0
video varchar(128) NO
data_sheet varchar(128) NO
unit_purchase_cost float NO 0
video_quality enum(‘missing’,’poor’,’ok’,’exemplary’) NO missing
image_quality enum(‘missing’,’poor’,’ok’,’exemplary’) NO missing
description_quality enum(‘missing’,’poor’,’ok’,’exemplary’) NO missing
data_sheet_quality enum(‘missing’,’poor’,’ok’,’exemplary’) NO missing
margin float NO 0

I also have a table that describes inventory as one-parent-to-many-children. So a single inventory item can actually be made of many other inventory items.

Opportunities

– every version of every item has a unique SKU code.
– If I change a part in an inventory item completely it will assign a new SKU and adjust the prev_id and next_id. It could automatically update descriptions to say “this product has been replaced with [hot new version]” or “This is a replacement for [old and busted version]”.
– When an inventory item is updated my catalog will automatically adjust the price.
– When I make a sale of a kit that has parts it will automatically adjust the product quantity of each part. It can then list parts and kits as out of stock if necessary.
– Because I will have accurate inventory control I can predict when parts will run out and order replacements just in time. Less money sitting on the shelves waiting for someone to buy.
– The system can track who got what version of what order, and it will be a lot easier to produce a Bill Of Materials (BOM) and cross-check it before each kit is sent. It also means if someone has a problem with an older model I can track info on that version. “Oh yeah, that was a big problem in the ’38 Mark IIs – they fall right out of the sky” or “Well, I see here that minion 24 signed the papers saying this kit was OK to ship on last Tuesday. I’ll be sure to have him… corrected.”

Costs

Time. I’ve written a lot of PHP in recent years so it’s no sweat to pull together the core systems. I’ve already got a LAMP server running so that’s basically free. So far I’ve imported my old excel sheets full of inventory into the new database.

This afternoon I’m going to play with Arduino joysticks (as promised) and tomorrow I’m going to copy in all the parent > child relationships and then build logic to control what happens when and how. All the while my 3D printer is making delta robot parts and hog drives for happy customers.
Friday I have a disgusting pool to clean, Saturday I don’t know yet, and Sunday is a 5k run in my neighborhood. Some time next week the camera I bought with Bitcoins will arrive and I can start to take new product photos, at last.

The work never stops here, and I wouldn’t want it to – I’m having too much fun!

Uncategorized

Building a 6DOF Joystick: Master/Slave test

RSP Master & Slave

Following from my earlier post I got all six servos converted. Now I have two Rotary Stewart Platforms next to each other on my desk. From the outside they look pretty similar. Inside I’ve converted one set of servos by removing the PCB inside and leaving the potentiometer.

servo to sensor 1

servo to sensor 2

servo to sensor 3

servo to sensor 4

servo to sensor 5

servo to sensor 6

servo to sensor 7

servo to sensor 8

servo to sensor 9

I also removed one gear so that the potentiometers could turn freely. I call this one the Master and it’s going to be my joystick.

I read the sensors with this code.

[code language=”c”]void setup() {
Serial.begin(9600);
Serial.println("START");
}

void loop() {
int i;
for(i=0;i<6;++i) {
Serial.print(analogRead(A0+i));
Serial.print(‘\t’);
}
Serial.print(‘\n’);
delay(100);
}[/code]

When I read from the six sensors I get values like this.

[code language=”c”]379 416 488 600 396 632
269 320 355 708 347 654
273 294 309 756 348 631
338 326 311 770 348 595
396 370 381 740 348 581
445 418 580 580 380 598
428 417 644 525 471 562
429 408 532 608 540 486
410 394 394 694 543 446
447 415 349 725 497 456
424 408 276 821 372 570
357 379 352 776 320 675
224 294 438 705 321 721
93 183 337 787 321 710
131 165 244 859 320 685
297 248 163 930 320 618
351 302 177 926 320 617
364 335 332 814 321 648
359 351 553 623 360 672
306 324 609 584 434 641
306 316 589 592 532 538
319 317 501 654 531 530
429 381 484 662 531 486
500 444 581 595 535 473
580 513 711 478 655 362
609 554 738 450 707 305
619 581 747 447 707 292
618 594 744 452 707 287
604 596 729 474 708 302
592 590 722 477 706 313
588 584 728 478 708 316
589 580 727 478 706 328
589 567 725 479 708 329
590 554 727 478 706 328
588 554 728 479 708 329
589 563 727 478 706 328[/code]

Then I convert those values to PWM signals and send them back out to the second set of servos, the Slave. The physical relationship is 1:1. The wiring is slightly backwards – the pin numbers run the other way on the far side of the Arduino so I put servo 1 in digital pin 7, servo 2 in pin 8, and so on.

I’m finding as I test this that the inputs and the outputs don’t match 100%. They’re very close but in some cases input moves 90 degrees and the matching output only moves 75. A configurable scale (*k) and constant (+c) adjustment for each input should take care of that.

Tonight I read How to make an UNO appear as a joystick to your computer and Wednesday I will give it a shot. With a little luck I can get this working and play Kerbal Space Program better. I have never successfully achieved an Orbital Rendezvous and it fills me with horrible, horrible nerd shame. I’m also going to 3D print a grip so it feels more like a traditional joystick. Minecraft and Descent are also good candidate games. Animatronics, too.

Mondays are supposed to be improve the site day but for the next two days I’m shipping orders, 3D printing, and getting ready to show off the Makelangelo at Grandview Elementary right here in Vancouver.

Uncategorized

Rotary Stewart Platform Code Update, May 22 2013

Get v4.

– added RSP_Listen
– added RSP_MasterSlave
– updated RSPv1 to change pins for Arduino MEGAs
– updated Center to match pin config of other sketches

RSP_Listen is a new sketch that listens to the potentiometers from your Rotary Stewart Platform (RSP) joystick and displays them on screen.

RSP_MasterSlave uses a single Arduino to connect a RSP joystick to an RSP. When you move the joystick the slave mimics your movements. Great for animatronics.