Last updated Sunday, 20-May-2007 21:52:56 EST
Status: Working on assembler code for PIC controller and pressure transducers. Also re-organising this page.
Project Goals
This project started out as a learning exercise that ended up covering a huge range of mechanical, electrical, control and embedded computing topics. I trust that the background information and design information that are presented in this project will inspire others to build something even better.
The primary goal is to develop an automous robot capable of behavior that emulates a real fish.
Collapsible Regions (please click for details)
To display the hidden text. Click again to hide.
This design started with a lot of Googling for mechanical and electronic options. The real starting point was building a mechanical tail from perspex and brass components. This decision set the baseline for the remainder of the design. The diagram below shows the overall shape and core components of the project including gas bladder, air cylinder, controller and mechanical tail. It was drawn using InkScape.
See the Perspex Handbook for details on cutting, bending, welding and molding this versatile material.
Environmental Constraints
After a lot of unnecessary iteration in the design, it be came obvious that we need to first analyse the environmental and other constraints under which the robot will operate before comming up with a design.
+ About Fish
The first thing that we should look at is the animal that we are emulating. Here are some relevant facts about fish.
- Propulsion - is achieved at low speed by fins and at high speeds by tail action.
- Steering - is only available when a fish is in motion and is achieved by flexing the body and inclination of fins.
- Stopping - occurs naturally due to water resistance but can be assisted by extreme rotation of fins. A sharp turn also helps reduce moment and allows obstacle avoidance.
- Reversing - can be achieved through a combination of fin action and buoyancy control.
- Buoyancy - and hence the depth where no effort is required to stay at a depth is regulated by changing the average density of the fish. This can be done slowly by storage of fats and oils and quickly by movement of disolved gasses in the blood stream in and out of fish tissues or a gas bladder. Note that for any set density, the fish only has neutral buoyancy at a single depth.
+ Characteristics of Water
Ideally the robot will have neutral buoyancy at any required operational depth, and this can be achieved by adjusting its average density. Some of the other characteristics of water may be utilised in this design.
- Compression - Water is (almost) incompressible which means that water density is (almost) identical at all depth except where purity or temperature change.
- Depth vs Density - Water density generally increases with depth due to temperature and saltiness but only by a small percentage. At depth, pressure from the overlying ocean water becomes very high (pressure at 4,000 meters is about 400 atmospheres), but water is only slightly compressible, so that there is only a minor pressure effect on density. At a depth of 4,000 meters, water decreases in volume only by 1.8 percent. Although the high pressure at depth has only a slight effect on the water, it has a much greater effect on easily compressible materials such as parts of the robot
- Pure Water density = 1000 kg/m3
- Sea Water density = varies from 1025 kg/m3 at the surface to 1028 kg/m3 from 1000 metres down and beyond (the salt makes it heavier than fresh water). From this you can see that a robot which moves from fresh water to the depths of the ocean will need to vary its density from 1000 kg/m3 to 1028 kg/m3, or 2.8%
- Depth vs Pressure - Water pressure increases in direct proportion to depth. To get the formula, consider a cube of water 1m x 1m x 1m which has a mass of 1000kg and a base area of 1m2.
Pressure = Force / Area.
Force = mass x acceleration (i.e. acceleration due to gravity = 9.8 [m/s2]).
Pressure = mass x gravity / area.
Pressure = 1000 [kg/m3] x 9.8 [kgm/s2] / [1m2]
Pressure = 9.8 x Depth [kPa](i.e. 1 kPa = 1000 N/m2, and 1 N = 1 kgm/s2) - Fresh vs Salty - Fresh water is less dense and floats on saltier water, so the density will increase as you descend in the ocean
- Warm vs Cold - Warmer water is less dense and floats on colder water, so the density will increase as you descend in the ocean
- Pure vs Dirty - Pure water is less dense and floats on dirty or contaminated water, so the density will increase as you descend in the ocean
- Purity of water varies from distilled to mud, and the density varies from 1000kg/m3 to about 4500kg/m3 for solid stone.
- Transmissivity limits light propogation to about 100m in clear open ocean. Water absorbs different wavelengths of light differently. By a depth of 10 meters (33 feet), mostly bluish and green light remains. This would indicate that the best frequency for communications using light is not infra-red.
- Sound Propogation Sound travels at 1,450 meters per second in sea water compared to 334 meters per second in air. Sound in water is reflected back when it strikes a solid object. This may be used for navigation.
- Conductivity Electrical conductivity of water increases for water as the amount of dissolved ions increase.. This may be used for navigation.
- Refractive Index - At 20 deg C and wavelength of 5893 Angstroms, refraction = 1.3330 and decreases with increase in frequency, salinity and temperature.
+ The Tank
The robot will operate in a tank:
- Depth will range from 0 to 0.8m. This will influence the design of the depth control mechanism.
- Width and Length of tank will be less than 1m. This will affect the turning circle and hence the physical size of the robot.
- Water Quality will be normal fresh domestic tap quality. This will affect the water density for the depth control mechanism. It will also affect the corrosion resistance requirements and consideration of sensor degradation of the robot.
- Material in the tank wall is perspex. Any communications between the robot and outside devices could use optical mechanisms or other means. The hard sides should not damage physical components or sensors or impare their operation.
- Lighting is 20W florescent tubes with some filtered daylight entering from the sides of the tank and varying with time of day. The robot may use light sources for navigation and for power source recharging.
- Circulation and Filtration of water in the tank is handled by a small pump delivering 20 litres per hour. This moving water may be used as a means of recharging the power source and the filtration will ensure that the water density is relatively constant.
+ Energy Constraints
- Activity levels the robot will be determined by software.
- Energy Consumption should be minimised for all operating modes if possible in order to extend operating time. Wherever possible standby mode should be available and be used automatically.
- Energy Storage should be safe to use and simple to replenish. High voltages and extreme pressues should be avoided.
- Recharge should be automated if possible.
+ Design Constraints and Goals
- Simpest Approach should guide the design to both minimise components and complexity of hardware and software.
- Components should be sourced locally wherever possible.
- Cost should be minimised.
- Heuristic algorthims should allow the robot to self calibrate parameters such as depth regulation, recharge time etc.
- Autonomy of operation. This project will not result in a radio controlled robot. It should be capable of automated movement, collision avoidance and recharge. The goals will be to:
- Swim around the tank whenever the light level is above a preset level.
- Recharge itself automatically when power levels fall below a level that will stop it from moving to the recharge point.
- Ascend/Descend during swimming pattern at random intervals.
- Avoid obstacles.
Project Divisions
There are a number of ways to break this project down, but in the end, it comes down to mechanical construction, electronic control, actuators and sensors and the software. This division allows separate systems development and testing.
+ Mechanical
Click on the following headings to see more detail relating to the mechanical construction of the robot.
+ Requirements
- Buoyancy - The total robot must be adjusted by adding floatation for neutral buoyancy at the surface of the tank.
- Compressibility - No part of the robot should be compressible. The control box and tail should be constucted from rigid material. The skin will allow water to pass to the inside of the fish so as to equalise internal and external pressure.
- Water Tight - The control box should be water tight to the maximum depth of 1m.
- Electrical Insulation - All electrical connections should be fully insulated to stop water ingress and eliminate leakage currents into the surrounding water.
- Corrosion Resistance - The materials that will come into contact with the water should be built from corrosion resistant materials.
- Strength - The components in the fish must have sufficient strength to withstand at least twice the expected maximum loading. All joining components should not degrade in water.
- Temperature - None of the mechanical components should not degrade at the expected operating temperature including additional heating effects from running the robot and under recharge conditions.
+ Structural Body and External Components
- Skeleton - The skeleton provides the supporting framework for the control box and attached components including the tail, and the skin covering. It will be made from a profile cutout of perspex extending from the top of the control box around the nose and under the fish to the rear of the control box. A small number of circumferal ribs will support the skin on the sides of the fish. It will also support the top of the gas bladder when inflated. All perspex parts will be welded together and to the control box using Chloroform.
- Skin - The material for the skin is yet to be determined but will not be water tight. It is used to streamline the outer surface of the robot to minimise drag when moving through the water. The water pressure inside and outside the fish must be allowed to equalise to maintain buoyancy. If the fish was filled with air, the flexible skin would allow the volume to compress during descent and destabilise the buoyancy.
- Solar Panel - A solar panel will be integrated into the skin on the top or side of the fish so that it can recharge by floating to the surface. The wiring connections will be sealed with silastic and connect to an external plug on the control box.
- Eyes - The eyes will be buttons, with a light sensitive Cadmium cell attached to the centre using silastic. They will be attached to the skin in the eye positions on either side of the fish and be used for light following and spacial orientation. The wiring connections will be sealed with silastic and connect to an external plug on the control box.
+ Articulated Tail Mechanism
- Tail Mechanism - The tail mechanism will be built from 3 segments of perspex, joined by brass hinges. Brackets and push rods connected between segments (see below) will ensure the tail flexes in the same manner as a real fish. The end of the tail will be a layered piece of flexible plastici. By applying push/pull force on a single bracket on the front segment will operate the entire tail mechanism.
+ Side Fins
It should be noted that all fins will be used as a part of the proximity sensor.
- Top Fin - Provides more profile surface area for propulsion and stable motion.
- Bottom Fin - Provides more profile surface area for propulsion and stable motion.
- Front Left and Right Fins - These fins will be manually adjusted to acheive stable motion.
- Rear Left and Right Fins - These fins will be manually adjusted to acheive stable motion. They will also be fine tuned to cause nose-up orientation when ascending and nose-down orientation when descending using the depth control system.
+ Gas Bladder and Air Cylinder
- Gas Bladder - The gas bladder will be a balloon, connected via flexible PVC tubing to one of the tubes in the front of the control box and sealed with silastic. The rear end of the balloon will be secured to the outside, top, rear of the control box. The air in the sealed air cylinder/pump/gas bladder system will initially need to be adjusted to acheive close to neutral buoyancy. The gas bladder must be a large balloon so that under maximum inflation it will not cause the fabric to stretch otherwise the pump will be placed under unnecessary load.
- Air Cylinder - The air cylinder will be a soda drink cylinder and mounted on the outside front of the control box. It will be connected via flexible PVC tubing to one of the tubes in the front of the control box and sealed with silastic. The air cylinder will displace the same volume of water despite the internal pressure and its weight will at least partially balance the weight of the tail.
+ Pressure Sensors
The pressure sensors must be located on the outside of the robot. One must face forwards whilst the other must face at right angles to the direction of motion.
Small dripper irrigation components will be welded to appropriate positions on the outside of the robot, with the tube connector entering through a hole in the perspex wall. The outside of the dripper will be covered with a small "water bomb" balloon in order to allow the water to exert a pressure on a small moveable diaphram. This also ensures that water does not enter the robot control box.
Flexible aquarium air hose tubing will connect the dripper to the 2 pressure sensors as shown in the photo below. This allows the electronic pressure transducers to be mounted at any location within the control box.
Absolute pressure (depth) is measured by one pressure transducer, whilst the other measures the pressure differential between the sensors to determine forward speed.
+ Control Box
- Control Box - The control components will be housed in a 38mm x 155mm x 68mm box made from 3mm perspex and welded with Chloroform to be strong and air tight. The strength is needed to ensure that it doesn't compress as depth changes, which will help balance buoyancy. Brackets for mounting internal components will be fabricated from perspex and welded to sides. The left side will be a removable lid, sealed with a rubber strip and secured with brass screws.
- Servo - The servo will be mounted at the rear end of the control box. A push rod will extend through a hole about 3 times the diameter of the rod. A rubber boot will be sealed to the control box and to the push rod to provide a water tight seal at any depth.
- Battery - The battery is one of the heaviest components and will be located on the bottom of the control box to provide stability. This and the remaining weight is balanced by the gas bladder.
- Controller - The micro controller will be mounted on the lid.
- Connections - All connections from inside to outside the control box will be done using plugs onto headers which are sealed into the wall of the control box with silastic.
+ Software
+ Overview
As for any software project, a phased approach is likely to lead to an outcome more quickly and avoid the pitfalls of the big-bang approach. This project is planned to be completed in 3 phases as follows.
Phase 1 - Initial analysis revieled that the PIC assembler code would be difficult to fit into the limited memory space (1kB) and even more difficult to debug. Phase 1 will be the development of a simple simulator in VB.Net. This will allow development and testing of control algorithms and operation of interupts for background processing. This simulator may even suitable for controlling the fish remotely to tune parameters.
Phase 2 - will involve the development of the PIC assembler code based on the final simulator logic and control registers.
Phase 3 - will involve testing and tuning control parameters with the robot in a tank.
+ Software Architecture
The software architecture options are limited by the minimalistic hardware used.
Ideally, the software would be developed in the highest level language available and produce the most efficient and compact code possible. The HI-TECH PICC Lite cross compiler would seem to the the ideal development platform.
- xxx - xxx
- xxx - xxx
- xxx - xxx
+ Communications Protocol
- Infrared Serial Interface - Communications between the host computer and the fish will be via a serial interface over infrared transport. When bench testing, a serial cable can be used as well. This serial interface will be used for live communications and for reloading program code into the fish when required.
- Protocol Options - The use of serial communications limits the style of communication that can be implemented to basically a master/slave arrangement where one end of the link sends commands and interprets responses, while the other (fish) end receives commands and sends responses. If TCP/UDP were used, it would be possible to implement multiple communications channels and asynchronous notifications. It is however possible to use buffers and structured commands to swap the role of master and slave. This design will implement the master/slave pattern with buffers to allow both the PC and the fish to act as master or slave as required.
- Master / Slave Communication - The Master will always initiate communication. It may continue sending commands without waiting for a response, or it may poll for a response to that command before proceeding. Messages must be processed in sequence by the Slave. If no response is received for a command before the response to the next command is receive (or a timeout occurs), the command will be re-sent.
- Message Format - All command and response messages will be formatted as 7 byte chunks as follows:
- XX - 2 byte ID which is unique to each device. Commands will be issued with the ID of the master and responses will be returned with the same ID as the original command.
- YY - 2 byte sequence number which is incremented on each command.
- CC - 2 byte command ID as ASCII characters representing the command (see below).
- D - 1 byte data or null filler (binary 0)
- Commands - The commands to be implemented will include:
- SS[0-255] - Set Speed
- LF[0-255] - Left (works only if speed > 0)
- RT[0-255] - Right (works only if speed > 0)
- DP[0-255] - Set Depth
- FM[0-255] - Flash Message as pulsed LED
- SP - Stop Fish
- OF - Standby Mode
- ON - Activate
- RV - Reverse Still need to determine how to achieve reversing
- FL - Follow Light
- Data Aquisition - The environmental variables that may be requested will include:
- CS - Current Speed
- CD - Current Depth
- LL - Light Level - Left/Right/Centre/None
- PR - Proximity - Left/Right/Top/Bottom/Left/Right
- BS - Battery status - V,I, estimated mins remaining
+ Development Language
- C - the most effective language is C for this type of embedded application where low level access to hardware, speed and minimal memory is required.
- Assembler - when all you have, assember is still OK.
+ Testing
- Unit Testing - xxx
- Black Box Testing - xxx
- Integration Testing - xxx
+ Electronics
+ Parts Listing
| System | Component | Qty | Cost ea | Note |
| Controller | PIC 16F627-04/P | 1 | $10 | |
| Controller | PIC Programmer Circuit Diagram | 1 | $70 | This diagram helped determine components and pin usage. |
| Depth Setting | MPX Pressure Sensor | 2 | $36 | Need 1 for depth and 1 for speed. |
| Proximity | MC34063A | 1 | $5 | Voltage converter to generate a high probe voltage from the 7.2V supply. |
| System | Component | Qty | $ | Note |
+ Controller
The controller is the brains of the robot.
It must support a basic set of Control Commands.
+ Requirements:
It will need to interact with and sensors for Proximity Detection, Depth Regulation, Light Levels, Power Monitoring, Speed and are described within the design of the robot subsystems.
It will need control actuators including: Proximity Detection, Propulsion, Depth Regulation.
It must also handle Communications.
Input/Output requirements are:
- 1 x analogue input - depth measurement using pressure sensor
- 1 x analogue input - speed measurement using ???? sensor
- 1 x analogue input - proximity detection - fin voltage measurement
- 2 x digital inputs - depth regulation motor limit detection
- 1 x digital input - under voltage warning sensor
- 2 x digital inputs - light level and following (left/right, equal/unequal)
- 1 x digital input - serial port
- 1 x digital output - serial port
- 1 x digital output - proximity detection - activate high voltage field
- 3 x digital outputs - proximity detection - select fin for voltage measurement
- 2 x digital outputs - depth regulation motor forward/reverse/stop control
- 1 x digital PWM output - propulsion and steering for tail servo
+ Preferred:
The Jaycar PIC16F627-04/P microcontroller was chosen for its local availability, low cost chip and programmer, and its capabilities.
- PIC16F627-04/P - is a cheap controller which is available from Jaycar outlets in Australia. It only has 35 instructions, 0-20MHz clock, 18 pins (small), 15 I/O pins, 1k program space, 224 bytes of data and 128 bytes EEPROM (settings between power off), 3 timers, 2 analogue comparators, a serial port, sleep mode (1 uA @3V), in-circuit re-program via 2 pins, 3 to 5.5V, 2mA operating. The circuit diagram for the programmer is here
+ Other Options
- AVR ATmega128 - See the application board for details
- OpAmp Circuits - See hyperphysics for theory, circuits and calculations.
+ Communications
Communications are an optional but useful component of this design. This design will incorporate some form of communications to allow fine-tuning of operational parameters and to provide command overrides.
This design should also consider the posibility of many robotic fish communicating with each other as well as a central computer.
+ Requirements:
Communications between the robot and external PC must support:
- Transmission of commands and requests for sensor readings from the external PC.
- Transmission of status changes from the robot.
- Bidirectional communications.
- Not require fixed wiring.
- Function through water from all locations in the tank and for all orientations of the robot.
+ Preferred:
- RS232 3 wire via Infrared - Serial communications using the RS232 protocol are simple and well supported in PIC devices. A single infrared detector/LED at each end of the link are all that is required to establish a connection. Direction and range could be a problem under water, so the software will need to retry communications. This is the simplest and cheapest approach that provides automonous operation.
We need to consider power consumption.
In order to send and receive, the detector and LED need to be mounted on the outer surface of the fish. You should check to see if you have an old mobile phone laying around with an integrated serial transceiver. TMR6101/TR2 pinout. TFDx4xxx pinout. TFDx6xxx pinout. HSDL-3201 pinout (most like the one in my old Nokia). The battery could also be of use in this project.
A useful resistor chart..
+ Other options:
- Bluetooth - Cost and integration with controller?Since Acacia already has bluetooth connectivity to the LAN and internet, this would appear to provide a simple way to link the fish to a Linux host for monitoring and control.
- Cabling - Cheapest but least practical mechanism.
+ Propulsion and Steering
+ Preferred:
- Servo Operation of Mechanical Tail - The tail requires a cyclic push/pull force. It must be held in full left or right positions whilst the fish is moving to steer. This force will be supplied using an RC Servo mechanism. The speed will be set as a voltage from 0V to 5V which will cause the tail oscillation. The speed sensor will be used in a feedback loop in order to dampen acceleration and adjust propulsion to match the set speed.
- Braking - If speed is set to zero, propulsion will cease and water friction/turbulence will slow and stop the fish. This is unlikely to be effective enough if the fish is streamlined, so a better mechanism must to be developed.
- Reversing - ??? TBD ???.
+ Other Options:
- Air Muscle Operation of Mechanical Tail - Air Muscles appear to be ideal until you consider the air supply, valves and sensing mechanisms. They are easy and cheap to build at any size.
- Servo Controlled Side Fins - To achieve up/down and roll control, 2 servos would be required. The control of side fins is not required if the gas bladder is used for depth control and roll control is not needed.
- Water Jet Pump - The robotic fish would actually be a robotic single legged octopus if we used this type of propulsion.
- Magneto-Hydro-Dynamic Propulsion - This is a simple but impractical mechanism using the interaction of electric and magnetic fields to generate thrust directly on the water with no moving parts. It would only work in salty water (conductive) and would require superconductors for the extreme magnetic field and very high voltages.
+ Measuring Movement
+ Preferred:
- Depth - Measured voltage from a MPX2010DB pressure transducer. This transducter outputs a 0-25mV variation over 0-10kPa pressure differential and so will require a differential amplifier to boost the output voltage to 0-5V. We can use part of a LM348 quad op-amp for this purpose.
- Speed - Differential pressure between a front and side facing tubes will provide a measurement of speed. Another transducer as used for depth measurement will be used with an amplifier as above.
+ Measurement Options
- Accelerometer - Feedback on movement
- System Voltage and Current - Energy conservation, refuel
- Speed - can be determine by:
- The voltage from a generator attached to a free rotating propeller in the water stream (anemometer).
- Some relationship to the energy expended less water resistance (not practical) Doppler shift of light or sonar reflected from surrounds. This is the ground speed.
Differential pressure between a front and side facing tubes (see manometer).
- Also see Speed for other options
+ Navigation and Proximity
The diagram shown below is a profile of the fish showing the primary components. The dotted lines roughly indicate the path of proximity detection current in the water surrounding the robot. Voltage equipotentials (not shown) are at right angles to these dotted lines and can be sketched in using curvilinear squares.
As soon as the robot has started its path in the tank, it will only be able to determine its speed and depth accurately. Using its proximity sensor array, it will only have a rough estimation of the direction and distance to other objects such as the tank walls. This means that it will not be able to determine its absolute position, but rather an position in relation to other objects. In order to be able to respond to "Go to x,y,z" commands, it must have a means of determining its absolute position.
+ Determining Position
Underwater positioning is a difficult problem to solve at any reasonable cost. Assuming that we can accurately map the sides of the tank, we still need to determine which end of the tank the fish is actually facing.
- Proximity Left/Right/Top/Bottom/Front/Rear - Provides information about distance to surrounding objects such as tank walls, surface, bottom and other obstacles. Could use sonar, infrared, electric field or just microswitches on bumper wires. The electric field is the preferred sensor at this point due to difficulties implementing other systems. To be tested.
- Electronic Compass - these devices will provide a compass bearings to varying degrees of accuracy using hall effect devices to measure the orientation of the earths magnetic field. The problem is their power consumption (30mA at 5V) and their slow response time of 2.5 sec.
- GPS - Too bulky and expensive for this application.
- Infrared - Depends on water clarity.
- Sonar - Sonar uses a transducer to create a sound which travels through the water and bounces back to one or more microphones (useually other transducers). The distance is calculated from the speed of sound in water (1438 m/s @ 8 deg C, increasing with temperature) and the time taken to hear the return echo. By using more than one microphone, the physical configuration and the slight difference in arrival time of the sound will allow a direction and a distance to be calculated. Where water density varies, sound will be refracted. The best working frequency is 20 kHz and works up to 1500 m with a 50 W pulse.
- Light Levels - Light sensors will provide the ability to both follow a light and to determine if the tank is light or dark. The sensors will be CdS cells connected to 2 comparators which convert the varying levels into 2 digital inputs for the microcontroller. Comparator #1 will be a comparator with hysteresis which output a 0 when left brightness is greater and 1 when right brightness is greater than left. Comparator #2 sums both left and right inputs and outputs a 0 when the sum is less that a preset value (dark) and a 1 when the tank is light.
+ Proximity Detection
+ Electric Field Sensing
This robot will sense its proximity to surrounding obstacles by selectively applying an electric field gradient to the surrounding water. It will periodically apply a voltage between the head and tail of the fish and sample voltages on the top, bottom, 2 front and 2 rear fins using a sensive high impedance volt meter.
By storing the standard fin potentials, differences can be translated to objects in positions relative to the left, right, top, bottom, front or rear of the fish.
In order to conserve battery power, proximity detection will only be used when required, with the applied potential being removed between measurements.
It is noted that some electrolysis of the electrodes may decrease the effectiveness of the proximity detection process. This could be addressed by choosing appropriate contacts and by ensuring that the software compensates for slow changes.
See MC34063A voltage converter to generate proximiting sensing voltage of 28V from 7.2V cells.
+ Other Options
Other options include the use of sonar, infrared, electric field or just microswitches on bumper wires. The electric field is the preferred sensor at this point due to difficulties implementing other systems. To be tested.
+ Orientation
Orientation is the tilt, roll and rotation of the fish compared to a nominal "standard" position in 3D space. Because the mechanical design of the fish will ensure that the fish is balanced by downward weight and upward lift from the gas bladder and is balanced at neutral buoyancy, there does not appear to be a need to control orientation.
This leads to a need to adjust the fish geometry such that when ascending the fish faces upwards and the converse. Fixes left and right rear fins with sufficient surface area should allow this to be acheived without any additional orientation control.
If orientation control was required, the following options are available.
- Independent Left and Right Fin Control - requires 2 more servos. Note that these would only work when the fish is moving and so would not be able to stabilise or control static orientation.
- Multiple Gas Bladders - this is probably impractical as it would interfere with the primary buoyancy control mechanism.
- Propellers - This would not fit with the aim to build a robotic fish, but could assist with reversing.
- Inclinometers - 3 would be required to monitor the posible degrees of freedom.
+ Power
Power supply, weight and recharging are important considerations in an automomous robot.
- Standby Mode - A low power mode will be implemented so that power consumption can be minimised simply.
- Battery - Some form of electrical supply is required to operate the controller, actuators and sensors. Most of the electronic components including the servo require a 5 volt supply, so 4 x 1.2 V NiCd cells providing 4.8 V appears to work. Adding another 2 cells in series will provide a secondary 7.2 V for the controller and operational amplifiers.
- Solar Cell and Supercap - This was not considered an option for the primary power source due to the flexible structure of the fish with small surface area viewed from above. This may however be an option for recharging using a behaviour of floating on its side on the surface of the water under a light.
- Compressed Air - A high pressure air source is needed if air muscles are used. These were considered impractical due to the need for pnuematic valves, control mechanisms and the danger of storing and recharging the compressed air cylinder. It was assessed that air leakage would be unavoidable from valves, connectors and from air muscle discharge and this would be undesirable for this project. An alternative is to use an additonal low pressure cylinder in a closed sytem, but a pump would be needed to maintain the pressure differential - powered by a battery! To eliminate all of the innefficiencies in this scenario, it was decided to use a servo.
- Power Budget - The following summarises the estimated power consumption of each electrical component:
- Micro Controller - 100% x 50mA x 3V = 150 mW
- Depth Control Motor - 1% x 200mA x 3V = 60 mW
- Proximity Sensor - 1% x 1mA x 7.2V = 7mW
- Tail Servo - 5% x 50mA * 3.6V = < 1 mW
- LEDs - 1% x 5mA x 1.2V = < 1 mW
- Pressure Sensor - 1% x 5mA x 5V = < 1 mW
- Light Sensors - 1% x 5mA x 5V = < 1 mW
- Total220 mW
- Battery Life@2400 mAh = 39 hrs
+ Setting and Regulating Depth
+ Background
If the average density of the robotic fish can be altered to achieve neutral buoyancy, no energy must be expended maintaining depth with propulsion systems.
Most fish regulate their depth using a gas bladder. Inflating the bladder decreases the average density of the fish and causes it to ascend. Oxygen is extracted from the water into its bloodstream using the gills and is released into the gas bladder at a fairly slow rate. The bladder is deflated by reversing the process which causes the fish to descend.
The problem is that this is a positive feedback system that can rapidly become unstable (see problems with submarines). Inflating the bladder causes the fish to ascend into lower pressure water which allows the gas bladder to expand further, accelerating the ascent. The reverse also occurs when the bladder is deflated. The water presure increases with depth, compressing the bladder and lowering the density. Without fine control and/or physical swimming effort, the fish will either plumet to the bottom or shoot to the surface. If the change in depth is large, the fish is likely to suffer physical damage to internal organs.
Thus the inflation/deflation of a gas bladder must be adjusted interatively to attain a certain set depth.
Note that natures positive feedback problem is caused by the compressibility of the gas bladder.
It is important for stability that the centre of buoyancy and the centre of gravity are at the same point, otherwise the inclination will vary when ascending and descending. If these are misaligned by even a small amount, their will be a large rotation to align these 2 points vertically.
+ Requirements
The depth setting mechanism must provide the following:
- Ability to adjust the depth of the robot by changing its average density.
- Use minimal power to adjust depth.
- Not consume any power when depth has been reached.
- Move forward when descending and backward when ascending (without tail action).
- Mimimise positive feedback problems associated with compressibility of the mechanism.
- Regulate depth automatically when external forces are applied.
- Ensure that the mechanism limits itsself to its maximum range of mechanical movement.
- Incorporate a dead-zone to limit unnecessary hunting once depth has been obtained.
+ Preferred
- Variable Capacity Cylinder - This is a combination of the submarine balast task and the gas bladder into what would appear a better and simpler mechanism. A large piston (60ml syringe) is linked to a pressure cylinder via a tube in a closed air system. A reversible electric motor is placed inside the air piston and drives a screw thread to vary to volume of air enclosed. The piston will not compress and so is not subject to positive feedback problems, whilst the motor may be stopped and the volume will not vary. The control circuit is linked to a pressure transducer so that the controller only needs to set the depth. Also see Electric Geared Pump and Piston ballast tank
- Let us assume that no part of the mechanical fish is compressible because the tail assembly is solid and surrounded by water and the controller is enclosed in a water tight incompressible case. This means that the density of the fish will be the [mass (kg)] divided by the [volume (m cubed) + variable capacity cylinder volume].
- Water pressure varies with depth, but so does water density to a much smaller degree, and our aim is to set the density of the fish to exactly match the density of water at the same depth.
- This is a combination of both the above options into what would appear a better and simpler mechanism. A large piston (ceringe) is linked to a pressure cylinder via a tube in a closed air system. A reversible electric motor is placed inside the air piston and drives a screw thread to vary to volume of air enclosed. The piston will not compress and so is not subject to positive feedback problems, whilst the motor may be stopped and the volume will not vary. The control circuit is linked to a pressure transducer so that the controller only needs to set the depth.
- In order to limit the travel of the piston inside the cylinder, limits in eiter software or using limit switches is required. This project will start with a software solution first and resort to limit switches if this does not work.
- In order to determine the size of cylinder required for this application, we need to specify the maximum depth that is required.
- Motor - It is important to first select the motor that will be used. It needs to turn slowly so that the volume of the cylinder is easily controlled. The physical dimensions (including gearbox) should allow it to fit inside the cylinder that will be used so that it remains protected from the environmental water. It is important to have no power to the motor when the depth is not being regulated. The operational current should be minimised to conserve battery power. The motor torque should be sufficient to operate the screw thread without stalling. Think tiny!
- Motor Choice - Stepper Motor A stepper motor rotates through a known angle for each set of pulses received. It has the advantage that we can get away without limit switches if we count pulses. It is probably better to have single limit switch so that the controller can calibrate itself at say the minimum cylinder air volume (maximim depth setting). There is a very small bipolar DELTA 15N20S stepper motor (or equivalent) inside every old CD-ROM drive, however these are 4 wire bipolar types that require 2 sets of complex H-Bridge driver circuits for each motor. We could use a single ED E1204 Bipolar Stepper Motor Controller ID. Bipolar creates 40% more torque for the same current. The L297 or L6506 (step controllers) and L298N or L293 (drivers) used together with flywheel diodes can drive a bipolar motor.
- Motor Choice - Brushed DC Motor A conventional brushed DC motor with gearbox ...
- Driver Circuit - There are a number of options for driving the motor from the controller digital outputs. Since we need forward and reverse and off control, we need to use at least 2 bits to control the motor. We need to source and sink about 30mA of motor current and drive this from low power digital outputs (1mA). The motor must run at full speed in forward or reverse to minimise power loss in control circuits and improve responsiveness.
- Driver Circuit 1 - Darlington Array - a darlington array such as the UNL2074B provides 4 darlington pairs with isolated pinouts. Each darlington pair is capable of sinking 500ma when driven by a digital input inside the 16 pin package. External clamping diodes will be required for the inductive motor load to protect the device from back EMF. No inverter is required as we can use one bit for ascend and one bit for descend. If both bits were turned on however there would be a supply short circuit through all 4 darlington pairs. On-time is 1usec and off leakage expected to be < 10uA. No pullup resistors on the inputs are required as these are built into the controller output lines. A 1sec timer will interrupt the CPU to adjust depth. Preferred for simplicity and cost.
- Driver Circuit 1a - Line Driver - The 74367 hex line driver can sink 32mA and source 5mA.
- Driver Circuit 1b - Line Driver - The 74244 or the 74HC244 octal line driver can sink 24mA and source 15mA for 130mW total.
- Driver Circuit 1c - Line Driver - preferred - The 20 pin 74HC240 octal tri-state line driver can sink 20mA and source 30mA for a total of 700mW. This option will require protection diodes.
- Driver Circuit 2 - Relays - The use of 2 x DPDT relays and 4 solid state relats was considered, but discounted due to the current demands of the coils, board space and additional inverters and other logic.
- Driver Circuit 3 - Servo Controller - The 51660L Servo Motor Controller can drive a motor in both directions using PWM input.
- Driver Circuit 4 - Stepper Motor Controller Or we could build a circuit from transistors and inverters or one out of the ULN2003 chip.
- Motor Control Circuit The depth setting (0-255) in the controller should cause the motor to be driven in the appropriate direction to ascend or descend until the pressure transducer indicates that the required depth has been reached. There should be a dead band so that the motor stops if the depth is within a set tollerance. The motor should operate automatically to counter any externally applied depth change.
- Circuit 1 - capture the pressure as an analogue input to the controller and programmatically operate the ascend/descend bits. This uses the minimum of hardware but requires periodic interuption of the main program to check and adjust depth.
- Circuit 2 - Preferred - output the required depth using 8 output lines to an 8 bit latch feeding a DAC. The output voltage is fed to a comparator circuit which also receives voltage from the pressure transducer. This circuit provides the ascend/descend bits and the dead-zone. This option uses 8 I/O lines but allows a set-and-forget approach to depth regulation. It also requires a number of hardware components including comparators.
+ Other Options
- Gas Bladder - An option is to use a Gas Bladder with a negative damped feedback circuit to stabilise depth changes automatically. The microcontroller outputs a voltage between 0V and 5V to the depth control mechanism. A small air cylinder is connected via a reversible pump to a gas bladder (balloon) in a closed air system. The circuit runs the pump in the appropriate direction until the presure transducer indicates the required depth has been reached. Thus the depth is changed and set just by setting the control voltage. The problem with this option is the compressibility of the gas bladder, air leaks due to attempting to maintain pressure differentials and if depth changes are force on the fish, valves will tend not to operate correctly as the outside pressure may be higher than the set bladder pressure.
- Ballast Tank - Submarines pump water into and out of balast tanks to adjust the buoyancy. This could be a better solution because reversible hydraulic pumps are easier to come by than pneumatic pumps.
+ Links
- See hyperphysics for op-amp theory, circuits and calculations.
- See Autonomous Robotic Fish.
- See Essex Fish.
- See Propulsive Model.
- See Maneuvering and Stability Performance of a Robotic Tuna.
Ideas
This project is huge and there are many design decisions that have been made that are most likely sub-optimal. If you have any better ideas, please feel free to email me. Here are some of my ideas on improvements:
- TBD - I have nothing at the moment until it is completed.
Click here to check out the list of other projects.
You may also like to click here to check out the list of Artificial Intelligence projects.
If you would like to get any further information on this or any of the other projects shown on this web site, please send an email to Acacia Lateral Technologies. or place a comment in our Guest Book
You might also like to submit your idea to our Free Ideas page for the benefit of other like-minded soles.