A servo with an N20 geared motor for a small footprint, a magnetic encoder, and readable/writable over I2C.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
When designing the servo, my initial approach was to drive it directly with PWM signals from the main robot controller board. However, after more consideration, I realized there were some benefits to instead using I2C communication to control the servo module:
Firstly, I2C helps reduce the load on the main controller's GPIOs. With many components like sensors and displays also needing to interface with the main board, minimizing GPIO usage is beneficial. I2C's multidrop bus allows all servos to share just two signal lines.
Secondly, having an integrated controller chip on the servo PCB enables more flexible control logic compared to direct PWMing. The controller can implement features like positional control, speed regulation, error handling, etc. Instead of outputting PWM pulses, the main board simply sends high level position or velocity commands over I2C.
Likewise, the servo controller chip could be reprogrammed or swapped out to easily change the control algorithms. With the right firmware, the servo behavior can be optimized for different robots' needs. This modularity makes iterating and enhancing the servo module much easier.
Finally, offloading the PWM generation and other motion control duties from the main processor to the servo controller frees up processing power. This lets the mainboard focus on higher-level behaviors rather than precision motor timing tasks.
Unfortunately I had already orderd the PCBs, and will have to reorder an updated version, which will waste time, but that is just the game goes.
In summary, utilizing a dedicated servo controller chip allows me to add features, optimize performance, save main processor resources, and design a more scalable, flexible robotic architecture. While direct PWM control is simpler, I2C unlocks more possibilities.
Create an account to leave a comment. Already have an account? Log In.
Hi, I like your approach using an N20 standard. How are you going to measure the position of the output shaft? Do you mount a magnet on the gearbox? Much success on soldering your prototype and happy firmware development. bst matthias
Become a member to follow this project and never miss any updates
Thanks! There is a disk with magnets embedded on the back motor shaft that spins and the poles get picked up by hall 2 hall effect sensors. This acts like an encoder. I just program the Attiny to get the pulse count, and calculate the position given the gear ratio.