Monday, June 24, 2019

Drone Buddy Gimbal Controller


I decided to pull my drone out of the void. Since getting my 3-axis camera gimbal tuned and stable, it was destined to be mounted to the 5-foot, 8 propeller behemoth. Long story short, the landing gear was purchased and the mounting plate was custom made to connect it all together. Here's a photo with a test acrylic mount plate:

The acrylic plate is that white piece at the base of the landing gear pivot. I then landed on it and everything toppled over when it broke. I suspected this might happen. I learned nothing.









The pant/tilt movements of the camera and the landing gear retract were paired to the controller. This is great for multitaskers, because there's nothing more fun than steering a brick while trying to fiddle with a camera. I can only assume the GPS will give out when I least suspect it, and I'll need full control over a safe landing.

Queue coworker: "You should get another remote for the camera and we can fly that thing."

That's great, but I'm not going to buy a second remote. That's too easy and I still learn nothing. For the record, that would be the best and most professional method to deal with this problem.

Anyways here's what I'm doing.









After a few iterations, I made (3D print, laser, Plasti Dip, etc) a nice little remote. It has an Ethernet port on the back that will interface with the 16 channel Taranis RC remote, allowing control by two people with the same transmitter. It will pan/tilt the camera, allow roll control, reset the gimbal, and enable/disable the gimbal motors. This way I don't have to land in order to fix resonant jitter issues. There's an extra potentiometer for expand-ability but mostly symmetry.

I've done all the recon and found the pots I'm using work well with the RC remote, it just needs a change in wiring harness to facilitate this. The drone will have a second receiver to accommodate the added channels for resetting the gimbal and roll control, which leads to the sane conclusion of just get a second remote and don't risk making a mess of things. But we're all about learning on this blog.



Shout out to Vetco of Bellevue for the JST PH connectors. They're not free but hey they exist.Stay tuned...


Tuesday, May 14, 2019

Totoro Mahjong Box


For some reason these nice Mahjong tiles come in a decomposing vinyl box, which smells horrific. So for my friend Hanh, we have a laser cut and etched box with trays, displaying iconic scenes from "My Neighbor Totoro". The build photos are somewhere, or nowhere (deleted?), but here's the final product.

Not seen: the center tray was the last to cut, since it went through about three iterations. It was too thick at times, and unlike the vinyl predecessor, this wooden case has exact dimensions to prevent rattling around.


All large surfaces, except for the backside of the lid, have rasterized images that were edited to look good when lasered. The lid tile design was part of the Totoro image, so it took the longest to etch. To lessen the processing time, I ran some tests at different settings to find the best quality to speed ratio. Once finished, I gave everything a good power sanding to make the wood less grippy, followed by a light spray of matte acrylic to reduce moisture damage in the future. The trays have holes for pushing tiles out, otherwise you'd have to dump them all over. I purchased the fake leather handle and matched the thin center tray with laser cut fake leather handles with golden thread accents. Oh here, I found an image:

 

Special thanks to Loi for taking photos of the box.

One more...


Sunday, February 10, 2019

Plotter Attachment for Laser Cutter

Long story short, I had an old inkjet printer. I've seen some DIY plotter machines made from old printers, so I thought, why not? how hard could it be

Data warning: ~76MB in GIFs on this post.

 Turns out, there's a reason to keep the old gantry inside the original printer case. The paper feeder can be out of alignment to the rollers, and it causes the paper to shift as it goes back and forth. Even well made plotters can suffer from alignment issues. Let's start with the first design: 


It's basically an enclosure for all the electronics and rolling mechanics. This took several iterations before I had all the dimensions where I wanted them. When I was happy, I started making the wood version.


 Partially assembled, I added the printer gantry. The electronics worked with the open source software I found (some GRBL controller for Arduino). Confident it would work, I put a piece of paper in. The result was paper that would rotate slightly with each back and forth movement. I thought a slight design change would fix it, but I also knew this would always be a problem, no matter how fine I tune it.


So, it sank into the swamp.

I decided a standalone plotter was too much effort, since my laser cutter already has an XY transit system I could use. After some fiddling around, I found some pins on the control board that indicates the laser firing, even when the laser power is off. This was my trigger for a solenoid. The idea was to use maybe one or two transistors, a relay, and some passive components for the entire system.


I didn't like how oddball the device was looking. It was unpredictable, sometimes the solenoid would get stuck, it was wobbly in places, got hot real fast. Sank into the swamp.

Next version involved the same nozzle clamp system as the last, but that's the only similarity besides the red color. It's Arduino controlled, so I can set exactly how far it moves, how much power it's getting, when it triggers, all the good stuff. 


The only problem is the device was also wobbly; the only thing keeping it level was the drive screw. At slow speeds it was alright. Unfortunately, I have aspirations, so this too sank into the swamp.

There was another...

This final version was designed to be much beefier. I added rails to keep the whole system rock solid, while adding features that didn't impact stability. This one has it all. It's got a rotating head that can be adjusted for calligraphy pens or simply drawing with a slanted pencil. I've also added a set of rails so the tool can sit on top of the material, not be forced to puncture it. This way I can roughly set the height of the tool, and it'll still work just fine. 


Here's a test of the up/down action, tripped by the laser trigger. All the electronics were in the design phase, so breadboard and Arduino 2560 still in the picture.

 Here's the final shape based on my redesign. Nice big knob for changing out tools. I'd like to say the hardware cost $3, but this is Seattle. Each of those two collars by the motor cost over $3 each. Total of about $25, not including the motor and hardware I already had. No idea where everyone is getting their $3 hardware from, but I guess I'm supporting my local businesses this way.
 

Shot of the attachment on the laser.


I have a bag of blank through-hole circuit boards, so I designed the electronics around that. Using an Adafruit Metro Mini as the brains and a Pololu stepper driver for the brawn.


Solder traces are not fun with a blunt tip. 


 Here's how I tied everything into the exiting circuitry of the laser. The power supply gives 24 volts and about 2.5 amps. I figured it could spare an extra half amp. Worst case, I know where to find a new one. The TTL trigger from the M2 Nano board needed a 100,000 ohm resistor to block any rouge signals. The 5v for the logic was supplied with a small transformer I installed to the right of the power line filter, out of frame. I can tap into that if I add anything else later on. The custom board is currently mounted neatly next to the power supply. Paired wires are twisted and hidden within the rail. I promise it doesn't look this messy right now.


After painstakingly threading all the wires through the drag chains, I added a connector for quickly releasing the plotter attachment. I'll have to add a switch for deactivating the electronics when not in use. Everything works. I'll want to avoid drawings where the stepper is moving constantly because of heat issues, but I can always run it slower. There's a "test" button I can use to raise the pen higher than during normal operation, so I can change out tooling easily.


"But the fourth one stayed up. And that’s what you’re going to get, Son, the strongest castle in all of England."
          -King of Swamp Castle


Weird code for reference:


const int testPin = 7;
const int limitPin = 6;
const int inputPin = 5;
const int motordir = 3;
const int motorstep = 4;
const int motoroff = 10;

int test = LOW;
int limit = LOW;
int input = LOW;

int var_busyup = 0; //busy 1 or idle 0
int var_busydown = 0; //busy 1 or idle 0
int var_direction = 0; //down 0 or up 1 direction
int var_running = 0; //indicates that it's in running mode, for when listening to the input
int var_updistance = 0; //variable to control the up travel distance depending on mode


void setup() {

pinMode(testPin, INPUT);
pinMode(limitPin, INPUT);
pinMode(inputPin, INPUT);
pinMode(motordir, OUTPUT);
pinMode(motorstep, OUTPUT);
pinMode(motoroff, OUTPUT);

digitalWrite(motoroff, HIGH);

delay(1000);
}

void loop() {
 
test = digitalRead(testPin);
limit = digitalRead(limitPin);
input = digitalRead(inputPin);


digitalWrite(motoroff, HIGH);

if (input == LOW){
  var_running = 1;
}

if (test == HIGH){
  var_running = 0;
}

if (((test == HIGH) && (limit == LOW) && (var_busyup == 0)) || ((input == LOW) && (limit == LOW) && (var_running == 1) && (var_busyup == 0))){
  var_busydown = 1;
  for (int x = 0; x <= 150; x++){
    digitalWrite(motoroff, LOW);
    delay(1);
    digitalWrite(motordir, LOW);
    digitalWrite(motorstep, HIGH);
    delay(5);
    digitalWrite(motorstep,LOW);
    limit = digitalRead(limitPin);
    digitalWrite(motoroff, HIGH);
    if (limit == HIGH){
      break;
      }
    } 
  }
var_busyup = 0;
limit = digitalRead(limitPin);
input = digitalRead(inputPin);

if (((test == HIGH) && (limit == HIGH) && (var_busydown == 0)) || ((input == HIGH) && (limit == HIGH) && (var_busydown == 0) && (var_running == 1))){
  var_busyup = 1;
  if (var_running == 1){
    var_updistance = 10;
  }
  if (var_running == 0){
    var_updistance = 90;
  }
  digitalWrite(motoroff, LOW);
  for (int y =0; y <= var_updistance; y++){
    digitalWrite(motoroff, LOW);
    delay(1);
    digitalWrite(motordir, HIGH);
    digitalWrite(motorstep, HIGH);
    delay(5);
    digitalWrite(motorstep,LOW);
    test = digitalRead(testPin);
    input = digitalRead(inputPin);
    digitalWrite(motoroff, HIGH);
    if (input == LOW){
      break;
    }
  }
}

var_busydown = 0;


}

Tuesday, January 22, 2019

Laser Dump and a Print

The laser made easy work of Christmas gifts for family and friends. These first ones have the family crest engraved on some glasses. You can see the super sculpey being put to good use, propping up the glass. The design was etched using a low power setting, rasterizing each line. The curvature wasn't too bad, so I didn't have to use the rotary axis for these. Just had to make sure they were perpendicular to the laser travel and level-ish. Pro tip, etching glass with a laser doesn't give off smoke, but it's important to keep the ventilation system running to suck up those microscopic glass particles. 



Here are a couple white elephant coasters for the gift exchange with friends. My partner helped draw the geometric shapes, while I finished it off in Inkscape to create the negative space for Totoro. The eyes, nose, and belly pattern were rasterized, the rest vectors for speed. It's difficult to clean out the tiny charred gaps with alcohol, but a coating of matte acrylic helps cover it up and prevent moisture from damaging the wood when in use.


 Some Alien themed coasters for my brothers. The middle one is actually Ripley holding Jones, the cat. Didn't turn out very well. Rasterizing these things always takes way too much time.


Got to use the rotary axis on a glass soda water bottle. The glass is full of distortions, which means the design is difficult to see. I also found out the motor was wired backward, causing the design to flip. Fortunately with this design, you can't tell. I've since fixed the issue. You can see how easy it is to set up. Just plug in and flip the switch. I'm currently building a plotter attachment that will involve more holes in the side of the case. 



Tiny antlion guard from Half-life 2, about 1.5 inches tall and painted. Printed this with my new Wanhao D7. It's quite different than the Pegasus Touch, but I've learned the quirks. Like, using the supplied flash drive is a bad idea and freezes the print mid way, and using a power line filter and ferrite cores are important so turning on the laundry machines don't crash a print. Kinda important. This is exactly why I want an oscilloscope, to confirm I'm not crazy. Love the printer though.