Electronic Design

Overview of Drosophibot II's electronic design, taken from Clarus Goldsmith's dissertation.

PCB CAM files and design files for import into Fusion can be found at this public GitHub repo, in addition to the lab Google Drive:

Overview

The robot is currently powered by an external Mean Well HEP-600-12 power supply (Mean Well Enterprises Co., Ltd., New Taipei City, Taiwan) able to supply up to 40 A at 12 V. Power is routed from the supply to each servo by a custom circuit board. This board also includes communication traces to the servos. In order to collect sensory feedback analogous to the CS on insect legs, the robot includes 12 strain gauge rosettes of three strain gauges each, totaling to 36 strain gauges across all six legs. The following sections will discuss the major components of Drosophibot II's electronics, including the power distribution PCB, strain gauges, and the custom PCBs developed to facilitate strain data recording.

Power distribution board

Figure 1: Schematic of the power distribution board.

A custom circuit board was first developed to distribute power from the external power supply and signal from the U2D2 serial converter to the Dynamixel servomotors in each of the robot's legs. Figure 1 shows the circuit schematic of this board. The circuit accepts power and ground inputs from the power supply via a two port terminal block and signal input from the U2D2 via a Molex 22-03-5035 PCB header (Molex LLC, Lisle, IL) (Fig. 1, far left). The ground and signal traces from these inputs are directly connected to the appropriate pins of six additional 22-03-5035 headers, one for each leg.

The power input for each leg connects to one pin in a 2 position pin header. The pins of these headers are bridged by header shunts on the physical PCB to form the connection between the leg and the supply power. This design allows the user to turn off power to individual legs by removing the shunt while still maintaining power for the whole system. The other pin of the pin header connects to both the voltage pin of the leg's Molex header and an SMD LED in series with a 2050 Ω\Omega resistor. This LED serves as a visual indicator of power to the leg.

Figure 2: CAD renderings and photos of the power distribution PCB. A) CAD renderings of the power PCB with major dimensions marked. B) Photo of the PCB on the thorax of the robot. C) Top views of the powered PCB with (i) all jumpers in place and (ii) the right side jumpers removed, cutting power to those legs.

Figure 2A shows renderings of the final power board PCB layout. The board is a two layer PCB with a top ground plane and bottom power plane, measuring 57.13 mm in length by 38.10 mm in width (or 1502 mil by 2833 mil). It is intended to be mounted on the robot's thorax with the terminal block facing posteriorly. This orientation allows the power and signal cables connected into the terminal block and the U2D2 header (labeled ``COM" on the board), respectively, to extend straight behind the robot while it is walking forward. All traces on the board's top layer (i.e., the signal trace and voltage traces between the 2-pin header and the LED) are 10 mil in width. Power traces on the bottom layer between the pin headers and the Molex headers for each leg are 60 mil. Figure~2B shows the manufactured board in-use on the robot's thorax, while Figure ~2C shows an overhead view of the finished board fully powered (i) and with the header shunts for the right half of the legs removed (ii), highlighting the functionality of the shunts and the associated indicator LEDs.

Strain gauges

Figure 3: Strain gauge locations on the robot's legs. A) Strain gauge locations and orientations on the middle and hind legs, called out on a middle leg. B) Strain gauge locations and orientations on the front legs.

Each leg of Drosophibot II includes two S5198 rectangular strain gauge rosettes (Micro Measurements, Wendell, NC; MMF402103 on DigiKey) comprised of three strain gauges each, totaling 36 strain gauges across all six legs. Strain gauges were included on the robot to enable collection of biomimetic load feedback; by including strain gauges in biological locations on Drosophibot II’s limbs, strain data that may be available to the nervous system throughout six legged stepping can be hypothesized.

Figure 3 shows the specific strain gauge locations on a middle/hind leg configuration and a front leg configuration. The two rosette locations on each leg correspond to the trochanteral and femoral CS fields in Drosophila (Dinges et al. 2021). The trochanteral rosette is affixed to the dorsal face of the trochanteral segment in each leg (Fig. 2). For the middle and hind trochanters this is achieved through a slightly lengthened dorsal edge, while for the front trochanters a flat indentation is included instead (more details can be found in Mechanical Design). The trochanteral field CS in Drosophila are primarily oriented at 0o and 90o from the major axis of the segment and hypothesized to encode axial and lateral strains. To achieve the same orientations on the robot, the rosette was mounted at a 45o angle from the segment's major axis, orienting sensors at 0o, 45o, and 90o from the segment's major axis.

The femoral rosette is affixed proximally to the ventral face of the femoral plastic component in each leg (Fig. 2). Since the TrF servo mounting is identical in each plastic femur segment, this mounting is the same across all legs. In Drosophila, the femoral field includes CS that are primarily oriented at 45o from the segment's major axis. This orientation lines up with that of the strain gauge rosette, so the femoral rosette was mounted in-line to the segment's major axis.

Strain collection boards overview

Figure 4: Block diagram of the strain recording electronics setup.

In addition to the custom power distribution PCB, I designed PCBs to deal with collecting data from the strain gauges on each of the robot's legs. This goal can be broken up into two major tasks:

  1. Amplifying the voltage signals from each sensor

  2. Routing all 36 analog signals into my chosen microcontroller

I thus designed PCBs for both of these tasks. A block diagram of the strain recording architecture is presented in Figure 4. It functions as follows: a custom strain amplifier circuit capable of amplifying six strain gauge signals with adjustable Wheatstone bridge balancing is affixed to each leg of the robot. These boards send their amplified strain signals to a custom 36 channel demultiplexer (deMUX) PCB, which supplies power, ground, I2C control signals [referred to as the SCL and SDA], and two digital signals for use in controlling components on the six strain gauge amplifier board. The deMUX board nests on top of an openCM microcontroller and routes the 36 total strain signals into six of its analog ports. The microcontroller in turn supplies power, ground, the I2C connections, and the state of 13 of its digital pins for use as control signals for the deMUX and the strain amplifiers. Finally, a computer running the MATLAB program that controls the robot during testing (detailed in Section~\ref{s:controlSoft}) receives the strain data from the openCM via serial connection.

The following sections will explain the strain amplification and deMUX PCB designs in more detail.

Strain amplification board

Strain gauges are able to detect strain because deflection of the gauge's copper traces changes its total electrical resistance. As such, strain gauges are effectively variable resistors. This change in resistance can be measured by wiring the strain gauge into the arm of a Wheatstone bridge. If the circuit is balanced when the strain gauge is unstrained, any deflections will produce a voltage difference between the two arms and unbalance the bridge. These two voltages can then be subtracted to produce a proxy for the magnitude of the strain. Typically these voltage differences are too small to be read from directly, so the Wheatstone bridge will be connected to an operational amplifier circuit for amplification.

Strain gauges are highly sensitive to environmental conditions such as temperature and humidity. For my work, this sensitivity primarily results in each gauge having a different ``offset" day-to-day, depending on the environmental changes in the room that day. These rest points can then drift high or low enough that the full range of voltage values during a test can no longer be detected by the microcontroller; the signals either become so low they incorrectly read as 0 V, or so high they go over the 5V limit of the analog pin. Previous solutions have used a 10 Ω\Omega analog potentiometer in series with the strain gauge in the arm of the Wheatstone bridge. This design enables the user to adjust the bridge's balance by changing the arm's overall resistance, thus adjusting the signal's rest point. However, this solution requires every circuit to be manually calibrated each day, which becomes impractical for the number of circuits present on the robot.

To overcome these impediments to data collection, I created a modified Wheatstone bridge circuit that uses a digital potentiometer (digipot) to set the rest point. This allows me to automatically set the rest point of every sensor in software at the start of each walking trial. The Wheatstone bridge was then connected to an instrumentation amplifier to amplify the signal. To my knowledge, no one else has published an analog amplification circuit that allows for digitally setting the signal's rest point in this manner.

Single strain amplifier sub-circuit

Figure 5: The schematic of the digitally calibrate-able amplification circuit for a single strain gauge. Block diagrams for the MCP4532T digital potentiometer and the INA821IDR instrumentation amplifier were adapted from the manufacturer provided datasheets.

Figure 5 shows the circuit schematic for the digitally calibrate-able single strain amplification circuit I developed. The circuit uses a Texas Instruments MCP4532T-502E 5kΩ\Omega digital potentiometer (Texas Instruments, Dallas, TX) in parallel with a smaller resistor in the opposite arm of a Wheatstone bridge as the strain gauge to facilitate adjustment of the bridge. Including the digipot as an arm of the Wheatstone on its own was found to render the circuit inoperable, thus the parallel wiring was necessary.

Figure 6: An example schematic of the adjustable Wheatstone bridge with each component labeled as it appears in this section's equations.

To determine specific resistor values, I used the governing equation for a balanced Wheatstone bridge combined with my desired digipot wiper value for balancing and adjustment granularity for each ``tap" of the digipot. Figure 6 shows an example of my Wheatstone schematic as a visual aide for this analysis. For a balanced Wheatstone bridge, the following equation must hold:

Rx2R1=RSGR3      (1)\frac{R_{x2}}{R_{1}} = \frac{R_{SG}}{R_{3}}~~~~~~\textbf{(1)}

Where R1 is the resistor in the digipot arm that is not in parallel with the digipot, R3 is the resistor in the strain gauge arm (i.e., the 352 Ω\Omega resistor in Fig. 5), RSG is the grid resistance of the strain gauge, and Rx2 is the combined resistance of the digipot and its parallel resistor.

Rx2=11/R2+1/Rx      (2) R_{x2}= \frac{1}{1/R_2+1/R_x}~~~~~~\textbf{(2)}

Where R2 is the value of the parallel resistor and Rx is the resistance of the digipot at the desired tap value. The grid resistance for the strain gauges used on the robot is 350 Ω\Omega. Thus, RSG=350 Ω\Omega. To match RSG with the closest available off-the-shelf resistor, R3 was set to 352 Ω\Omega. Thus, Eq. 1 becomes:

Rx2R1=350352=0.9943      (3)\frac{R_{x2}}{R_{1}} = \frac{350}{352}=0.9943~~~~~~\textbf{(3)}

Additionally, for a desired calibration tolerance per step TOL (where TOL is a percentage between zero and one), the step resistance of the digipot Rtap needs to be TOL of the total resistance in the bridge arm. The MCP4532T-502E has an Rtap value of 39 Ω\Omega. Two new equations can then be created using this value, Eq. 3 and Eq. 2:

11/R2+1/RxR1=0.9943      (4) \frac{\frac{1}{1/R_2+1/R_x}}{R_{1}} = 0.9943~~~~~~\textbf{(4)}
11/R2+1/(Rx+39)R1=0.9943+TOL      (5)\frac{\frac{1}{1/R_2+1/(R_x+39)}}{R_{1}} = 0.9943 + TOL~~~~~~\textbf{(5)}

Both of these equations can be solved for 1/R2 then set equal to produce a generalized equation for R1 in terms of TOL and Rx:

R1=TOL1Rx1Rx+39      (6)R_1=\frac{TOL}{\frac{1}{R_{x}}-\frac{1}{R_{x}+39}}~~~~~~\textbf{(6)}

This equation can then be used in conjunction with one of the equations for 1/R2 (Eq. 4 or 5) to pick R1 and R2 values based on the desired adjustment tolerance and wiper tap at balance. I will reproduce the equation resulting from Eq. 4 here for completeness:

1R2=10.9943R11Rx      (7)\frac{1}{R_2}=\frac{1}{0.9943R_1}-\frac{1}{R_x}~~~~~~\textbf{(7)}

I iteratively used Equations 6 and 7 alongside a catalog of commercially available SMD resistor values to settle on values of R1= 80.6 Ω\Omega and R2=85.6 Ω\Omega. These values yield a theoretical tolerance adjustment value of TOL=0.13% and a digipot balance resistance of Rx=1521 Ω\Omega. This Rx value corresponds to tap 39 out of 128 in the digipot, allowing calibration over the majority of the component's range.

Tap values are set in the digipot over I2C connection. To do so, the component requires a component ID configured by setting its A0 and A1 pins to voltage or ground. The value of these pins (0 for ground, 1 for voltage) is then appended to the baseline binary address of the component (01011), resulting in four possible unique IDs ranging between 43-46 when converted to base-10. The example circuit presented in Figure 5 shows a digipot with ID 45 (i.e., a binary address of 0101101, where A1 is set to ground and A0 to voltage).

Connections from each arm of the adjustable Wheatstone bridge are then wired into the terminals of a Texas Instruments INA821IDR instrumentation amplifier (Texas Instruments, Dallas, TX) to amplify the voltage difference produced by the strain gauge's deflections. This component features three operational amplifier circuits wired together such that they will amplify the difference between two signals with a gain dictated by a gain resistor RG provided externally by the user. I used a 649 Ω\Omega gain resistor in this circuit, producing a gain of ~77 (the equation relating gain to RG value can be found in the product's manual). This value was chosen experimentally to provide the maximum possible amplification while still retaining the ability to change the signal's offset without overloading the instrumentation amplifier: Larger gains were found to decrease the range of digipot taps before the instrumentation amplifier overloaded due to the inherent sensitivity of operational amplifiers; while smaller gains allowed the circuit to retain more adjustment range, they also had the potential to make the strain signals indistinguishable from noise. Experiments with the circuit showed that the gain could be as low as 56 (corresponding to RG=898 Ω\Omega) while still retaining functionality in both aspects.

Figure 7: An example of how the resting strain value of a single strain amplification circuit changes as the digital potentiometer wiper value increments along its range.

Figure 7 plots the resting strain values of the amplification circuit over the range of digipot wiper values. The adjustment amount for each tap is nonlinear due to the parallel configuration of the digipot in the circuit. The range of wiper values is lower than what was initially designed for in the Wheatstone circuit due to the sensitivity of the instrumentation amplifier. However, the circuit can still be adjusted over 63 wiper values (from 38 to 101). Adjustment amounts range between 10 and 41 micro-strain per tap.

Six strain amplifier circuit

Figure 8: Schematic of the six strain digitally calibrate-able amplifier circuit. The schematic for the single strain gauge amplification circuit can be found in Fig. 7. Schematic for the 74HC4066D quad analog switch was adapted from the manufacturer datasheet.

Six of the single adjustable strain amplification circuit from the previous section were then combined into one circuit to be included on each leg of Drosophibot II. Creating a six-strain amplification PCB enabled recording from up to six gauges on a leg at once. With the robot's current strain rosettes, this translates to all three sensors from two locations on the legs or two sensors from three locations. Figure 8 shows the schematic for the six strain gauge amplifier circuit. The circuit receives power (VCC), ground (GND), I2C connections (SCL and SDA), and two digital signals (D0 and D1) as inputs and outputs the six strain signals (STRAIN 0-5) via a twelve position pin header (Fig. 8, top). The voltage, ground, and strain traces directly connect between the pin header and each single strain amplification sub-circuit. Due to the maximum of four unique IDs for each digipot, the SCL and SDA traces interface with the strain circuits via two Toshiba 74HC4066D quad analog switches (Toshiba Electronic Devices & Storage Corporation, Kawasaki, Japan). This configuration enabled me to multiplex the I2C signals into two groups, each of which only connects to three digipots at once (i.e., ``half" of the circuit). The state of the D0 and D1 signals control which half of the circuit receives the I2C connection at any given time. Before entering the switches, each I2C trace receives voltage via a 2 kΩ\Omega pull-up resistor. As I2C operates through drops in voltage, these resistors provide a high voltage from which to drop.

Figure 9: Renderings and photos of the six strain amplifier PCB. A) Rendering of the board with major dimensions marked. B) Photo of the amplifier board on a hind leg of the robot. C) Photo of the amplifier board on a front leg of the robot.

Figure 9 shows renderings and photographs of the PCB created for the six strain amplifier circuit. The board is a 2-layer PCB with a top ground plane and bottom power plane, measuring 47.7 mm long by 40 mm wide (or 1875 mil by 1575 mil). This size allows it to mount on the side of the MX-28 actuator for the TrF joint in the femur of each leg via a 3D printed Onyx bracket (Fig. 9B, C). This bracket is shown in greater detail in the Mechanical Design section. Each trace on the board is 10 mil in width. For the physical PCBs, TE Connectivity 6-103635-1 right angle socket headers were used for the input/output header (TE Connectivity, Galway, Ireland). These headers include latches that prevent connections loosening or detaching while the robot moves.

Demultiplexer board

In addition to strain amplification, the electronics infrastructure for strain data collection also needed to include some manner of routing for all 36 input signals. My chosen microcontroller for collecting the strain data, the Robotis OpenCM 9.04, has only 10 analog input pins. While other commercially available microcontrollers include additional ports, they still do not come close to the 36 inputs necessary. Additionally, they are not natively designed with the headers necessary to interface with Dynamixel servos like the OpenCM 9.04. Thus, for my chosen microcontroller some method of de-multiplexing is necessary to be able to read all strain signals from the limited analog ports.

12 input deMUX sub-circuit

Figure 10: Schematic of the deMUX sub-circuit for routing the inputs of two strain amplifiers, corresponding to two legs of Drosophibot II. Three of these circuits are combined in Figure~ to route all 36 strain inputs from the robot.

Figure 10 shows a subset of the deMUX circuit for 12 inputs (i.e., two legs). This circuit requires 14 inputs from the full deMUX circuit: power (VCC), ground (GND), two independent I2C signal groups (SCL0 and SDA0, SCL1 and SDA1), and eight digital signals (D0-7). The circuit also receives two sets of six strain signal inputs each from the legs (STRAIN 0-5). In Figure 10, strains coming from the same sub-circuit in the amplification PCBs are given the same name.

The I2C signals and D0 and D1 digital signals are routed directly as outputs to each leg's six strain amplifier PCB alongside power and ground. Digital signals D2-D7 are then used to control the states of three 74HC4066D quad analog switches. Each of the twelve strain signals from the legs are connected to one of the input pins of the switches. In Figure 10, Leg 1's strains are connected to all of the top switch's inputs and half of the middle switch's inputs. Leg 2's strains are then connected to the other half of the middle switch's inputs and all of the bottom switch's inputs. The corresponding output pins for each leg are then connected to a shared output signal (A0 or A1). Thus, the switches control which strain location is connected to each leg's output based on the states of digital signals D2-D7. By wiring the strain signals into the switches in the manner described above, the digital signals control the switches to send the strain from the same location across both legs to their outputs simultaneously (i.e. STRAIN 0 from each leg will be connected to the leg's corresponding output when D2 is set HIGH). Each input trace also has a 220 Ω\Omega pull-down resistor attached to it to ensure the signals pass through the switches correctly. Without the pull-down resistors, the signals on the output side of the switches are too weak to distinguish from noise.

I2C MUX sub-circuit

Figure 11: Schematic of the I2C MUX sub-circuit for routing the SCL and SDA signals to an individual amplifier board. This facilitates adjusting the digipot value for that board.

In addition to deMUXing the strain signals, the routing PCB also needed to be able to split the I2C traces across the six legs. Similar to the switching already present on the amplifier boards (discussed in the six strain amplification section), this routing was necessary due to the limited number of unique IDs for the digital potentiometers. If the I2C channels were applied to all legs at once, there would be groups of six potentiometers with the same IDs, making communication impossible. As such, the sub-circuit presented in Figure 11 splits the SCL and SDA inputs into six outputs each, with digital inputs D0-5 dictating which output connects to the input. Similar to the 12 input deMUX, the SCL and SDA traces are controlled by the same digital pins (i.e., SCL0 and SDA0 are both sent the input signals when D0 is HIGH). This sub-circuit receives power, ground, SCL, SDA, and digital inputs D0-5 and outputs SCL0-5 and SDA0-5.

36 input deMUX circuit

Figure 12: Schematic of the full 36 input demultiplexer circuit.

The sub-circuits from the previous two sections were then combined to form the full 36 input deMUX circuit (Fig. 12). This board is intended to sit directly on top of the OpenCM, so includes two 20 position pin headers that correspond to all of the pins on the OpenCM. Not all of the OpenCM pins are used for this circuit; the table below summarizes which OpenCM pins are used in the deMUX circuit and for what purpose. The 5V and GND pins on the board provide power to all other circuits, including the six strain amplifiers. Analog pins A0-5 serve as the inputs to the microcontroller that each leg sends its strain data to. They connect to the A0 and A1 outputs of the three 12 input deMUX sub-circuits. Pins A6-9 are then grounded to ensure minimal noise to the other analog pins. D10-15 are inputs to the deMUX sub-circuits that control the switches therein. Similarly, pins D16-D21 serve as inputs to the I2C MUX sub-circuit to control switching of the SCL and SDA connections between legs. D22-D23 finally serve as the digital control signals for the two switches on each amplifier board. As such, they are fed as inputs to each 12 deMUX sub-circuit to pass along to the amplifiers. The SCL and SDA pins [also referred to as D24 and D25 in the microcontroller documentation, respectively] connect to the I2C MUX sub-circuit and are split into outputs SCL0-5 and SDA0-5, which then connect to the three 12 deMUX sub-circuits. All together, this circuit enables:

  1. Reading from 36 amplified strain signals near simultaneously by switching which strain location is connected to the six analog input pins.

  2. Adjusting all 36 inputs' rest points by switching both which leg and which side of the amplifier boards the I$^2$C command signals connect to.

OpenCM Pin(s)
Function in deMUX Circuit

5V

Power

GND

Ground

A0

Destination for leg 1 (LH) strains

A1

Destination for leg 2 (RH) strains

A2

Destination for leg 3 (LM) strains

A3

Destination for leg 4 (RM) strains

A4

Destination for leg 5 (LF) strains

A5

Destination for leg 6 (RF) strains

A6-9

Grounded to reduce noise in pins A0-5

D10-15

Control of analog switches routing which strain signal from the amplifier boards connects to the output analog pins

D16-21

Control of analog switches routing which leg's amplifier board the microcontroller's I2C signals connect to

D22-23

Control of analog switches routing which "half" of the targeted amplifier board the microcontroller's I2C signals connect to

D24

I2C SCL source

D25

I2C SDA source

36 input deMUX PCB

Figure 13: CAD renderings and photos of the 36 input de-multiplexer PCB. A) CAD rendering of the board with major dimensions marked. B) Photo of the finished PCB on the thorax of the robot. C) Photo of how the board nests on top of the openCM microcontroller.

Figure 13 shows renderings and photographs of the physical PCB created for the 36 input deMUX circuit presented in the previous section. The board is a two layer PCB with a top ground plane and bottom power plane, measuring 91.44 mm long by 50.47 mm (or 3600 mil by 2000 mil) (Fig 13A). Each trace on the board is 10 mil in width. To prevent EM interference between signals, traces on the top of the board were run vertically and traces on the bottom run horizontally, with trace overlaps occurring at 90 degree angles whenever possible. The current design includes 20 position pin headers soldered onto the underside of the board to facilitate mounting directly on top of the OpenCM into the corresponding socket headers on its top face. However, this configuration could also be replaced with its inverse; 20 position socket headers soldered onto the top face of the board to interface with pin headers on the underside of the OpenCM. While simple 12 position pin headers are used at the strain amplifier board connection points in the rendering, TE Connectivity 6-103735-1 latching vertical socket headers (TE Connectivity, Galway, Ireland) were used in the physical PCB to prevent loosening or detachment during robot walking. Custom ribbon cables were manufactured with TE Connectivity 6-103957-1 rectangular receptacle connectors (TE Connectivity, Galway, Ireland) on each end to interface with the latching headers on the deMUX and strain amplification boards, connecting the boards together.

References

G. F. Dinges, A. S. Chockley, T. Bockemühl, K. Ito, A. Blanke, and A. Büschges, “Location and arrangement of campaniform sensilla in Drosophila melanogaster,” Journal of Comparative Neurology, vol. 529, no. 4, pp. 905–925, 2021, doi: 10.1002/cne.24987.

Last updated

Was this helpful?