Software

Programming the board for inflation and deflation

Using a SPDT switch to control the inflation and deflation cycles of the soft robot, the digital pin to which the switch is connected to is used as an input. Depending on the state of the pin, the soft robot will inflate or deflate. The Arduino code for inflation and deflation given input from the switch is shown below: 

if ( switch_pin == HIGH) {
digitalWrite(inletValvePin,HIGH); // turn pressure valve HIGH
digitalWrite(pumpPin,HIGH); // make sure pump is on
digitalWrite(exhaustValvePin,LOW); // turn exhaust valve LOW
digitalWrite(ledPin,HIGH); // LED ON
}

if ( switch_pin == LOW) {
digitalWrite(inletValvePin,LOW); // turn pressure valve HIGH
digitalWrite(pumpPin,LOW); // pump is off
digitalWrite(exhaustValvePin,HIGH); // turn exhaust valve HIGH
digitalWrite(ledPin,LOW); // LED off
}

Pressure sensor calibration

The ASDXAVX005PGAA5 pressure sensor is an analogue pressure sensor that outputs a voltage in proportion to the air pressure being measured. It is a gauge pressure sensor meaning that it measures pressure in excess of atmospheric pressure from 0 - 5 psi. The calibration equation is given by:

Vout=(0.8×Vsupply/Pmax−Pmin)× (Papplied−Pmin)+0.10×Vsupply

Therefore, the equation to get the pressure from the voltage reading is given as:

Papplied=[Vout−(0.10×Vsupply)]×(Pmin−Pmax)/0.8×Vsupply+Pmin

The Arduino Code is given by:

sensorValue = analogRead(analogInPin); 
                            
// digital value of pressure sensor voltage
voltage_mv =  (sensorValue * reference_voltage_mv) / ADCFULLSCALE;
 
// pressure sensor voltage in mV
voltage_v = voltage_mv / 1000; 
                                     
output_pressure = ( ( (voltage_v - (0.10 * (reference_voltage_mv/1000) )) * (Pmax - Pmin) ) / (0.8 * (reference_voltage_mv/1000) ) ) + Pmin;

FSM for pressure control

To maintain the air pressure inside the soft robot, a Finite State Machine (FSM) can be used (see Figure below). For example, to control the air pressure between 0.7 psi to 0.9 psi, two pressure thresholds are used to prevent the pump from toggling on/off/on/off/on... too quickly. This is essential due to air leakage which can cause the pressure of air in the soft robot to fluctuate rapidly after attaining the desired pressure. Using this FSM, if the system were to be in the PUMP-off state (speed of air pump is reduced), then the system would remain in the PUMP-off state until the pressure drops below 0.7psi. If the system were to be in the PUMP-on state (air pump is inflating the robot at maximum duty cycle), then the system would remain in the PUMP-on state until the pressure rises above 0.9psi.

The code for FSM Control is given as:

if (sensorValue <= desiredValue) {
analogWrite(pumpPin,255); // Pump. (0 is off) and (255 is on)
digitalWrite(inletValvePin,HIGH); // open the air valve
digitalWrite(exhaustValvePin,LOW); // close the exhaust valve
}

if (sensorValue > desiredValue) {
while (analogRead(A0) > (desiredValue - tolerance) ) {
analogWrite(pumpPin,190); // reduce speed of pump
digitalWrite(inletValvePin,HIGH); // open the air valve
digitalWrite(exhaustValvePin,LOW); // close the exhaust valve
}
}