My mechanical Duck (Part 3 Conclusion)

Introduction

The final ducky

This mechanical duck is an attempt at biomimicry, something that man has been doing for a long time. Prominent examples include the Wright Brothers getting inspiration for the aeroplane from birds and the Japanese bullet train front nose cone taking inspiration from the kingfisher beak. In this case, ducks have fascinated me, very much so after coming to London and seeing the ducks in the various ponds in London. In this project, a prototype mechanical duck has been built and tested in the pond, in water. The objective was to create a duck that would seamless blend in with other ducks in the pond and swim with them. This had to be done by as realistically mimicking duck locomotion as well.

It was decided that the mechanical duck should

  1. Paddle like a duck, albeit without muscles but with motors.
  2. It had to be remotely controllable from the edge of the pond and must be able to run for at least ONE hour (until the operator gets bored).

The target pond was the Round Pond in Kensington gardens, home to around a hundred water fowl including mute swans, Canadian Geese, Greylag Geese, Great Crested Grebes, Black Swans and many ducks.

Early prototypes

A trip was made to the Natural History Museum to investigate the structure of duck feet. Preserved were numerous samples of webbed feet from different types of water fowl(Figure 1). Most had 3 or 4 toes in each foot and 2 joints per toe. In total, each foot had at least 8 Degrees of Freedom.  Designing a mechanical system with that many degrees of freedom is very difficult, complicated. Therefore, it was decided that 3 degrees of freedom will be enough. Two degrees of freedom would be driven by motors and one free to move.

Several prototypes were built, starting with the foot. Initial designs were built to test whether the proposed duck foot design would successfully provide forward thrust. A simple model was tested, consisting of a leg with a single degree of freedom, powered from a bench power supply(see Figure 2). The results were encouraging, and some level of thrust was observed. The simple design was mounted on a foam hull and tested in the Round pond. There was enough propulsion to travel 1 meter in 15 seconds.

Early test in the Round Pond

At this point, it was decided that in order to more accurately replicate duck motion replicate duck feet motion, a 2 d.o.f foot system would be required. Several different prototypes were built, as seen in Figure 4. These mechanisms were improved upon until a reliable mechanism was working. The early porotypes had tendency of getting stuck, or not having the right stroke path that could generate propulsion.

Several different 4 bar linkage mechanism prototypes.

Final Model

The final model was built and tested in the pond, immersed in water and performed as expected. It was run for several minutes in the pond, propelling itself forward, much to the amusement of many human visitors to the Round Pond.

Human interaction

Control of the duck comes from the human operator, who changes the position of the stick on the remote-control transmitter. The duck uses 2 channels to transmit information. One channel transmits the speed and one channel transmits the direction of movement of the duck. Therefore, the operator can control the velocity of the duck by controlling its direction and magnitude. This allows the operator to send the duck anywhere he wants on water, including behind other real ducks on the pond.

Electrical subsystem

The electrical system is the most important system, taking signals from the remote-control transmitter, decoding them and accordingly moving the legs of the ducks. A block diagram of all electronics components is presented in Figure 5. A more complete circuit diagram of the components is found in Appendix A in Figure 21.

Figure 5: Block Diagram of all electrical components

Power supply

The mechanical duck is powered by a 3-cell lithium polymer battery, generating a voltage of 11.1V.  The voltage is too high for most of the components, so it stepped down to 6V with a DC-to-DC buck converter, the LM25976. The power was then distributed in parallel to the 4 servos and the Arduino microcontroller. The microcontroller was decoupled from the power supply with 2 large capacitors across its terminals.

During testing, it was observed that the Arduino microcontroller seemed to brown-out a few seconds after the feet started moving. On further inspection with an oscilloscope, it was seen that when all 4 servos switched directions at the same time, the voltage across the microcontroller terminals dropped dangerously low to approximately 4 volts(See Figure 6 for Oscilloscope view). According to the datasheet for the Arduino microcontroller, it expects an input voltage of 6-12 volts.

The solution was to place a large capacitor across the power input pins of the microcontroller to supply current to the microcontroller during a voltage drop to maintain a high enough voltage across the power line and ground. The capacitance value was chosen to be 400uF. The decoupling capacitor acts a local energy store that instantly supplies current to the microcontroller during a voltage drop, thus maintain a relatively stable input voltage. This solution worked and no further browning out of microcontroller was seen during normal operation.

Power consumption

The battery selected had a capacity of  at the .  During testing, while running all the servos, the peak current drawn was 2.0 A. At 6V, this translates to a power consumption of . The battery is rated for 1000mAh at 11.1V, giving a total capacity at of energy. Running at , the run time is expected to be 55.5 hours, well above the required run time. This would potentially mean that the operator can drive the duck around the pond for many hours without ever having to recharge the battery. In hindsight, it would have been more appropriate to use a lower capacity battery such as a 350mAh battery. It would still give an approximate run time of 17 hours.

Communication between remote control and duck

A commercially available remote-control set, transmitter and receiver were used in this project. The transmitter, the Hobby King HK-T4A V2 transmitter and HK-TR6A V2 Receiver. The transmitter and receiver have 4 independent channels of communication but only 2 were used in this project. One channel transmitted information on speed and other transmitted directional information, thus allowing the operator to control the velocity, , of the duck.

The transmitter transmits on the 2.4GHz band using the Gaussian Frequency Shift Keying(GFSK) modulation scheme to transmit information between transmitter and receiver. The maximum RF power is 19dbm or 79mW, giving a physical range of up to 300m with a direct line of sight.

The transmission protocol uses a proprietary Frequency-hopping spread spectrum (FHSS) method of transmitting radio signals by rapidly switching a carrier among many frequency channels in a pseudorandom sequence known to both the transmitter and receiver. This is done to avoid narrow band interference from other transmitters in the vicinity thus avoiding continuous interference on a single carrier frequency. This therefore improves the robustness of the communication link.

Communication protocol between components

The radio receiver and servos use the same protocol to communicate with each other. In the duck, the communication is intercepted by the microcontroller, modified, before being sent to the servo.

The protocol for data transmission is a 50hz Pulse Width Modulated (PWM) signal with a duty cycle that indicates a value(See Figure 8). The Arduino microcontroller reads the PWM signal from the radio receiver, processes it, and accordingly sets the position of the arm of all the 4 servos that control both legs by sending another internally generated PWM signal to the servos.[MN6] 

Electrical water proofing

The electrical subsystem was designed to be robust to shock and water ingress. Electronics and water don’t mix well. However, in unfortunate and unexpected case that the duck sinks and electronics gets wet, it had to be forgiving enough to survive.

All the electronics, from the micro controller board, radio receiver and servo circuitry were covered in one of two types of waterproofing compounds: Acrylic Conformal Coating manufactured by MG Chemicals and CorrosionX manufactured by Corrosion Technologies. Each works in a different way.

CorrosionX is a green, oily liquid that clings and is drawn into all the nooks and crannies of the electronics components via capillary action. This envelops all the components. This substance completely prevents water from passing through, completely water-proofing the components. The substance does not solidify. It stays in its liquid form for a long period of time.

The disadvantage is this substance can be wiped off on contact since it is a liquid. Ideal use is for moving parts. In this project, Corrosion X was used to waterproof the internal electronics of the SG90 servos where there is moving parts. The casing was opened, PCB extracted and dipped in Corrosion X. It was reassembled, trapping the CorrosionX inside the casing. For static electronics components such as the Micro controller breakout board (Arduino Nano), The whole board was coated with Acrylic Conformal coating. The substance came in a spray can and was sprayed on to the boards.

Water proofing performance

Figure 9: slight corrosion seen

All electronics worked after completely drenching the electronics in fresh-water during testing. All electronics continued to work 2 days after immersion (during the actual live demonstration for examiner) and 2 weeks later during a static demonstration. Looking more closely at the PCBs, it was noted that there was indeed some corrosion at a component (see  Figure 9). This is possibly due to improper application of the coating. In the long run, it is likely that the water ingress would cause failure of the electrical system if it was improperly waterproofed. However, water proofing is only a last resort barrier and should not be put to use in normal operation of the duck. More external sealing of the electrical system would be necessary, including using an O-ring rubber seal.

Hardware integration improvements

The electronic components come in 3 different separate parts: the buck converter, radio receiver, Arduino microcontroller. This iteration of the mechanical duck is indeed a prototype, utilising off-the-shelf parts. However, for mechanical robustness, it would be much better to integrate all the components on a single Circuit board. A single board for all the components will simplify the assembly.

Figure 10: all the electronic components used in this duck.

Mechanical Subsystem

The feet have two degrees of freedom, each foot controlled by 2 separate servos. This allowed for plenty of optimisation of the gait of the duck by fine tuning the velocity of each servo. The duck feet follow the same path with each stroke, which means that it is a single degree of freedom system. In theory, it is possible to drive each foot with a single motor using gearing or other transmission means. However, during the design of the duck, it was very beneficial to tinker with the gait of the duck through software and two independently controllable servos than to completely redesign the mechanical structure each time the gait had to be changed while running on a single motor.

Paddle design

The duck is propelled with a unique flapping mechanism inspired by real duck feet. The flaps open to its limit on the down stroke, accelerating water backwards, thus providing forward thrust to the duck (see Figure 11). On the up-stroke, the flaps close up due to drag force applied by the rushing water, minimising resistance. As a result, there is a net force in one direction in each cycle of the feet movement.

Early test of paddle design

The hinge is made from PVC insulation tape. It has a very low stiffness at that thickness, allowing it to flex and behave like a hinge. The flaps are made from 3mm thick acrylic, like the rest of the duck frame, that each have a surface area of 596mm2‑.

Leg design

Each leg of the duck is a four-bar linkage with two independently controlled servos(see Figure 14). This allowed for iterative adjustment of the motion of the foot. All the bars are constrained by a revolute joint, allowing a single axis of rotation function. The bars can rotate around a M3 bolt and lock nut(see Figure 15). The joint had a good balance of low friction as well as a small form factor, seamlessly fitting in to the 4-bar linkage structure while avoid major protrusions. Large protrusions can cause a reduction in propulsion efficiency as they induce drag in the water in both the up and down stroke.

Testing of one leg at a time.

Velocity control

The direction and speed of the duck movement is controlled by controlling the rotational velocity,, of the left and right feet of the duck. The control is simple:

  • For turning left, the left leg is not moved while the right kicks.
  • For turning right, the right leg is not moved while the left kicks.
  • For forward motion: both feet kick at the same rate.

The rotational velocity of each feet is controlled to control the rate of rotation.

Real duck, as observed in numerous underwater video clips of duck feet, have an average kicking frequency of 2.4 cycles/s( see Figure 17). A simplified model of duck foot with 2 driven joints was developed(Figure 16). From observation, the joint that rotated the furthest during each cycle was 50°. This indicates a top rotational velocity of 12°/0.1s.  The servos selected could rotate at 60 °/0.1s, well above the rate of ducks. This additional speed allowed for inefficiencies in the propulsion system, allowing it to at least reach the swim velocity of ducks in open water.

Both feet are locked at a constant phase difference, at 180 degrees. The left and right feet provide alternating thrust one after the other so that the duck sticks to a straight line. Since the motion of the duck feet is periodic, with each kick the duck veers in one direction and turns the other way with the kick from the opposite foot. This means that the duck proceeds forward in a zig-zag motion. However, the deflections to the left and right during each kick cycle was small: only around 2-5 degrees.

Note that the duck cannot propel itself backwards. The only way to reverse course is to completely change the heading by 180 degrees and move forward.

Chassis of duck

All components of the duck were integrated into a single, acrylic chassis. The acrylic chassis was made from 3mm thick laser cut acrylic sheets, held together with interlocking tabs. The joints were glued with PVC glue, primarily used in the plumbing industry to hold together PVC pipes to make water proof couplings. The gaps that still remained were filled with silicone.

Top speed  analysis

At full throttle in water, duck travelled 1 meter in 5 seconds(0.2m/s). This was determined by analysing film footage of the duck in water.  This is quite slow compared to actual Mallard ducks that can travel at a blistering 2.04 m/s. However, when not in a rush, there is a good chance that the mechanical duck would catch up.

Motors

The motors used were coupled with potentiometers to allow precise positional control of the feet of the duck. The motors + potentiometers came in the SG90 servo package that could rotate at 60 degrees/0.1s. The servo had an angular range of 0-180 degrees according to the data sheet. However, in practice, it was observed that the range was from 0-150 degrees at most.

Overheating issues

Running the servos at full throttle, at the maximum rotation velocity specified by the servo data sheet, was risky at best. At full speed, the gears tended to overheat and wear out very quickly, in a matter of a 3-4min of continuous running. The damage rendered the servos completely non-functional after such a short time. It is likely that the nylon gears melted and fused together. This is likely the cause because the servo could not be turned by rotating the shaft without using a large amount of force after failure.

In order to keep maintain the gears, the top speed was limited to 70% of full maximum speed. On a side note, during a testing in the pond, it was noted that the water cooling by immersion (i.e accidental sinking) of the duck did wonders to keep the servo gears cool.

Aesthetics and buoyancy

A machine that paddles like a duck but does not look like a duck will not be accepted as a fellow duck. Therefore, an enclosure that has the appearance of a duck was used to hide away all the electronics and mechanical system. The enclosure is sold as a duck decoy: a figurine of a duck used by duck hunters to invite other ducks to the pond so that they can be shot.

These duck decoys were very suitable for this project because they naturally float and have a ballast built in, providing stability from capsizing. The ballast is a bar at the bottom of the duck, filled with sand.

The decoy comes fully pond-worthy, completely sealed and water proofed and painted. The material is likely to be High Density Poly Ethylene(HDPE), around 2mm thick and injection moulded. The material could be easily cut with a Stanley knife, allowing the back to be opened, slots cut for the legs and electronics fit in.

All components were fit into the duck to determine if it would float prior to creating the cuts to allow the feet to stick out of the bottom of the decoy. In order to keep in the duck buoyant, all the air pockets were filled with expanded polystyrene in order to keep the duck buoyant.

Software

The duck is a simple state machine. It is either turning left, turning right or moving forward. Each state has a velocity associated with it. For example, the moving forward state can have a velocity of 0 where it is not moving.

The program reads the value of the 2 channels from the radio receiver every 20ms and changes it state according to the information received.

Circular buffer

Figure 20: Illustration of the circular buffer

The angular positions for each servo were stored in a circular buffer. With each leg stroke, the servo would go through that sequence of angular positions (see Figure 20). When it reaches the end of the sequence, it would return to the first angular value. The pointer jumped to the position in regular time intervals and sent that positional information to the servos. In order to make the servo rotate faster, the pointer would skip some angle instructions in the buffer, thus making larger angular steps in the same time period.

Version control

Git was used throughout for version control, and hosted on Github. All the software can be found here: https://github.com/MedadRufus/Mechanical-duck-design/tree/master/Software/Final%20Duck%20Code

Conclusion

This project was a very important stepping stone to develop working devices that can perform when needed. The experience of sourcing for parts, designing the duck, assembling everything was massively rewarding.

Acknowledgements

I owe my sincere thanks to Richard Ibbotson, Hacker in Residence in the Imperial College Advanced Hackspace for helping me trouble shoot the electronics, get the electronics water proofed and for his help in general.

Appendix A

Figure 21: Circuit diagram of all electrical components

Leave a Reply

Your email address will not be published. Required fields are marked *