I "upgraded" to OpenCat 2.0 and have noticed some problems.
Tail servo is now designated c3 instead of c2. Is this intentional? I notice in preprogrammed movements, the tail does not move as it did with the older code.
I can successfully make the robot crawl/walk/trot forward, left, and right, but pressing the "backwards" button on the remote makes it walk in place. Is there a way to check/fix the keymapping?
For those keeping score, I proposed adding the above line of code in a pull request. RL has now included it along with logic such that the delay only occurs for NyBoard 0_x.
I have tested and can confirm that the updated code works.
Thanks. I did three things that smoothed out and stabilized the walking motion.
Turned off gyros before starting to walk, as suggested above (biggest difference)
Made sure all stepper motor shaft screws are tight. They like to work loose and may benefit from blue threadlocker after calibration.
Changing the higlighted line in the code snippet above to make it more versatile.
delayMicroseconds(850); //Slow the robot down to smooth out motion; adjust delay PRN
I found 850 us to work well, but users can play around with that value as needed. I don't think a delay longer than 1000 us (1 ms) is necessary.
I have the MG90s that came with the Indiegogo kit that shipped with Nyboard 0_2. I was trying to have Nybble walk on carpet with the rubber "boots" (something it was able to do before without issue), but it is less stable now. Bootless and on a smooth floor it does fare better. Nonetheless, there's something about the gait in Opencat 2.0 that's causing it to tip over more often. I will try adding some additional weight to the bottom to lower the center of mass to see if that helps.
NyBoard V0_2 runs at 20MHz, faster than the V1_* board's 16MHz.
The MG90s were generic servos back in 2019. We are now using OEMed servos with better PID specifically tuned for our robots.
You may add delay(1) or delay(2) within every loop to slow the robot down.
If you turn on the gyro, trot should be ok.
Attached is my Nybble walking and troting on a smooth floor.
What servos are used on your Nybble?
Thanks for the helpful clarifications. I agree that the current way of walking backwards is not intuitive.
Overall I'm finding the walk and trot actions less stable than in the original Nybble.ino from a couple of years ago. Motion is not as smooth and the robot is more likely to tip unless it has a very low center of mass. These were not issues before.
I wrote a new logic that the up and down arrow actually tunes the running speed. The logic was canceled, and the waking in place feature was leftover. The code now runs faster, so the gait may need to be tuned again.
@Rongzhong Li Makes sense. I notice all the instinctual movements (e.g. wave) are executed more quickly too, so possibly the gait is faster too. I can't even attempt to get "trot" to work well, as it's more like poor Nybble is having a seizure given how fast it is.
Yes, the tail is now assigned to another pin, so that the wiring direction is clockwise.
If the robot is walking forward, pressing the back button will make it walk in place. Pressing it again will make it walk backward. I'm going to cancel this logic in the next push.