Monday, March 18, 2024
Unwanted adventures in inverse kinematics
Given up on Marlin. I've installed straight GRBL on the RAMPS assembly and have written an amateur inverse kinematics routine in python to drive GRBL X, Y & Z as the delta towers C, B, A (which seems to be engineering convention, C being on the X axis). Once I get a bit of help, it's probably best to peel the control functions out of OpenFlexure, but their codebase is somewhat impenetrable. Suggestions welcome.
# - calculate_tower_joint_positions calculates the positions of the tower joints based on the given TCP location.
# - It utilizes inverse kinematics to determine the heights of the tower joints above the XY plane.
# - The function takes a TCP location tuple (x, y, z) as input and returns a list of tower joint heights.
def calculate_tower_joint_positions(tcp_location):
link_length = 75 # units
radius = 35 # units
# Calculate the distance from the TCP to each tower base
tower_distances = [math.sqrt((tcp_location[0] - radius * math.cos(theta))**2 + (tcp_location[1] - radius * math.sin(theta))**2) for theta in [0, 2*math.pi/3, -2*math.pi/3]]
# Calculate tower joint heights above the XY plane
tower_joint_heights = [tcp_location[2] + math.sqrt(link_length**2 - dist**2) for dist in tower_distances]
return tower_joint_heights
# Test cases
test_locations = [(0, 0, 0), (-1, 1, 0), (0, 0, 10), (0, 20, 0), (5, 0, 0), (15, 0, 10)]
for location in test_locations:
tower_joint_heights = calculate_tower_joint_positions(location)
print("TCP Location:", location)
print("Tower Joint Heights:", tower_joint_heights)
print()
Sunday, March 17, 2024
The dodgy Marlin Delta configuration took off on one tower, drove it through the bottom of the stage, and snapped the anti-backlash 'O'-ring. That's going to be a beggar to replace. I thought I'd reset the axes position to current location with an G92 command, but it looks like the delta firmware may be ignoring that. More experimentation needed with the delta towers disconnected...
Saturday, March 16, 2024
I'm starting to get some form of workbench set up here. Wide angle view of the slide, narrow angle view down the microscope (3μm/pixel), and a control panel for the Delta Stage. Still fighting the delta software and for reasons unknown the wide angle mounts the wrong way up. Will have to print a new stand for it.
Maybe I should get two and rig them to a VR headset?
And just when I had enough to do, it turns out that running 2 USB video cameras (microscopes) at the same time is ... a challenge.
[update] ENOBACON suggested using vlc, and that runs multiple copies and cameras, yay!
Friday, March 15, 2024
The probe arm now has 3 supports for proper rigidity. I've turned the acceleration of the motors down a bit and we'll see how much less wobble there is during movement.
You can see my crude attachment system for the hypodermic needle that allows me to change angles and swap tips. I will be mounting the micron tips inside hypodermic needles for support, and to allow me to bend them at angles.
Once I've got the delta software sufficiently smoothed I might try putting Sharpie on a slide and tracing a few tracks in it to see what we get. That might help with calibration later too.Yes, all this stuff is not good for accuracy. I know. However it is damned convenient for development. A "proper" prototype won't have all the bendy wirey bits.
One of the press-fit small gears on the NEMA17 motors broke loose, so I've remodelled the gear to take an M3 nut and set screw. The STL is here: https://www.printables.com/model/797699
There is no convenient program I've found that just allows one to noodle around directing the axis movement for a gcode device on a serial port without having to download umpteen packages. So I've written one in python that should be portable. Ugly as sin at the moment and I'll share it when it looks passable.
Next up is adding a third brace to the probe arm made from 12ga wire. This should dampen vibration in all axes. Delta firmware tweaks continue, trying to get sufficient accuracy with enough range on the Delta Stage.
One annoying problem is that my USB serial connection to the RAMPS board keeps dropping out. I suspect this is due to a noisy 12V power supply, so I'll swap that out.
The shadow of the probe on the slide is proving to be so useful in guidance that I'm thinking of adding an LED on the probe arm just to cast a coloured shadow.
That'll keep me busy for a while.
Thursday, March 14, 2024
I've got the Delta Stage moving vaguely coherently by swiping a lot of Marlin Configuration from the Kossel printer configuration. Quite a bit of tweaking to do, but it moves in different directions.
The main problem is visibility. The depth of focus is poor, and the ink is not sufficiently opaque. I'll work on all that. Also I'm going to need a proper microscope calibration slide.
Tuesday, March 12, 2024
While I'm waiting for help on the Marlin Delta driver, I've soldered a 12ga wire brace to the probe arm and shortened it to 85mm. This reduces twang a *lot*. I've mounted a 22ga hypodermic on a croc clip, which clips to the probe arm so I can swap tips. The current tip is bent at 60 degrees so I can sneak it all through the lens turret on the microscope and get closer to vertical contact with the slide.
I've mixed up some machine oil with soot, which approximates the consistency of photosensitive resin. I keep it in a little dish made by wrapping an M8 nut in foil and dishing one side.
A small drop on the microscope slide serves as a reservoir, and contact with the drop gives me good feedback on the probe position (may be useful later, as is seeing the probe shadow). I'm manually tracking the probe until the driver software is sorted. Anyway, this lets me dip the 40μm probe tip then move it elsewhere and touch the slide. Bear in mind the tip is elongated on a hypodermic. This dipped tip gets me several consistent dots, about 30μm in size. Here's one viewed through the microscope:
Monday, March 11, 2024
Forgot to mention the attaching the OpenFlexure Delta stage gears to a NEMA17 round shaft. Basically I warmed up the stepper shaft with a mini blowtorch and pushed the gears on. I try-fitted the motor to the Delta Stage Adaptor, added a drop of ordinary superglue, and pushed the gear into the right position. It drags the glue into the join and holds well enough for now. Probably should render something with proper inset nuts and retaining screws.
Speaking of dodgy fixings, the Delta Stage is currently on a thick piece of MDF with the microscope to isolate it from the bench bending when I lean on it (yes, that causes micron-sized movement). The microscope has a decent base, but the Delta Stage feet are slick PLA so after knocking the first one onto the floor I put some double-sided sticky tape under them. Very Heath Robinson/Rube Goldberg, but seems to work quite well.
Well there's a surprise. The μRepRap just got a mention on Hackaday https://hackaday.com/2024/03/10/%ce%bcreprap-taking-reprap-down-to-micrometer-level-manufacturing/ - if you're not familiar with it, it's an awesome site for hackers and makers so do visit. If you're from there and visiting here, please join in the fun.
The house is without reliable power at the moment though, and the place is pulled apart for rewiring putting the brakes on dev work. 9kW of solar panels going in, so not complaining.
Still having problems getting Marlin to drive the Delta configuration at all. Might revert back to driving XYZ and get on with stiffening up the probe's arm. For initial testing I'll just be using a hypodermic point until I have a reliable Delta driver that won't try to drive one of my sub-micron probe tips through the glass slide!