Analog Reference PCB and Swing/Stance Transition Sensing

Individual Progress

Analog Voltage Reference PCB

Since the last progress review, I developed a circuit that provides a clean +/-5V reference from battery voltage (Figure 1) and buffers the linear potentiometer wiper before sending it to the DAQ (Figure 2).

Figure 1: Analog voltage reference, showing +/-15V converter, 10V analog reference, and instrumentation amplifier

The first step in the voltage reference is to convert battery voltage to +/-15V power via a pre-packaged solution from Murata. I had initially experimented with building my own circuit, using a LDO and switching inverting regulator, but the LDO was not a good choice due to overheating. The current sourced by the switching regulator was higher than I had expected, and there seemed to be EMI generated by the capacitor associated with the switching regulator. I believe that the Murata packaged solution will be easier to use, and doesn't cost much more than the combination of ICs that I had chosen. In the meantime, Robin and Jess built the original circuit on a breadboard, and moved the switching capacitor to reduce EMI. Until we have time to assemble and test the new circuit, we will continue using this circuit.

Figure 2: Linear potentiometer circuit, showing buffering and inverting op-amps

This +/-15V voltage is then converted to a +/-5V analog reference signal using a reference circuit taken from the datasheets of the two components involved. The comparator input of the 10V reference is attached to the desired -5V analog reference, which is the overall output of the instrumentation op-amp (in-amp). The desired +5V analog reference is wired to the in-amp in an inverting configuration, with the in-amp defaulting to unity gain. Because the two analog references are constrained to be the sign inverse of each other, the circuit quickly converges to the desired +/-5V reference.

The second part of this circuit consists of two dual op-amp ICs. One IC is dedicated to each linear potentiometer, with one of the op-amps in a unity gain non-inverting configuration that feeds into the second op-amp, which is in a unity gain inverting configuration. The differential voltage range when the +/- WIPER inputs are connected to a DAQ is +/-10 volts, which gives full resolution when used with the Elmo drive's analog input. Even though we are not currently using the Elmo to read this signal, the USB DAQ is configurable to this voltage range.

If I had known that we would not be using the Elmo as our DAQ, I could have chosen an alternative voltage range for the voltage reference, which would have made the voltage converter selection easier. There are many converters that output +/-5V, but this voltage cannot be used for the rail supply of an op-amp that will hit +/-5V. In contrast to the Elmo, the USB DAQ we use has options for +/-5V and lower values.

Ultimately, the decision I made on which voltage range to use may turn out to be correct. One simple configuration for the leg eliminates the USB DAQ and uses the Elmo drives to read the linear potentiometer voltage. Alternately, in a real product version, the linear potentiometer may be eliminated and replaced with the difference between the load (absolute) and motor encoders, giving the spring deflection. This will probably be necessary because the motor encoders are incremental, so they lose their absolute position reference when the leg is depowered.

Finally, I laid out the PCB and ordered two copies using Advanced Circuits' Bare Bones PCB service, which does not include soldermask or silkscreen but which provided a weekend-turn with 2 day shipping for the same price as their $33 board/educational pricing, which takes more than a week.

FSR Swing/Stance Transition Detection

After our demo on Monday, I took another look at the swing/stance detection, and John suggested placing the FSR in the iWalk adapter itself. It turns out that this works much better than placing an FSR inside the knee attachment. The knee attachment is clamped tightly, which places too much pressure on the FSR even when the leg is in swing. This makes detecting the transition very difficult.


By contrast, the FSR in the iWalk knee support experiences almost no pressure when the user is in swing, and a simple voltage divider configuration serves to detect the transition using the existing code. The transition can be sensed almost immediately, and with low false-positive/negative rates. Future work in this area (eg. next semester) will focus on designing a sensor that can be integrated into the knee attachment itself or into the base of the foot, allowing use by an amputee.

Motor Encoder - Joint Angle Equivalence

Some trigonometry needs to be done to establish the equivalence between motor-top encoder reading and joint angle. This calculation also gives the relationship between force in the actuator and torque on the joint. I have tried two different methods so far, both giving incorrect results. The first uses law of cosines and exact dimensions of the leg to determine the angles of the triangle that the actuator makes with the shank. The second method assumes that the actuator angle with the shank does not change by much, which is a valid assumption because the angle does not vary by more than several degrees. Therefore, the relative actuator deflection can just be treated like the leg of a right triangle where the hypotenuse is the actuator lever arm. Therefore, the relative deflection is just sin(angle) * lever arm length. In the worst case, we will just linearly interpolate between the low and high values of the joint angle and spring deflection. This is also a valid assumption because of the small-angle approximation to the sine function.


FSR Swing/Stance Transition Detection

We are trying to balance the number of sensors on the leg (and associated concerns about robustness, wiring, power) with the computational complexity of detecting transition events. At first, Robin developed an accurate, but computationally complex method for detecting the transitions using only the ankle linear potentiometer. However, we need this algorithm to run in real time with a loop speed of 0.5-1kHz. Therefore, we explored other options, and found that adding a FSR to the knee pad of the iWalk gives a good balance of complexity and performance.

Motor Encoder - Joint Angle Equivalence

This calculation is still causing us problems. I haven't been able to figure out where the error is coming from, and so I keep picking simpler and simpler versions of the calculation in order to debug it. One problem is that I'm not familiar enough with LabView yet to be able to debug quickly. However, in the end we can just use linear interpolation and not suffer too much in performance if we can't get a higher-fidelity approximation to work.


Actuator Improvements & Tuning, System Integration

Individual Progress

Actuator Robustness and Electronics

Since the last progress review, I worked to make the actuators more robust (Figure 1). I filed down the heat sink attachments so that they fit in between the threaded rods that attach the actuator to the joint at the top. I also ordered spacers from McMaster Carr to take the place of the old method of securing the threaded rods, namely pairs of nuts. Using the spacers reduces the fine-tuning step where the inner nut must be turned to be at the correct distance along the threaded rod, making assembly and disassembly more rapid. I have a greater appreciation for easy assembly and disassembly after having to take the actuators apart and rebuild them multiple times.

Figure 1: Knee and ankle actuators, showing limit switch relays, motor choke (ankle), and linear potentiometers

I also mounted the encoders on the head of the Maxon motors, using a laser-cut piece of acrylic. I used dowel pins to align the encoders. Next time, I would either order the motors from Maxon with the encoders already installed, or pick the adhesive-backed US Digital versions of these encoders because they provide an alignment tool that allows for easy assembly. Although they are more expensive ($120 instead of $40), the time savings would be significant. Our current encoders incorporate a line driver and differential outputs for high signal robustness to noise.

On that note, I used Loctite Threadlocker 242 to semi-permanently fasten the nuts that hold the ballscrews on. I kept having to retighten them due to the lubricant placed on the adjacent thrust bearings. After completing this laborious process several times (involving disassembly), I chose this glue because it can be loosened with hand-tools if necessary. I placed threadlocker on the threads and tightened the bearing hand-tight. The actuators still move smoothly and the ballscrew nut has not loosened at all since.

The large motor choke in the picture is necessary due to the low inductance of the Maxon RE40 motor on the ankle. The PWM signal output by the Elmo drive is not smoothed sufficiently, and confuses the driver, causing it to lose control at RPMs over about 2500. After consulting our contact in Professer Geyer's lab, I identified an appropriate inductor and wired it in series with the motor.

The limit switch modules consist of two relays per actuator connected to diodes. When the positive rotation limit switch is triggered, the relay switches the current path to include a diode, wired such that no current can flow in the positive direction. This means that the motor can only move away from the limit switch, causing it to release. The limit switch system is fail-safe, such that if wiring is cut or broken, the relays will return to their unpowered state, preventing current flow through the motor.

Entire Elmo Cabling Setup

I also finished the integration of the Elmo drives into a complete system that allows testing and tuning even while not mounted on the leg (Figure 2). I tried tuning the actuators while mounted on the leg, and the results were scary due to small amplitude, but high frequency vibrations. Additionally, tuning the motor parameters while the motor is not coupled to the ballscrew gives very different parameters than when the actuator is assembled.

Figure 2: Driver integration, showing knee and ankle actuators, USB-to-RS232 converters and cables, emergency stop, battery, and Elmo drives

Thankfully, the Elmo software has an autotuning function that works fairly well. At least for now, we will continue to use the autotune function.


Elmo Whistle Digital Inputs

The digital inputs on both Elmo boards appear to be broken. We have been unable to determine the reason for this. Therefore, I created a hardware limit switch solution. We had planned to use the digital inputs to read the swing-stance transition using a threshold circuit on a force-sensitive resistor. Instead, we will use a DAQ device to read the potentiometers giving swing-stance transitions. Most likely, the optocouplers that operate the digital inputs are burnt out. Our contact in Professor Geyer's group has never used the digital inputs.

Analog Power Source

Ordinary low-dropout regulators do not provide a clean enough analog reference voltage to get high fidelity force measurement with the linear potentiometer. Instead, I am constructing a 5V positive and negative voltage reference circuit that will enable 14-bit resolution measurements with the Elmo, and 12-bit resolution measurements with the DAQ, giving us about 6 Newton resolution out of a force range of positive 3000N to negative 3000N.


Fabrication; High-Performance Motor Driver

Individual Progress

Mechanical Fabrication and Assembly

Since the last progress review, we completed the mechanical fabrication and assembly of the leg (Figure 1). We chose a shank with a rectangular cross-section, which although heavier relative to bending modulus, is much easier to mount components to.

Figure 1: Leg assembled and mounted to iWalk knee brace (motors, electronics, and foot shell not yet installed)

We also mounted limit switches, linear potentiometers, and absolute encoders on the leg. The limit switches now are arranged to trigger even if the SEAs are removed from the leg for testing. The next step here is to route wires in a way that minimizes stray EMF and keeps wires out of harm's way. We also developed parts that can be used to lock the input side of the actuators, where the motors usually sit. These devices allow for strength-testing of the actuators by applying loads on the output ends and watching for component deformation or failure. We also need to devise a fixture to lock the output side of the actuators, probably by removing the foot and affixing the knee and ankle to our extruded aluminum test frame. Once this is done, we will have a more sturdy frame with which to repeat the force bandwidth test.

Selection of Alternative Motor Driver

Due to our long and repeated struggles with Arduino and Simulink, I felt it would be prudent to identify an alternate path. I asked our sponsor, Professor Geyer, if their lab had any commercial motor controllers that were not currently in use. We were able to obtain Elmo Solo Whistle (Figure 2) integrated motion controllers that allow communication over RS232 with a computer, and can run a fair amount of code themselves. These devices do require an encoder mounted on the motor, so we ordered two Avago HEDL 500 CPR line driver encoders that Maxon offers as a combination with their motors. However, they had quoted 2-3 week lead time if we sent our motors in to the service center to have them installed, which we felt was an unacceptably long delay and large risk. Instead, we ordered the encoders ourselves, and I developed a mounting adapter similar to the one used by Maxon, which incorporates dowel pins for alignment of the high-performance encoders.

Figure 2: Elmo Solo Whistle, a high-performance servo motor driver with autotuning features and multiple control modes (position, dual loop (position-velocity), velocity, current)

Over the next week, our team will reach a decision on the feasibility of continuing to use the Arduino as a control element interfacing with Simulink. Several options are under consideration:

  1. Use the Arduino as a signal acquisition and serial interface device, reading the encoders and linear potentiometers and writing commands to the motor driver; Control the Arduino over USB serial port using Simulink (running the neuromuscular model)
  2. Program impedance control entirely on the Elmo Solo Whistle, using its high-level programming language
  3. Program impedance control in Simulink, while using the Solo Whistle for motor control and signal acquisition (communicating over RS232 to laptop in backpack)
  4. Use existing neuromuscular model-based control in Simulink, while using the Solo Whistle for motor control and signal acquisition (communicating over RS232 to laptop in backpack)


Actuator Stiction

There are a fair number of sliding interfaces in the actuators, and if they are not properly lubricated and aligned, the actuators stick and resist motion with a large frictional force. To counteract this, I have developed several strategies:

  1. leveling of actuator components by measuring distances between different corners of pairs of plates in actuator with calipers while turning nuts to make slight adjustments in the distance between them
  2. lubrication with white lithium grease (stays on the actuators for longer than graphite-based lubricant or WD-40, both of which are too easily wiped off)
  3. working the actuators back and forth manually after lubrication to work the lubricant into the bushings, ballnut, and bearings

Loosening of Ballscrew Bearing Nuts

Unfortunately, if the acutator is too-well lubricated, the bearing nuts that hold the ballscrews in place can sometimes loosen. I keep checking their tightness, and retightening the setscrews that hold them in place to prevent them coming loose.

SSI Encoder Interface

The Elmo Solo Whistle cannot read the absolute encoders that we use for the direct measurements of the joint angles. They use an interface called SSI, that while common, is different from SPI and other serial interfaces, and requires significant clock configuration and bit-banging to read. Commercial devices designed to read the interface cost in the range of $500. We have developed code for the Arduino that can read them, but as we may be trying to eliminate the Arduino, this isn't as big of a help. We are considering calculating the joint angles by adding the value from the motor-top encoder to the linear potentiometer, which would give the length of the actuator overall, directly giving the joint angle. However, as the motor-top encoder is relative only, we would have to start the leg at neutral/known joint positions.