Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dylancollaud committed May 13, 2018
2 parents 6acbc49 + af0fa38 commit 79d8170
Show file tree
Hide file tree
Showing 57 changed files with 11,242 additions and 416 deletions.
Binary file added 3d_model/Distributeur.zip
Binary file not shown.
Binary file removed 3d_model/Distributeur/A_Distributeur.SLDASM
Binary file not shown.
Binary file removed 3d_model/Distributeur/A_SupportDistributeur.SLDASM
Binary file not shown.
Binary file removed 3d_model/Distributeur/BackSupport.SLDPRT
Binary file not shown.
Binary file removed 3d_model/Distributeur/FrontSupport.SLDPRT
Binary file not shown.
Binary file removed 3d_model/Distributeur/LeftSupport.SLDPRT
Binary file not shown.
Binary file removed 3d_model/Distributeur/Printer/SupportVerre.STL
Binary file not shown.
Binary file removed 3d_model/Distributeur/Printer/case.STL
Binary file not shown.
Binary file removed 3d_model/Distributeur/Printer/escargot.SLDPRT
Binary file not shown.
Binary file removed 3d_model/Distributeur/Printer/escargot.STL
Binary file not shown.
Binary file removed 3d_model/Distributeur/Printer/triangle.STL
Binary file not shown.
Binary file removed 3d_model/Distributeur/case.SLDPRT
Binary file not shown.
Binary file removed 3d_model/Distributeur/escargot.SLDPRT
Binary file not shown.
Binary file removed 3d_model/Distributeur/servo.SLDPRT
Binary file not shown.
Binary file removed 3d_model/Distributeur/triangle.SLDPRT
Binary file not shown.
Binary file added 3d_model/Distributeur_2/3D printer/Vis.STL
Binary file not shown.
Binary file added 3d_model/Distributeur_2/3D printer/socle.STL
Binary file not shown.
Binary file added 3d_model/Distributeur_2/3D printer/socle_2.STL
Binary file not shown.
Binary file added 3d_model/Distributeur_2/A_Distributeur_2.SLDASM
Binary file not shown.
Binary file not shown.
Binary file added 3d_model/Distributeur_2/BackSupport.SLDPRT
Binary file not shown.
File renamed without changes.
Binary file added 3d_model/Distributeur_2/FrontSupport.SLDPRT
Binary file not shown.
Binary file added 3d_model/Distributeur_2/LeftSupport.SLDPRT
Binary file not shown.
Binary file added 3d_model/Distributeur_2/Vis.SLDPRT
Binary file not shown.
Binary file added 3d_model/Distributeur_2/servo.SLDPRT
Binary file not shown.
Binary file added 3d_model/Distributeur_2/socle.SLDPRT
Binary file not shown.
8,090 changes: 8,090 additions & 0 deletions 3d_model/Laser/SupportDistributeur_2/FrontSupport.DXF

Large diffs are not rendered by default.

2,789 changes: 2,789 additions & 0 deletions 3d_model/Laser/ToCut/NewDistributeur.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 3d_model/Mouvement/Final.SLDASM
Binary file not shown.
Binary file modified 3d_model/Mouvement/SupportCoulisse.STL
Binary file not shown.
7 changes: 7 additions & 0 deletions Arduino/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*]
end_of_line = lf
insert_final_newline = true

[*.{ino,h,cpp}]
indent_style = space
indent_size = 4
253 changes: 0 additions & 253 deletions Arduino/CocktailJam/CocktailJam.ino

This file was deleted.

29 changes: 29 additions & 0 deletions Arduino/CocktailJam/pressure.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "pressure.h"

Pressure::Pressure(int pinPressure, int pinPump, int targetPressure): pinPressure(pinPressure),
pinPump(pinPump), targetPressure(targetPressure){
this->targetPressureStart = targetPressure-TARGET_PRESSURE_HYSTERESIS;
this->targetPressureStop = targetPressure+TARGET_PRESSURE_HYSTERESIS;
}

long Pressure::getCurrentPressure(){
return this->currentPressure;
}

void Pressure::run(unsigned long dtMs){
this->currentPressure = readPressure(); //stupid, to remove
if(this->currentPressure<this->targetPressureStart){
digitalWrite(this->pinPump, HIGH);
}
if(this->currentPressure>this->targetPressureStop){
digitalWrite(this->pinPump, LOW);
}
}

double Pressure::readPressure(){
double adc0 = (double)analogRead(this->pinPressure);
double erreurV = -0.17;
double vout = adc0 * 0.004883 + erreurV;
double pressure = (vout * 0.2 - 0.04) *1111.111111111;
return pressure;
}
30 changes: 30 additions & 0 deletions Arduino/CocktailJam/pressure.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef PRESSURE_H
#define PRESSURE_H

#include <Arduino.h>

// in pression unit
#define TARGET_PRESSURE_HYSTERESIS 100

class Pressure
{
public:
Pressure(int pinPressionSensor, int pinPump, int targetPression);

void run(unsigned long dtMs);

long getCurrentPressure();

private:
int pinPressure;
int pinPump;
int targetPressure;
long currentPressure = -1;
int targetPressureStop;
int targetPressureStart;

double readPressure();

};

#endif
23 changes: 23 additions & 0 deletions Arduino/CocktailJam/status.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "status.h"
#include <Arduino.h>


Status::Status(Stream *serial, int *weightGrPtr, int *carrierMmPtr, Pressure *pressure): serial(serial), weightGrPtr(weightGrPtr),
carrierMmPtr(carrierMmPtr), pressure(pressure){
this->acc = 0;
}

void Status::run(unsigned long dtMs){
this->acc += dtMs;
if(acc>=STATUS_DELAY_MS){
this->serial->print("s:");
this->serial->print(*this->carrierMmPtr);
this->serial->print(':');
this->serial->print(*this->weightGrPtr);
this->serial->print(':');
this->serial->println(this->pressure->getCurrentPressure());

this->acc = 0;
}
}

24 changes: 24 additions & 0 deletions Arduino/CocktailJam/status.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef STATUS_H
#define STATUS_H

#include <Arduino.h>
#include "pressure.h"

#define STATUS_DELAY_MS 100

class Status
{
public:
Status(Stream *serial, int *weightGrPtr, int *carrierMmPtr, Pressure *pressure);

void run(unsigned long dtMs);

private:
unsigned long acc;
Stream *serial;
int *weightGrPtr;
int *carrierMmPtr;
Pressure *pressure;
};

#endif
Loading

0 comments on commit 79d8170

Please sign in to comment.