mechDOG is a dog-like quadruped robot that features the Lynxmotion’s Smart Servo (LSS) Motors and the Servo Erector Set (SES) V2 brackets for the frame. It can be controlled in various ways including remotely with a handheld radio controller, wired with a USB cable, via WiFi using the interface available for PC and web or even directly using the API.
The robot uses an Arduino microcontroller to handle motion control, calculate the inverse kinematics and generate the gaits, receiving commands from the different control options available as well as sending commands to the servo controller. It also allows for expansion by adding extra microcontrollers like an ESP32 or a single board computer like the Raspberry Pi which can be used as the controller for peripherals like sensors (LiDAR for example) and for high-level decision-making.
The inverse kinematics code allows to move the robot in many different ways and the best part is that these motions can be combined. For example, you might want to make the robot walk forward but perhaps you would like to adjust its height to avoid obstacles, or maybe add a bit of body roll, or a frontal offset. This is all possible all to the flexible kinematics of mechDOG. You can also make it walk to a specific angle rather than just forward, backward, left, or right, as well as make it rotate or jog/trot.
The sample code includes a configuration file that defines the option that is going to be used to control the robot, the possible options are:
Depending on which option is defined, the configurations needed for each control option will be included in the main sketch. If you choose any of the remote options you will also have to modify some parameters in the walking_gaits.ino file to ensure everything runs smoothly.
For RC mode, you will want to check which analog pin is being used to read the PPM signal, the default pin is A0 but can be switched to any pin that supports interrupts, there is also the option to invert the channels if the user wants to but this is disabled by default.
For WIFI mode, it is necessary to add your WiFi SSID and password and check the pins used for the serial communication between the WiFi module and the motion controller as well as the baud rate which should match the one configured in the WIFI module.
There is also a function that allows you to configure a WIFIbee module in case you haven’t already done it. To use it simply un-comment the function xbeeConfig and if you’d also like to know the IP assigned un-comment showSerial and connect the motion controller to a computer where you can check this information by using a serial terminal.
mechDOG can not only be controlled by WIFI, RC, or USB but it can also be controlled using the API, which allows you to move the robot using simple commands:
Where walk(0) stops the robot's motion.
The walking motion can also be adjusted by changing the speed and the trajectory.
In the static gait, the robot moves one leg at a time (slow but stable), and in dynamic mode, it moves pairs of legs (faster but less stable).
You can find an example of how to use these commands in the walking_gaits sample code in the sampleMoveSequence function which goes through different stages, and every 4 seconds triggers a different motion.
A great option for making the robot feel more unique is making custom sequences or “special moves”. This can be done using the API by adding a new move with its predefined sequence specifying the “actions” the robot will perform during the custom move, for example, you might want to add a sequence for dancing, following a trajectory, or anything else you imagine.
A nice tip for creating a new “special move” is using the interface to simulate the positions of the body. You can change the Roll, Pitch, and Yaw values as well as the offsets in the X, Y, and Z axis, or even change specific joint values. This way you can test different positions and not risk moving a joint beyond the safe range. Once you have all the positions figured out, write down the steps for the complete sequence to create a new custom move and add it to the specialMoves function in the IK_quad module.
There are different ways to customize mechDOG, one of these options is adjusting the sample code to your needs, another option is to use a different “brain” for mechDOG which can be easily achieved as long as you are able to send “motion commands” through serial to the motion controller which is an Arduino compatible microcontroller (Arduino UNO, Lynxmotion LSS-2IO, Lynxmotion BotBoarduino, etc).
If you would like to customize the code for inverse kinematics you should check the IK_quad module which calculates the joint's positions for the robot’s actions as well as the synchronization of the legs for walking motions. If you would like to add new motion commands or perhaps adjust the available ones to perform certain actions you should check the LSS_MCU module which describes the communication protocol for the motion controller unit and takes care of the serial communication between modules. The Quadruped module integrates the other modules with the LSS servo communication and other useful functions to handle how the robot is being controlled (RC or WiFi), and also defines a straight-forward way of controlling the robot using simple commands like walk, rotate, etc (API).
There are multiple ways of adding sensors to mechDOG, a simple option is adding the sensor to the motion controller which is an Arduino-compatible microcontroller, however, keep in mind that the Inverse Kinematics code runs on this board so you might find that this is not possible because it might have a limited processing capacity. If this is the case you could add an extra microcontroller or single board computer to handle the sensors.
Some great options for the microcontroller are an Arduino Uno or an ESP32 (if you would like some wireless capabilities). If you prefer programming in Python a nice option would be a Raspberry Pi Pico, or if you need more resources for the tasks you are planning (for example adding a camera and recognizing objects, or perhaps working with navigation) a Raspberry Pi would work well.
Regarding the possible sensors to add to the platform, the sky is the limit! Some popular options are:
Regardless of how you decide to use or modify mechDOG, I assure you that it will be fun and you will learn new things along the way. And if you have any questions or want to contribute to the conversation write in the comments section below!