Curiosity MSL
1. Mars Science Laboratory (MSL) is a robotic space probe mission to Mars launched by NASA on November 26, 2011, which successfully landed Curiosity, a Mars rover. Source: Wikipedia
Curiosity BTL (Bricolabs Technology Laboratory) is a project to scale replicate the martian MSL rover in a printable model. Work in progress.
Fortunately it won't have to reach your hands in a maneuver like the 7 minutes of terror, or in the state of poor Schiaparelli. All the information you need to build it and program it will be here.
The mechanical part is a curious mechanism with rockers called rocker-bogie and a differential pivot that balances the trains on both sides. It has 6 drive wheels and 4 steered wheels. According to NASA it is capable of overcoming obstacles twice the diameter of the wheel.
There are two designs, at scales 1:10 and 1:5.
The 1:10 scale design is now complete in Github and Thingiverse. Each Curiosity wheel has a PLA rim, a Filaflex tyre and an embedded N20 engine. They will be slow engines as the MSL is in reality, starting at 1:300 gear reduction. Don't expect Curiosity to compete with the National Robotic League sprinters.
The four wheels of the corners turn 180º with a 9g servo.
The complete design of the printable parts is in Github and Thingiverse. The tyres are commercial, but with an alternative printable rim.
In this link you can see it working.
Scale 1:15 by @diegogg https://www.thingiverse.com/thing:3432863
To control 6 reversing motors and 4 servos we need many PWM outputs. One way to do this that allows to be controlled indistinctly with an Arduino or a Raspberry Pi is to rely on a 16 servos Adafruit controller with i2c bus.
The simple alternative to this is to use an Arduino Mega2560, in its original version or the compact version that is offered as an alternative (although with communications chip CH340). L9110 drivers have been used for the 1:10 version. L298 drivers have been used for the XL version.
For the original Arduino Mega a shield has been used that replicates all the outputs adding to each a power supply and mass, and also has a socket for a BluetoothBee module. With it and the L298 drivers, a very clean wiring can be made with a 20 cm female-female Dupont tape with 19 cables in the following order:
7-30-31-32-33-6-5-34-35-36-37-4-3-38-39-40-41-2-GND
This wiring arrangement allows a very simple code to be used to operate each motor separately.
void setmotor(int m, int v){ int pwm = 8-m; int dir1 = 28+2*m; int dir2 = 29+2*m; v = constrain (v,-255,255); digitalWrite(dir1,v>=0); digitalWrite(dir2,v<0); analogWrite(pwm,abs(v)); }
You can see more details about the use of that motor driver (and others) in our wiki.
On the mast will be mounted a camera to drive Curiosity by radio control with FPV glasses (First Person View) or an external monitor. It can be a dedicated camera such as those used in drones or a GoPro. In any case it will be an independent system of motion control, whether it is autonomous or if it is remote controlled from Bluetooth or with an infrared controller.
Moving straight ahead or turning on its own axis will be relatively simple manoeuvres. Program the rotation of the servos and the speed of each wheel to describe a curve a geometric challenge.
The programs for Arduino MEGA are here.
José Antonio Vacas @javacasm has already a development based on Arduino with different levels of complexity, with programs and electronic schemes.