Topic-wise this is the last log, but I'm thinking about adding one more with a few mini topics telling about some minor stuff.
As I already mentioned in the legs' log, initially I was planning on using 4 18650 batteries connected in series with a step-down converter, 5 volt hobby servos and a Pi Zero 2 W, which is also running on 5 V.
The initial test with one leg went fine; it was moving as expected and everything seemed fine. So for the ease of testing and to avoid the hassle of charging the batteries daily I switched to using the Pi's power input and was feeding one leg directly off the Pi's output.
Later, for testing with multiple legs, I also bought myself a power supply with 5 V 30 A output. Fed it from the power grid, connected it to ugly leftovers of some power cable. Testing was fun with this terrifying metal box hooked up to the grid and a few naked wires on the table. This time Pi and the PCA were connected in parallel, with ground and data cables connected, still everything was running.
At this time I started noticing some weird trembling of the legs. Whenever servos were under load the leg would noticeably shake like some kind of vibrator, that was kinda okay for testing but I obviously had to fix it later.
Finally on the third iteration of the legs I got to testing the full design. The Pi would start fine, single leg movement would be okay, but after one or two strides it would completely stop. I would get disconnected from it, but the dog still had all the lights on.
The very first assumption I had was insufficient power, I asked ChatGPT for the calculations and it insisted that everything should be fine. The second thought I had was maybe the batteries are stopping, trying to prevent over-discharge protection, so I bought different ones with huge rated output voltage and no protection whatsoever. That still didn't help.
I took the dog to work to check with a multimeter, which I didn't have at the moment, and to try connecting it to a lab power supply. That was pretty interesting, it turned out that while moving legs I had significant drops in voltage which I didn't expect with the step-down converter. First thing I tried was adding a couple of small capacitors on the output, which did help, now the dog could make 4–5 steps before going dark.
The idea of using a cheap shitty step-down converter clearly wasn't working. I bought myself a cheap shitty step-up converter and started trying to run the whole dog off a single battery, well, as one could guess the result was the same. So I bought myself an expensive Pololu step-up converter for a whole 30 euros, which is roughly 30 times more than the previous. Whilst that did slightly improve the situation, the dog still couldn't operate correctly.
That's when it hit me, I can power the Pi separately from the servos, so I put two batteries each connected to a private step-up, one connected to the Pi, the other connected to the PCA, from Pi to PCA only left ground and data cables, and, who could think, now it was working pretty well. I did measure the voltage on the PCA input, and, of course, it was still dropping from 5 to 3 volts, but everything was running.
The only problem left were those tremors mentioned earlier. To me it seemed that the problem was with power input again, as when powered with a proper power source they seemed to work better, I was already about to give up on this and try to manage running with tremors. Luckily I noticed that not all of the joints were doing it and there was no clear dependency on their location to how much they would shake, also there was no dependency on which port they plugged into on the PCA. I decided to try more expensive servos with metal gears going from 1 euro per piece up to 4 euros, which is a significant increase for a cheap af dog with 12 DOFs in legs. Well, that helped a lot.
From my estimation, among the initial super cheap servos roughly 80% were shaky, among the newer expensive ones it was only 20% So I still had to buy several extras for everything to work fine.
The working theory is when a bad servo tries to hold a position with any load, the internal encoder decides that it already moved and tries to move the motor to the correct position, overshoots and goes back with too much power and so the cycle of infinite trembles starts. This could be because of plastic gears somehow slightly bending or terrible quality encoders or something else, I was just happy to find a solution.
And the cheap servos I used for the camera mount later, there it seems not to be enough load to trigger this shaky behaviour.
Stanislav Britanishskii
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.