Coder Social home page Coder Social logo

nao974 / spotmicro_new-leg_with_pressure-sensor Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.57 MB

The pressure sensor at the end of the leg will allow you to know, If it hits the ground (Boolean True / False), The force exerted on it, And at an instant "t" the direction of the force exerted (pressure // release)

License: MIT License

C++ 100.00%
robotique spotmicro spot rootic pressure sensor dog arduino

spotmicro_new-leg_with_pressure-sensor's Introduction

SpotMicro: New leg with pressure sensor

Version française

The pressure sensor at the end of the leg will allow you to know:

  • If it hits the ground (Boolean True / False)
  • The force exerted on it
  • And at an instant "t" the direction of the force exerted (pressure // release)

Video Presentation


Wiring

The wiring is very simple, the pressure is read on an analog port:

wiring


LegPressureSensor Library

Written for VSCode, just copy it to the ./Lib folder of your Plateform-IO project.

The Constants

const uint16_t CALIBRATE_NB = 500;
const uint8_t TRIGGER_PRESSURE = 10;
const uint8_t TRIGGER_DIRECTION = 5;
  • CALIBRATE_NB : Number of measurements when calculating the calibration value.
  • TRIGGER_PRESSURE : Deviation from the calibration validating a change of state.
  • TRIGGER_PRESSURE : Deviation from the calibration validating a change of direction.

Public Methods (functions)

//Constructor
LegPressureSensor(const uint8_t pin);

// Calculation of the calibration
void calibrate();   

// Pressure reading and state update
void read();

// Return the last measured pressure
uint16_t pressureValue();

// Return the calculated released pressure
uint16_t calibrateValue();

// Return the current max pressure
uint16_t pressureMax();

// Return the direction of movement
int8_t   direction();

// Returns True / False if pressed
bool isPressed();
  • LegPressureSensor (const uint8_t pin): The Constructor with the analog pin as a parameter, returns an object corresponding to this class.

  • calibrate() : carry out CALIBRATE_NB measurement afterwards then calculate the average. This method must be called with the paw raised thus allowing to have a reference.

  • read() : reading of the measure, UPDATE of the maximum value and the state of the tab, returns nothing.

  • pressureValue() : returns the value of the measurement performed by the read() method.

  • calibrateValue() : returns the calibration value calculated by the calibrate() method.

  • pressureMax()) : returns the maximum value exerted since the start of the pressure, it is reset to zero when the tab is released.

  • direction(): allows to know at a moment * 't' * if the movement continues towards a pressure (+1) a release (-1) or is stationary (0).

  • isPressed() : returns True if the pressure exerted is greater than u equal to the calibration + TRIGGER_PRESSURE, otherwise returns false.


Creation of "pear"

Just like the leg of Unitree's A1 robot, I set out to create a flexible "Pear".

a1-unitree

First by 3d printing in filament ** FLEX ** (TPU), but the exercise is not easy because it is flexible and it is difficult to have a constant flow at the output extruder. After tests of different thicknesses, it remains too rigid and it tears very quickly:

Test TPU

I have not tested the TPE filament which is even more flexible because the experience with the FLEX was already complicated.


New Option : Silicone

The principle is to 3D print molds in order to "model" Silicone of bathroom joints:

silicone-mold-A silicone-mold-B

The Silicone is first kneaded in water saturated with dishwashing liquid:

Silicone Mold

A few hours of drying and our part is ready, several thickness tests have been carried out:

Result Silicone Mold


Pressure sensor

Having no idea of the pressure differential in the "pear" between a pressed or released state, I tested 2 sensors with different accuracy.

I chose analog sensors because all of the I2Cs found had a fixed address, therefore incompatible with the SportMicro which has 4 legs, therefore 4 pressure sensors.

MPX4250AP

With an accuracy of 20 mV / kPa, this sensor is not sensitive enough, even when I blow into it to the maximum, the value varies only very slightly.

MPX5010DP

With an accuracy of 450mv / kPa, this sensor is great, I capture light pressures as well as large crushes:

Result Sensor

DataSheet MPX5010DP


Modification of the leg

Work in progress

spotmicro_new-leg_with_pressure-sensor's People

Contributors

nao974 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.