Introduction: Walking Strandbeest, Java/Python and App Controlled
This Strandbeest kit is a DIY work based on the Strandbeest invented by Theo Jansen. Amazed by the genius mechanical design, I want to equip it with full maneuverability, and next, computer intelligence. In this instructable, we work on the first part, maneuverability. We also cover the mechanical structure for the credit card size computer, so that we can play with computer vision and AI processing. In order to simplify the building work and eance , I didn't use arduino or similar programmable computer, instead, I build a bluetooth hardware controller. This controller, working as the terminal interacting with the robotic hardware, is controlled by more powerful system, such as an android phone app or RaspberryPi, etc. The control can be either mobile phone UI control, or programmable control in python or Java language. One SDK for each programming language is open-source provided in https://github.com/xiapeiqing/m2robots.git
Since the mini-Strandbeest user manual is fairly clear in explaining the building steps, in this instructable, we will focus on the pieces of information not typically covered in the user manual, and the electrical/electronic parts.
If we need more intuitive idea on the mechanical assembly of this kit, quite a few good videos on the assembly topic are available, such as https://youtu.be/6d714xmz1ZY
To construct the mechanical part and make all electrical connection of this Strandbeest, it should take less than 1 hour to complete if wait time for 3D print is not counted. It requires the following parts:
(1) 1x standard Strandbeest kit ( https://webshop.strandbeest.com/ordis-parvus )
(2) 2x DC motor with Gear Box ( https://www.amazon.com/Greartisan-50RPM-Torque-Re... )
(3) 1x Bluetooth controller ( http://ebay.us/Ex61kC?cmpnId=5338273189 )
(4) 1x LiPo Battery ( 3.7V, your choice of capacity in mAh )
(5) 12x M2x5.6mm wood screws
(6) 2mm diameter Carbon or bamboo rod
3D print the following parts:
(1) 1x robotics main body
( 3D print design file with bluetooth controller only download )
( 3D print design file with additional OrangePi Nano download )
(2) 2x Drive shaft flange ( 3D print design file download )
(3) 2x power system fixture ( 3D print design file download )
Android mobile phone. Go to Google playstore, please search M2ROBOTS and install the control App.
In case it is difficult to access Google playstore, visit my personal homepage for alternative app download method
Step 1: Parts Organization
In this step, we will organize all the parts to be assembled.
Fig.1. shows all the out-of-box plastic parts we use to build the model Strandbeest. They are made by injection molding, which is very high efficient, compared to other machining manufacturing methods such as 3D print or milling. That's why we want to take the most advantage of the mass produced product, and only customize the least amount of parts.
As is shown in Fig.2, each piece of plastic board has a labelled alphabet, individual part doesn't have the labeling. Once they are taken apart, there is no more labeling. To solve this problem, we may put parts of the same type in different boxes, or simply mark multiple areas in a piece of paper and put one kind of parts in one area, see Fig.3.
To cut the plastic part off the bigger assembly plastic board, scissors and knife may not be as efficient as and as safe as the plier shown in Fig.4 and 5.
Everything here is made of plastic, except the material of the toes are rubber, see Fig.6. We can cut according to the pre-made cuts. The soft nature of rubber material provides better gripping performance of the strandbeest. It is particularly true when climbing a slope. In later topics, we can test its ability to climb at different slope angle, with and without the rubber toes. When there is no slip, it's called static friction. Once it loses the grip, it becomes kinetic friction. The coefficient of friction depends on the materials used, that's why we have the rubber toes. How to design an experiment, raise your hand and speak out.
The last Figure contains the "ECU", "Power train", and chassis of this model Strandbeest.
Step 2: Points Worthy of Attention During Mechanical Assembly
The mini-Strandbeest has a fairly good user manual. It should be an easy job to follow the manual and complete the assembly. I will skip these content and highlight a few interesting points worthy of our attention.
In Fig.1, one side of the slot holding rubber toes is 90-deg corner, whereas the other side has a 45-deg slope, which is officially called chamfer. Such slope guides the rubber toe to fit into the plastic foot. Try install the toes from the side with chamfer, see Fig.2, then try the other side. The difference is very noticeable. Right side of Fig.3 is the crank in our Stranbeest. It is very similar to the crank in an engine, car engine, motorcycle engine, all share the same structure. In a Strandbeest, when the crank turns, it drives the feet to move. For an engine, it is the movement of piston driving the crank to turn. Such 120-deg separation in a circle also leads to a three phase motor or generator, the electrical power is 120-deg apart, shown in Fig.4. Once we have the mechanical parts for the left and right side bodies all assembled, we now start to work on the parts we add to the Strandbeest, see Fig.5. Fig.6 is the step we use the 3-D printed motor clamp to fasten the motor to the 3-D printed chassis. In this step, the trick is that none of the screws should be tightened before the motor position is adjusted so that the side surface of the chassis is the same as the surface of motor. Once we are satisfied with the alignment, we can tighten all the screws. Move on to the Fig.7, we work on the installation of the flange coupling, connecting the motor output to the crank. The motor side is more difficult to install than the crank side connection, see Fig.8. Therefore we connect the motor side flange first. Once the flange coupling for both motors are installed, as is shown in Fig.9, we use two pieces of 2mm diameter carbon rods to connect the chassis and left/right walking structure. That's happening in FIg.10. In total, we use 3 pieces of carbon rods to connect these entities. But in this step, we only connect two of these, because we need to turn the crank and fit the connection between the flange and crank. If 3 pieces of carbon rods have been in place, it will be harder to adjust the relative position and connect them. Finally, we have the final assembled mechanical system, in Fig.11. Next step, let’s work on electronics.
Step 3: Electrical Connection
All electronic systems need power supply. We can put a 1-cell battery somewhere convenient, for example, beneath the circuitry board in Fig.1. The polarity of power supply is so critical that it deserves a dedicated figure to discuss. Fig.2 highlights the battery connection. In the controller board, the polarity is marked by "+" and "GND", see Fig.3. When the battery runs out of juice, a USB cable is used to recharge the battery, see Fig.4. The LED indicating "recharge in process" will be turned off automatically when the battery becomes full again. The last step is to connect the motor outlets to the motor connectors in the controller board. There exist 3 motor connectors, labelled by number 16 in Fig.3. In Fig.5, the left motor is connected to the leftmost connector labelled with PWM12, and right motor is connected to the middle connector. Currently, turning a tank(differential driving vehicle) left-wise is hard-coded as decrement of motor input power connected to PWM12 motor port. Therefore motor connected to PWM12 port should drive the left feet. I will later convert all the mixing function to be user configurable. as By swapping the motor connector choice, or reverse the motor connector direction, we can fix the problem such as the Strandbeest moving backward when commanded to move forward, turning the wrong direction, remember the DC motor changes its spinning direction if the input wire is connected to the control power in the reversed order.
Step 4: App Settings and Operation
We first download an android app from Google Play Store, see Fig.1. This app has lots of other functionalities which we cannot cover in this instructable, we will only focus on the directly related topics for Strandbeest.
Turn on the hardware bluetooth controller, it will show up in the list of discovery devices. Long click will bring us to the over-the-air download feature to be "instructabled" later. Before we click and start control, let's do some configurations first by clicking the top right corner "Settings". In Fig.2, it is hidden under the ... icon. Fig.3 shows multiple setting categories. These settings, configured in the App, are put into action in three ways: 1) some settings only affect the operation of the App, such as arithmetics to get each motor's power control command from your steering and throttle command. They live in the App. In some later instructables, we will show how we replace them with our Python/Java programs. 2) some setting is sent to the hardware as part of the control protocol in the air, such as the switch between direct control(servo turns exactly the angle commanded) and fly by wire control( the built in autonomous controller function module operates the servo channel according the user command and current attitude) 3) some setting will be sent to the Non-Volatile Memory in the hardware controller. Hence the hardware will follow these settings each time it is turned on without being configured. An example will be the device's bluetooth broadcast name. This kind of settings need a power-cycle to take effect. First category we dive into is the "General Settings" in Fig.4. The “App control function” in Fig.5 defines what role this app is playing, a controller for the hardware device over direct bluetooth connection; a bridge over intranet/internet for telepresence control; and etc. Next, the page “HW type” in Fig.6 tells the app you are working with a differential driving vehicle, so “tank” mode needs to be selected. We have 6 PWM outputs available in total. For the Strandbeest, we need to configure channel 1 to 4 according to Fig.7. Each PWM channel is operated in one of the following modes: 1) servo normal: RC servo controlled by 1 to 2ms PWM signal 2) servo reverse: the controller will reverse the user control for its output 3) DC motor duty cycle: a DC motor or some power electrical device, can be operated in duty cycle mode, 0% is turn-off, 100% is always on. 4) DC motor duty cycle reverse: again the controller will reverse the user control for its output Since we use DC motor and take care of the motor spinning direction by hardware wiring order, we will choose “DC motor duty cycle” for channel 1 to 4, see Fig.8. We also need to merge 2 PWM channels to 1 H-bridge, so as to enable bi-directional control. This step is shown in Fig.9. In the “2 PWM channels to 1 H-bridge” mode, channel 1, 3, and 5 are used to control both channel associated. It introduces a need to remap the throttle control, up-down control of the joystick from its default channel 2 to channel 3. It is achieved in Fig.10 settings. As is shown in Fig.11, each channel is configured to take one arbitrary input source.
Bingo, now we have completed the minimum required configuration, and we can get back to the page showing visible bluetooth device and get it connected. In Fig.12, try playing the joystick, and we can have fun with this Strandbeest. Try climbing some slope, remember the analysis of friction between material types, and read the flight controller estimated attitude, which is shown in the row labelled with “RPY(deg)”, the four entries in this row are roll, pitch, yaw angle estimated by the gyroscope and accelerometer onboard; the last entry is tilt-compensated compass output.
Future work: in the following instructables, we will gradually cover its programming interface, pick your favorite language Java or Python to interact with the Strandbeest, and no longer reading the strandbeest status from the mobile phone screen. We will also start programming in the RaspberryPi type linux computer for more advanced programming topics, see the last Figure. Checkout https://xiapeiqing.github.io/doc/kits/strandbeest/roboticKits_strandbeest/ for the 3D print mechanical parts and https://github.com/xiapeiqing/m2robots.git for SDK and example code if you want to start immediately. Let me know what your desired programming language is if not Java or Python, I can add new version of SDK.
Have fun with hacking and stay tuned for the following instructables.
Participated in the
First Time Author Contest