Energiz3r / robodog

11 stars 2 forks source link

robodog - the noob friendly quadruped robot

Click thumbnail to play video (YouTube):

youtube video

Credits:

Some design and code based on work by these guys:

Overview

I attempted to learn ROS starting from zero experience with robotic development and found it to be way more complicated than I was prepared to deal with learning at the time. If you wish to operate a robot like this properly, you should really a) build a robot with closed-loop motor control, ie. not using R/C servos, and b) learn to create a physic simulation (for ROS, that would be in Gazebo, as far I could tell) and have ROS operate your robot's motors based on actual physical simulation and accelerometer data.

In layman's terms, the code in this repo lets you control the robot and walk it around, but it's really just playing a fixed animation of the legs rather than 'knowing' how to walk.

I wrote my code in NodeJS. I had extreme difficulty and ultimately failed getting other projects to run on the OrangePi Zero LTS due to python dependencies and differences between the distros which can be a nightmare at the best of times. Not having a real Rpi handy, nor being prepared to buy one for the sake of Python, nor wanting to change the robot design to accommodate it, I went with NodeJS. As a front-end dev this was natural to me. Use of Node reduces the only real compatibility challenges for other people using this repo to surfacing an i2c interface to talk to the PWM controller.

Assembly

This is the easy part! I'll add physical build instructions soon.

Electronics Required

Instead of using a regulator, I opted to power my servos directly from the battery, which is 2x 18650 cells in series for a nominal 7.4V. The servos I used are fine with this voltage and I imagine most will be as it's standard practice to power servos from a 2S LiPo in R/C cars. The robot runs for at least an hour on a single charge, so they seem to be plenty.

Bill of Materials

Will update with complete list once the project is mature.

(draft) - Orange Pi Zero - Rocker switch - local electronics store - 12x spt5435LV - 2x dc-dc SZBK07 (* I did not use these. heavy!) - 2x 18650 (I used Sony VTC6) - battery indicator - choose to suit your battery configuration and chemistry - 50X50X10mm fan - 16x 5mm R/C tie rod end (HPI) - 8x 603ZZ 3x9x5mm bearings - You would need a 5v regulator to power the Orange Pi - Assorted length M3 bolts and nyloc nuts

Installation

Check that i2c is enabled for your board. For OrangePi and possibly other Armbian boards, run sudo armbian-config, select System (System and security settings) then Hardware (Toggle hardware configuration), and mark i2c0 to enable it. Select save and you'll be prompted to reboot your OrangePi.

Note about hardware dependencies:

Hardware-specific dependencies are set as optional in package.json:

{ "optionalDependencies": {
    "i2c-bus": "^5.2.3",
    "pca9685": "^5.0.0"
}}

You can therefore do the install on a desktop OS and run the software, but i2c and the PCA9685 will be simulated and do nothing - you will see a message in console to confirm whether or not the hardware dependencies are OK or being simulated. All of the kinematic calculations are still executed so this was handy for development.

Gait Visualisation

run node visualise.js to see the gait visualised on a 3D plot

Edit visualise.js to modify which gait file is visualised (default gaits/basic.js)

Development Status

Overall status

See related Git project for planned and in-progress features: https://github.com/users/Energiz3r/projects/2

I'm absolutely useless when it comes to 3D modelling. The parts I've modified were done so in 123D Design, a discontinued piece of very basic software from Autodesk. If you want proper design files you'll need to make / convert them yourself. Contributions of all kind are welcome, but conversion of the 3D files to proper CAD format especially so.