I’ve just been like trying to get this stupid project to work. Screws keep falling out, the IK keeps failing, things are hitting each other and wires are being strained
I’m in integration hell. Everything works fine on its own, but combining everything is horrible. I’ve been reassembling and trying to fix this stupid thing for so long.
Anyway I’ve went through a few more revisions of some CAD and some more refinements and the gripper and camera is now mounted but this is just incredibly incredibly annoying :((((
An encoder magnet broke off, so I had to disassemble and reassemble the top half of the arm to get to the encoder magnet and glue it back on.
I also started properly punching in the IK joint data, before it was mostly just random data but now almost all of the data is mostly correct, and I’m waiting for a print to complete that will flip a motor to finally get the IK simulation matching with real life and have the IK endpoint be tracked at the tip of the gripper. It was a lot of trial and error and measurements.
I also started experimenting with adding depth estimation. Eventually this could add collision avoidance IK pathfinding, which would be really cool but it’s just a pointcloud in the render right now.
But the robot arm is slowly coming together finally! I’ll be able to grab something soon I think.
I assembled the new full arm assembly minus the end effector and didn’t plug in the first two motors as they have the highest chance of doing something really bad. I also made some general changes to the code and also added a flag to some motors to interpolate their movement slowly to not explode the robot arm while controlling it.
The motor code was getting a bit messy, so I rewrote it. I separated the motor code from the main control code which cleaned it up a bit.
I’m using LADRC now. It’s kind of like PID, but advanced. I took the implementation from online.
I feed it the motor current, encoder value, and the target and it goes. The algorithm or whatever somehow calculates the velocity of the motor and how much “effort” it’s using and then gives an effort to put to the motor. It somehow cancels out like disturbances like gravity, backlash, the general physics, etc.
As you can see, the motor control is so so so much better than before. It cleanly decelerates. It handles load and dynamically increases effort. Before there was some oscillation because it just couldn’t figure out how to get to the target, this one is just so much better and so hands off. There’s basically like no calibration as it does it over time :)))
HOLIWISS ,I’m back again with an update. I’ve installed some of the hardware: a Raspberry Pi 3B+ and its camera module, along with servos for movement and some yellow TT motors BYEEEE.
I assembled the MG996R servos in a test piece that will represent the full regular arm segment to test if everything worked.
With some fiddling it worked. As you can see there’s more transparent pieces. The pieces that connect the previous joint are transparent to show the Neopixel below it a lot better as before the LED was almost completely occluded. The bright green LEDs power status ones are too bright but I can cover them later.
I’ve just been refining everything and it’s just going really slowly. Many problems. Magnets shorting out stuff. Magnet too far and not being detected. Wires breaking.
I’ve also redesigned the dashboard UI to hopefully look better. I’m still working on it, hopefully it will look more polished later.
It shows a load speedometer type thing, with the load (max current from a motor out of 500mA) and the temp on the right (for now just dummy value)
The motors have cool little animations now too and look less cluttered.
I’ve just been working on it a lot. Just everything in general tbh.
I have spent SO many hours trying to get this to work. It’s so annoying. This isn’t near how many hours I spent, I’ve been too frustrated to log it.
The case is incredibly annoying. Getting the initial case works fine. Doing all of this stuff makes it complicated and break and jam up.
The RS485 busses just randomly stop working.
The servo output is wiggly and not stable.
A PCB header snapped and I didn’t have replacements so I had to bodge solder it back on.
The mainboard voltage regulator literally exploded. It was a cheap part but yeah that literally just broke stuff.
Fixes to everything. CAD. Firmware. bruh
The servos finally work. I don’t even think this amount of hours logged is equal to how long this took, because I just got tired of it.
I think I printed like 20 new revisions of the case and servo mount. It was just so so annoying. While the general case worked, getting a reliable magnet output shaft was impossible. From tolerances, to my own errors to binding to hot glue getting everywhere, or superglue binding random gears, or my getting my fingers stuck to the actual case from superglue (was not fun and hurt)
The case finally works.
And the prototype code somewhat works too. It basically rotates until the sensor hits zero, it resets the “ticks”. A tick is a raw output from the AS5600. Because this magnet shaft spins faster than the output shaft, like 10x faster, the MCU needs to poll the sensor super quickly, which also needed some optimizations to clear the blocking bus communication wait that would let the magnet skip multiple full turns. The sensor doesn’t internally count turns so we just need to count manually and detect when it jumps from 4096-0 or the other way around.
It then spins around until the sensor is hit AGAIN to calculate tick to degrees, assuming the sensor was zeroed before, and then the current ticks would equal 360 degrees.
Another problem was the servo needs a PWM signal to move. The threshold from stop to go is pretty garbage on these cheap servos, leading it to spin quite fast already when at the lowest PWM value. Instead when far from the value it increases the PWM signal, closer it brings to minimum and starts linearly flickering the PWM signal from 0 to the speed, with the closer it is the more ratio of time stopped to inch it closer to the target.
It actually surprisingly works. It’s very fragile though, any skipped reads, from potentially slow bus transfers would completely throw it off, so all the code running locally on the weak 8 bit MCU needs to be extremely lightweight.
Yeah this was super super painful. I’ve been sitting here redoing superglue and code for hours.
I did some slight refining to the servo case again, making the tolerances tighter to keep the gears from wobbling. It’s still sort of loose, so I need to just keep trying over and over again.
I’m also still writing the servo code. It’s already much more organized than before. I’m also learning Vim keybinds and stuff to try and code faster.
The RS485 bus communication works now, and it’s just sending dummy telemetry data back right now. It can also control the servo fine. I’ve just been doing like the lower level architecting I guess, or not really I’m not sure. Before everything was crammed into a single file and now there’s actually header files and multiple source files and it’s actually somewhat readable. I had an issue with LED control for a second but that’s fixed now :)
After around 10 more revisions, the new servo case is fully working with the magnetic extender. The V2 is significantly better designed and higher efficiency than the last, more guess and check result.
I’ve also started to rewrite the servo code. Right now, its really messy and just kind of snowballed over time as I’ve slapped on patches and features to a fundamentally weak base. I’m in the progress of writing that now, hopefully it will be done soon. It will also include the new auto calibration and encoder usage and PID (and potentially advanced auto tuned curve to combat motor acceleration overshoot and backlash)
Bruh so my robot arm after finally being assembled by the way exceeded it’s limits and tore its wires out. I had to take apart the mainboard assembly again, which just is SO TEDIOUS. I just dumped solder and hot glue again and fixed a short caused from another wire being sheared off.
Also I’m working on the IK system, but it’s not really going well right now. I need to add offsets and config to each of the motors to get them to work correctly. The motors hooked up right now started crashing into my table sadly. Hopefully it will work soon.
I also continued working on the servo case. I still haven’t added the code to calibrate and get closed loop control on the MG996R servos. The DS5180 encoders should be easier though.
I reprinted the arm segments, hopefully for one of the last times, I’ve went through so much filament already. It now allows the mainboard to be neatly packed inside, hiding most of it while still allowing wires to come out. Due to the design of the mainboard, the wires do have to stick out the front like that sadly.
To avoid crushing wires, the servo mount has been expanded to allow more clearance for wires and general electronics.
The servo mount works now with a new design. I remeasured and adjusted the sketches and added proper hole sizes and a little chamfer to allow the insert to slot in before using a soldering iron to melt it in to help align much better than before.
The web UI now shows a representation of the arm. It’s not tuned yet, so the angles are wrong but I’ll fix it soon. I had to move everything from Fusion to Onshape to create the assemblies, and then use a Python library to convert the Onshape assembly into a URDF file that can be rendered with the correct joints inside ThreeJS.
Next, I’ll be adding IK and general arm control.
I verified that the servo cover works, and it’s much much better than the last version. The tolerances are much better this time, leading to less stress on the gears. The same amount of turning uses around 100mA compared to 300mA before, almost reaching it’s limit without any load.
Some motor power connectors disconnected, so I found it with a multimeter and added hot glue to some connectors to secure them.
I soldered the fan power things inside the PCB, but realized that the JST connectors I’m using are different from the fans. I might have to make a sort of adapter or something by crimping more wires.
And the heatset inserts finally work after some tweaking, before the inserts would get misaligned when put in, now with a aligning lip thing it can be slotted in and melted in more accurately.