Hi Forum,
Your help would be greatly appreciated here on selecting a more reliable method of detecting the approximate or exact position of a motor shaft for a hexapedal (6-legged) robot based on the current hardware and setup I have at my disposal. My robot is supposed to walk similar to this one I'm working on mimicking: https://www.youtube.com/watch?v=ISznqY3kESI&t=10s
The end goal is to make the robot move in a tripodal gait (3-leg walking pattern) to maintain both balance and movement. A slow walking phase and fast retraction phase must be implemented to allow for the robot to walk with 3 legs always making ground contact and the other 3 retracting quickly to make the next step. 3 motorized legs within each set must stay synchronized with one another to maintain the correct walking gait without the robot falling over.
I am currently left with using only one slotted IR sensor per micro metal geared DC motor to detect the position of a motor's shaft via a 3D printed positioning cup (disk) with 24 slots around it, coupling around the sensor and motor head.
This is one of the 6 C-shaped legs with its slotted positioning cup firmly mounted to its motor's shaft and IR sensor peeking in to detect the position:
Adding additional sensors to this arrangement is not an option for me now as my ESP32 is out of available pins and this is the way I have already designed my robot. However, I am willing to re-3D print the shaft positioning cups with whichever number of slots that are needed to make this position detection arrangement work.
I was referred to the solution of using these 24-notch positioning cups as the sensor could count the exact number of notches that pass through a given point to determine absolute position of a leg (a.k.a. motor shaft), but this doesn't account for if the motor is bumped backwards which offsets the amount of notches counted.
If I am on track with the right position detection method, maybe it's the coding that's troubling me as I am a newbie Arduino programmer here.
However, if my 24-notch positioning cups are not the most optimal approach. Would you please suggest the number, spacing, and layout of the ideal positioning cup each motor should have with its current hardware to ensure its position is well-detected for synchronization of one motor to another? Or is there a smarter alternative solution with my current setup?
I need some reassurance on whether I'm on the right track with my motor positioning method or if I should use another.
Thanks in advance,
Max
