Commit e3c09fd3 by Hubert

first prototype finished

1 parent 1952f3fa
Showing with 370 additions and 161 deletions
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
# config.mk
SKETCH = kompost.ino
UPLOAD_PORT = /dev/ttyUSB0
# BOARD = es8266
UPLOAD_SPEED = 115200
#THIS_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
CUSTOM_LIBS = /home/hubert/.arduino15/Arduino/libraries
# CUSTOM_LIBS = /home/hubert/.arduino15/
#CUSTOM_LIBS = /home/hubert/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries
#CUSTOM_LIBS = /home/hubert/.arduino15
# ROOT := $(THIS_DIR)/..
# LIBS = $(ESP_LIBS)/SPI \
# $(ESP_LIBS)/Wire \
# $(ESP_LIBS)/ESP8266WiFi \
# $(THIS_DIR)/libraries
# # $(ROOT)/ext_lib
...@@ -4,13 +4,13 @@ void loop_control( int counter ) { ...@@ -4,13 +4,13 @@ void loop_control( int counter ) {
// i'm alive / heartbeat // i'm alive / heartbeat
/* pcf8574.digitalWrite(led, counter % 2); */ /* pcf8574.digitalWrite(led, counter % 2); */
if (button1->pressed) { /* if (button1->pressed) { */
rotate_start(button1); /* rotate_start(button1); */
} /* } */
if (button1->released) { /* if (button1->released) { */
device_end(button1); /* device_end(button1); */
} /* } */
/* unsigned int buttonCondition = buttonHolding; */ /* unsigned int buttonCondition = buttonHolding; */
/* unsigned int liquid_levelCondition = ( */ /* unsigned int liquid_levelCondition = ( */
......
...@@ -12,14 +12,15 @@ ...@@ -12,14 +12,15 @@
#include "mqtt.h" #include "mqtt.h"
// Number = pcfPIN - one action per pin / no diode crap anymore // Number = pcfPIN - one action per pin / no diode crap anymore
#define dive 1 #define dst_valve_rotate 1
#define diaphragm 2 #define dst_valve_watersource 2
#define peristaltic 3 #define diaphragm 3
#define peristaltic_reverse 4 #define peristaltic 4
#define peristaltic_reverse 5
#define src_valve_pump 5 #define dive 6
#define dst_valve_rotate 6 #define src_valve_pump 7
#define dst_valve_watersource 7
#define off 0 #define off 0
......
...@@ -7,20 +7,20 @@ void insertSequence(int device, int start_value, int end_value, double duration, ...@@ -7,20 +7,20 @@ void insertSequence(int device, int start_value, int end_value, double duration,
ptr->end_value = end_value; ptr->end_value = end_value;
ptr->action = action; ptr->action = action;
ptr->next = NULL; ptr->next = NULL;
Serial.println("is0"); /* Serial.println("is0"); */
if ( sequence_tail == NULL ) { if ( sequence_tail == NULL ) {
Serial.println("is1"); /* Serial.println("is1"); */
sequence_head = ptr; sequence_head = ptr;
set_relay(device, start_value); set_relay(device, start_value);
ptr->end = action->start + duration; ptr->end = action->start + duration;
} else { } else {
Serial.println("is2"); /* Serial.println("is2"); */
sequence_tail->next = ptr; sequence_tail->next = ptr;
ptr->start = sequence_tail->end; ptr->start = sequence_tail->end;
ptr->end = sequence_tail->end + duration; ptr->end = sequence_tail->end + duration;
} }
Serial.println("is3"); /* Serial.println("is3"); */
sequence_tail=ptr; sequence_tail=ptr;
} }
...@@ -60,10 +60,10 @@ void monitor_sequence_duration() { ...@@ -60,10 +60,10 @@ void monitor_sequence_duration() {
double remaining = sequence_head->end - ut; double remaining = sequence_head->end - ut;
String remainingStr(remaining); String remainingStr(remaining);
Serial.println("--------------- Duration"); /* Serial.println("--------------- Duration"); */
Serial.println(duration); /* Serial.println(duration); */
Serial.println(remainingStr); /* Serial.println(remainingStr); */
Serial.println("---------------"); /* Serial.println("---------------"); */
mqttClient.publish(duration, remainingStr ); mqttClient.publish(duration, remainingStr );
} }
...@@ -73,9 +73,9 @@ int fill_start(struct action *ptr) { ...@@ -73,9 +73,9 @@ int fill_start(struct action *ptr) {
insertSequence( dst_valve_rotate, 0, 0, 0, ptr ); insertSequence( dst_valve_rotate, 0, 0, 0, ptr );
insertSequence( dst_valve_watersource, 1, 1, 0, ptr ); insertSequence( dst_valve_watersource, 1, 1, 0, ptr );
insertSequence( src_valve_pump, 0, 0, 0, ptr ); insertSequence( src_valve_pump, 0, 0, 0, ptr );
insertSequence( peristaltic_reverse, 1, 0, 5, ptr ); // fill hose for 5 seconds insertSequence( peristaltic_reverse, 1, 0, 10, ptr ); // fill hose for 10 seconds
insertSequence( src_valve_pump, 1, 0, ptr->data, ptr ); // let gravity do its work insertSequence( src_valve_pump, 1, 0, ptr->data, ptr ); // let gravity do its work
insertSequence( peristaltic, 1, 0, 5, ptr ); // vent hose for 5 seconds insertSequence( peristaltic, 1, 0, 10, ptr ); // vent hose for 10 seconds
insertSequence( dst_valve_watersource, 0, 0, 0, ptr ); insertSequence( dst_valve_watersource, 0, 0, 0, ptr );
return 1; return 1;
} else { } else {
...@@ -125,21 +125,24 @@ void set_relay(int device, int value) { ...@@ -125,21 +125,24 @@ void set_relay(int device, int value) {
String state(pre + device + "/state"); String state(pre + device + "/state");
String valueStr( value ); String valueStr( value );
mqttClient.publish(state, valueStr ); mqttClient.publish(state, valueStr );
Serial.println("--------------- Relay");
Serial.println(state); pcf8574.digitalWrite(device,!value); // sink; 1 == relay off (nc), 0 = relay on (no)
Serial.println(valueStr);
Serial.println("---------------"); /* Serial.println("--------------- Relay"); */
int pin = 1; /* Serial.println(state); */
/* Serial.println(valueStr); */
while ( pin < 7 ) { /* Serial.println("---------------"); */
if ( device == pin /* int pin = 1; */
/* || step->src_valve == pin */
/* || step->dst_valve == pin */ /* while ( pin < 7 ) { */
) { /* if ( device == pin */
/* pcf8574.digitalWrite(pin,0); */ /* /\* || step->src_valve == pin *\/ */
} else { /* /\* || step->dst_valve == pin *\/ */
/* pcf8574.digitalWrite(pin,1); */ /* ) { */
} /* /\* pcf8574.digitalWrite(pin,0); *\/ */
pin++; /* } else { */
} /* /\* pcf8574.digitalWrite(pin,1); *\/ */
/* } */
/* pin++; */
/* } */
} }
...@@ -3,13 +3,15 @@ ...@@ -3,13 +3,15 @@
#include <math.h> #include <math.h>
#include <Wire.h> #include <Wire.h>
#include "PCF8591.h"
#include "pcf.h"
#include "wifi.h" #include "wifi.h"
#include "sonar.h" #include "sonar.h"
#include "pcf.h"
#include "mqtt.h" #include "mqtt.h"
#include "queue.h" #include "queue.h"
#include "device.h" #include "device.h"
/* #include "control.h" */ /* #include "control.h" */
/* #include "control.h" */ /* #include "control.h" */
...@@ -17,13 +19,15 @@ unsigned int counter = 0; ...@@ -17,13 +19,15 @@ unsigned int counter = 0;
void setup(void) { void setup(void) {
Serial.begin(115200); /* Serial.begin(115200); */
delay(100); delay(100);
setup_wifi(); setup_wifi();
pinMode(LED_BUILTIN, OUTPUT); /* pinMode(LED_BUILTIN, OUTPUT); */
setup_sonar(); /* delay(5000); */
setup_pcf(); setup_pcf();
setup_sonar();
delay(100);
setup_mqtt(); setup_mqtt();
/* setup_queue(); */ /* setup_queue(); */
} }
...@@ -33,12 +37,29 @@ void loop(void) { ...@@ -33,12 +37,29 @@ void loop(void) {
delay(500); delay(500);
counter++; counter++;
/* sensors_event_t temp_event, pressure_event; */
/* bmp_temp->getEvent(&temp_event); */
/* bmp_pressure->getEvent(&pressure_event); */
loop_sonar(counter); loop_sonar(counter);
/* String liquidLevelAvgStr(liquid_level_avg()); */ /* pcf8574.digitalWrite(0,counter % 2); */
/* mqttClient.publish(PREAMBLE T_SDIST, liquidLevelAvgStr ); */
/* float ana0V = pcf8591.voltageRead(AIN0); // Read voltage from analog 0 */
/* int ana = pcf8591.analogRead(AIN0); */
String moistureLevelStr(pcf8591.analogRead(0));
mqttClient.publish(PREAMBLE T_MOIST, moistureLevelStr );
String temp(bmp.readTemperature());
mqttClient.publish(PREAMBLE T_TEMP, temp );
String liquidLevelAvgStr(liquid_level_avg());
mqttClient.publish(PREAMBLE T_SDIST, liquidLevelAvgStr );
/* String temp(temp_event.temperature); */
loop_pcf(); /* loop_pcf(); */
loop_queue(); loop_queue();
loop_device(); loop_device();
/* loop_control(counter); */ /* loop_control(counter); */
......
...@@ -12,6 +12,8 @@ MQTT mqttClient(device_id, mqtt_server, 1883); ...@@ -12,6 +12,8 @@ MQTT mqttClient(device_id, mqtt_server, 1883);
#define PREAMBLE "home/compost/" #define PREAMBLE "home/compost/"
#define T_RDIST "rawdistance" #define T_RDIST "rawdistance"
#define T_SDIST "waterlevel" #define T_SDIST "waterlevel"
#define T_TEMP "temperature"
#define T_MOIST "moisture"
#define T_PUMPSOURCE "pumpsource" #define T_PUMPSOURCE "pumpsource"
#define T_PUMPSTATE "pumpstate" #define T_PUMPSTATE "pumpstate"
#define T_PUMPLEVEL "pumplevel" #define T_PUMPLEVEL "pumplevel"
......
...@@ -18,7 +18,7 @@ void setup_mqtt() { ...@@ -18,7 +18,7 @@ void setup_mqtt() {
void mqttSubscribe() { void mqttSubscribe() {
/* mqttClient.subscribe("home/compost/pump"); */ /* mqttClient.subscribe("home/compost/pump"); */
Serial.println("mqttSubscribe"); /* Serial.println("mqttSubscribe"); */
mqttClient.subscribe(PREAMBLE T_FILL TS_DURATION,1); mqttClient.subscribe(PREAMBLE T_FILL TS_DURATION,1);
mqttClient.subscribe(PREAMBLE T_ROTATE TS_DURATION ,1); mqttClient.subscribe(PREAMBLE T_ROTATE TS_DURATION ,1);
mqttClient.subscribe(PREAMBLE T_FERTILIZE TS_DURATION ,1); mqttClient.subscribe(PREAMBLE T_FERTILIZE TS_DURATION ,1);
...@@ -31,22 +31,22 @@ void mqttPublished() { ...@@ -31,22 +31,22 @@ void mqttPublished() {
void mqttConnected() { void mqttConnected() {
mqttSubscribe(); mqttSubscribe();
Serial.println("connected"); /* Serial.println("connected"); */
} }
void mqttDisconnected() { void mqttDisconnected() {
Serial.println("disconnected"); /* Serial.println("disconnected"); */
delay(500); delay(500);
mqttClient.connect(); mqttClient.connect();
} }
void mqttData(String& topic, String& data) { void mqttData(String& topic, String& data) {
Serial.println("mqttData"); /* Serial.println("mqttData"); */
String dataStr(data); String dataStr(data);
Serial.println(topic); /* Serial.println(topic); */
Serial.println(PREAMBLE T_FILL TS_DURATION); /* Serial.println(PREAMBLE T_FILL TS_DURATION); */
if (topic == PREAMBLE T_FILL TS_DURATION) { if (topic == PREAMBLE T_FILL TS_DURATION) {
Serial.println("rotate duration"); /* Serial.println("rotate duration"); */
enqueue(C_FILL_DURATION, time(NULL), stringToLong(dataStr)); enqueue(C_FILL_DURATION, time(NULL), stringToLong(dataStr));
} }
if (topic == PREAMBLE T_ROTATE TS_DURATION) { if (topic == PREAMBLE T_ROTATE TS_DURATION) {
......
...@@ -7,7 +7,13 @@ ...@@ -7,7 +7,13 @@
#include <Wire.h> #include <Wire.h>
#include "PCF8574.h" #include "PCF8574.h"
PCF8574 pcf8574(0x20, 0, 2); #include "PCF8591.h"
const unsigned int sda = 0;
const unsigned int scl = 2;
PCF8574 pcf8574(0x20, scl, sda);
/* PCF8591 pcf8591(0x49, scl, sda); */
PCF8591 pcf8591(0x49);
int led = 0; int led = 0;
int PINbutton1 = 1; int PINbutton1 = 1;
......
...@@ -8,34 +8,35 @@ void updateButton(struct button *buttonX) { ...@@ -8,34 +8,35 @@ void updateButton(struct button *buttonX) {
} }
void setup_pcf () { void setup_pcf () {
pcf8574.pinMode(PINbutton1, INPUT); pcf8591.begin(sda,scl);
pcf8574.pinMode(PINbutton2, INPUT);
pcf8574.pinMode(PINbutton3, INPUT); for (int pin = 0; pin < 8; pin ++) {
pcf8574.pinMode(led, OUTPUT); pcf8574.pinMode(pin, OUTPUT);
pcf8574.pinMode(leeren11, OUTPUT); }
pcf8574.pinMode(leeren1, OUTPUT);
pcf8574.pinMode(leeren2, OUTPUT);
pcf8574.pinMode(fuellen2, OUTPUT);
pcf8574.begin(); pcf8574.begin();
for (int pin = 0; pin < 8; pin ++) {
pcf8574.digitalWrite(pin,1);
}
button1->pin = 1; /* button1->pin = 1; */
button1->holding = 0; /* button1->holding = 0; */
button1->pressed = 0; /* button1->pressed = 0; */
button1->released = 0; /* button1->released = 0; */
button2->pin = 2; /* button2->pin = 2; */
button2->holding = 0; /* button2->holding = 0; */
button2->pressed = 0; /* button2->pressed = 0; */
button2->released = 0; /* button2->released = 0; */
button3->pin = 3; /* button3->pin = 3; */
button3->holding = 0; /* button3->holding = 0; */
button3->pressed = 0; /* button3->pressed = 0; */
button3->released = 0; /* button3->released = 0; */
} }
void loop_pcf () { void loop_pcf () {
updateButton(button1); /* updateButton(button1); */
updateButton(button2); /* updateButton(button2); */
updateButton(button3); /* updateButton(button3); */
} }
#include "queue.h" #include "queue.h"
void enqueue(int command, double start, double data) { void enqueue(int command, double start, double data) {
Serial.println("enqueue"); /* Serial.println("enqueue"); */
/* // no dupes, only create new if it is scheduled */ /* // no dupes, only create new if it is scheduled */
/* while(ptr != NULL) { */ /* while(ptr != NULL) { */
/* if ( command == T_PUMPLEVEL */ /* if ( command == T_PUMPLEVEL */
...@@ -125,9 +125,9 @@ void loop_queue() { ...@@ -125,9 +125,9 @@ void loop_queue() {
if ( ptr->running == 1 if ( ptr->running == 1
&& ut >= ptr->end && ut >= ptr->end
) { ) {
Serial.println("end"); /* Serial.println("end"); */
entry_end(ptr); entry_end(ptr);
Serial.println("end1"); /* Serial.println("end1"); */
/* action is due to removal */ /* action is due to removal */
if (prev != NULL) { if (prev != NULL) {
...@@ -137,7 +137,7 @@ void loop_queue() { ...@@ -137,7 +137,7 @@ void loop_queue() {
if (ptr == head) { if (ptr == head) {
head = ptr->next; head = ptr->next;
} }
Serial.println("end5"); /* Serial.println("end5"); */
/* if (ptr == tail) { */ /* if (ptr == tail) { */
/* tail = prev; */ /* tail = prev; */
/* } */ /* } */
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
#include <NewPing.h> #include <NewPing.h>
/* #include <Adafruit_BMP085.h> */ /* #include <Adafruit_BMP085.h> */
/* Adafruit_BMP085 bmp; */ /* Adafruit_BMP085 bmp; */
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp;
Adafruit_Sensor *bmp_temp = bmp.getTemperatureSensor();
Adafruit_Sensor *bmp_pressure = bmp.getPressureSensor();
#define TRIGGER_PIN 1 #define TRIGGER_PIN 1
#define ECHO_PIN 3 #define ECHO_PIN 3
...@@ -11,6 +17,7 @@ ...@@ -11,6 +17,7 @@
#define containerBase 113 /* distance to ground in mm */ #define containerBase 113 /* distance to ground in mm */
int measurements [] = {0,0,0,0,0}; int measurements [] = {0,0,0,0,0};
int liquidLevel = 10; int liquidLevel = 10;
double temperature = 0;
int dubugLiquid = 0; int dubugLiquid = 0;
......
#include "sonar.h" #include "sonar.h"
void setup_sonar() { void setup_sonar() {
/* pinMode(1, FUNCTION_3); */ pinMode(1, FUNCTION_3);
/* pinMode(3, FUNCTION_3); */ pinMode(3, FUNCTION_3);
/* bmp.begin(); */
String temp(bmp.readTemperature());
bmp.begin(0x76);
/* bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /\* Operating Mode. *\/ */
/* Adafruit_BMP280::SAMPLING_X2, /\* Temp. oversampling *\/ */
/* Adafruit_BMP280::SAMPLING_X16, /\* Pressure oversampling *\/ */
/* Adafruit_BMP280::FILTER_X16, /\* Filtering. *\/ */
/* Adafruit_BMP280::STANDBY_MS_500); /\* Standby time. *\/ */
} }
void loop_sonar(int counter) { void loop_sonar(int counter) {
...@@ -20,7 +29,8 @@ double liquid_level() { ...@@ -20,7 +29,8 @@ double liquid_level() {
double liquidLevel = double liquidLevel =
containerBase containerBase
- (( - ((
dubugLiquid /* sonar.ping_median(5) */ /* dubugLiquid */
sonar.ping_median(5)
* speedOfSound * speedOfSound
/ 2 ) / 2 )
/ 1000 / 1000
......
File mode changed
...@@ -5,10 +5,10 @@ void setup_wifi() { ...@@ -5,10 +5,10 @@ void setup_wifi() {
WiFi.begin(ssid, password); WiFi.begin(ssid, password);
// Wait for connection // Wait for connection
while (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED) {
Serial.println("delay"); /* Serial.println("delay"); */
delay(500); delay(500);
} }
if (MDNS.begin(host)) { if (MDNS.begin(host)) {
Serial.println("MDNS responder started"); /* Serial.println("MDNS responder started"); */
} }
} }
This diff could not be displayed because it is too large.
include<vars.scad> include<vars.scad>
module cornerdrills() { module cornerdrills(hull=true) {
translate([24,8,0]) { #translate([24+12,9,170]) {
cylinder(d=12,h=40, $fn=10); cylinder(d=12,h=100, $fn=20);
} }
translate([24,8,0]) { #translate([24,9,0]) {
if (hull == true) {
hull() { hull() {
cylinder(d=6,h=500, $fn=10); cylinder(d=6,h=500, $fn=20);
translate([15,0,0]) translate([15,0,0])
cylinder(d=6,h=500, $fn=10); cylinder(d=6,h=500, $fn=20);
}
} else {
cylinder(d=6,h=500, $fn=20);
translate([15,0,0])
cylinder(d=6,h=500, $fn=20);
} }
} }
translate([8,24,0]) {
#translate([3+4.2+1,3+45+2.5,0]) {
if (hull == true) {
hull() { hull() {
cylinder(d=6,h=400, $fn=10); cylinder(d=6,h=400, $fn=20);
translate([0,15,0]) cylinder(d=6,h=400, $fn=10); translate([0,-6+23.5,0]) cylinder(d=6,h=400, $fn=20);
}
} else {
cylinder(d=6,h=400, $fn=20);
translate([0,-6+23.5,0]) cylinder(d=6,h=400, $fn=20);
} }
} }
translate([8,24,100]) { translate([3+4.2,3+45+2.5,0]) {
cylinder(d=12,h=200, $fn=10); cylinder(d=12,h=100, $fn=20);
} }
} }
...@@ -57,24 +69,25 @@ module draindrills(x,y) { ...@@ -57,24 +69,25 @@ module draindrills(x,y) {
module gx12drill(z) { module gx12drill(z) {
translate([gxXPos,gxYPos,0]) translate([gxXPos,gxYPos,0])
cylinder(d=12,h=30, $fn=10); cylinder(d=12,h=100, $fn=20);
translate([gxXPos,gxYPos,z-20]) translate([gxXPos,gxYPos,z-20])
cylinder(d=12,h=30, $fn=10); cylinder(d=12,h=100, $fn=20);
translate([gxXPos,gxYPos,z-40]) translate([gxXPos,gxYPos,z-40])
cylinder(d=6,h=30, $fn=10); cylinder(d=6,h=100, $fn=20);
} }
module pipedrill() { module pipedrill() {
translate([10,60,0]) cylinder(d=6,h=500, $fn=10); translate([288,381,0]) cylinder(d=6,h=500, $fn=20);
translate([293,373,0]) cylinder(d=6,h=500, $fn=20);
} }
module drills(x,y,z) { module drills(x,y,z, hull=true) {
draindrills(x,y); draindrills(x,y);
cornerdrills(); cornerdrills(hull);
mirror([0,1,0]) translate([0,-y,0]) cornerdrills(); mirror([0,1,0]) translate([0,-y,0]) cornerdrills(hull);
mirror([1,0,0]) translate([-x,0,0]) cornerdrills(); mirror([1,0,0]) translate([-x,0,0]) cornerdrills(hull);
mirror([1,0,0]) translate([-x,y,0]) mirror([0,1,0]) cornerdrills(); mirror([1,0,0]) translate([-x,y,0]) mirror([0,1,0]) cornerdrills(hull);
mirror([1,0,0]) translate([-x,0,0]) gx12drill(z); mirror([1,0,0]) translate([-x,0,0]) gx12drill(z);
mirror([1,0,0]) translate([-x,0,0]) rotate([0,0,90]) translate([0,-14,0]) gx12drill(z); mirror([1,0,0]) translate([-x,0,0]) rotate([0,0,90]) translate([-35,-14,0]) gx12drill(z);
pipedrill(); pipedrill();
} }
use<eurobox.scad>
use<lid.scad>
use<cuts.scad>
use<screws.scad>
use<pipes.scad>
include<vars.scad>
module guideside(guideover,shift,long) {
cube([70+long,21.5,guideover]);
cube([20,20,30]);
translate([68+long,0,0]) cube([2,18,27]);
}
module guideedge(guideover,shift) {
translate([-5,-5,5]) guideside(guideover,shift,0);
/* rotate([0,0,90]) translate([-5,-16.5,5]) guideside(guideover,shift,11); */
rotate([0,0,90]) mirror([0,1,0]) translate([-5,-5,5]) guideside(guideover,shift,11);
}
module drillcorner(x,y,z) {
union(){
mirror([0,0,1]) translate([0,0,-18])guideedge(8,0);
translate([0,0,-22]) guideedge(8,0);
/* translate([0,0,z+9]) mirror([0,0,1]) guideedge(1); */
translate([0,0,z+9+12]) mirror([0,0,1]) guideedge(5,0);
translate([0,0,z+10]) mirror([0,0,1]) guideedge(10,0);
translate([0,0,z-28]) guideedge(5,0);
/* translate([55,-5,10]) cube([15,8,5]); */
/* translate([55,-5,z-8]) cube([15,8,5]); */
/* mirror([1,1,0]) translate([-85,-3,10]) cube([15,8,5]); */
/* mirror([1,1,0]) translate([-85,-3,z-8]) cube([15,8,5]); */
}
}
module drillguide(x,y,z) {
difference() {
union() {
/* translate([x,0, 0]) mirror([1,0,0]) grates(x,y,z) */
translate([x,0, 0]) mirror([1,0,0]) drillcorner(x,y,z);
translate([0,y, 0]) mirror([0,1,0])
translate([x,0, 0]) mirror([1,0,0])
drillcorner(x,y,z);
/* } */
/* translate([0,-offset*2+y, 0]) mirror([0,1,0]) { */
/* union() { */
/* grates(x,y,z); */
/* translate([-offset*2+x,0, 0]) mirror([1,0,0]) grates(x,y,z); */
/* drillcorner(x,y,z); */
}
union() {
eurobox(x,y,z,
handle=false,
handlecaps=false,
pipes=false,
drilled=false,
screws=false,
locked=false,
exploded=false
);
insert=13;
translate([insert,insert,z-3.5]) cube([x-insert*2,y-insert*2,2]);
translate([insert,insert*2,z-5.5]) cube([x-insert*2,y-insert*4,2]);
/* translate([insert,insert,z-19.5]) cube([x-insert*2,y-insert*2,2]); */
translate([insert,insert,z-23]) cube([x-insert*2,y-insert*2,2]);
translate([0,0,-20])drills(x,y,z,hull=false);
translate([x-6,y-6,7.5]) cylinder(r=2,h=z-7.5,fn=6);
translate([x-6,6,7.5]) cylinder(r=2,h=z-7.5,fn=6);
}
}
}
drillguide(300,400,220);
/* eurobox(300,400,220, */
/* handle=false, */
/* handlecaps=false, */
/* pipes=false, */
/* drilled=true, */
/* screws=false, */
/* locked=false, */
/* exploded=false */
/* ); */
...@@ -14,23 +14,38 @@ module innerWall(x,y,z) { ...@@ -14,23 +14,38 @@ module innerWall(x,y,z) {
} }
module grateX(x,y,z) { module grateX(x,y,z) {
translate([0,innergrateXypos,0]) cube([x/2,strength,z]); translate([0,innergrateXypos-45,z-12]) cube([15,45.1,4.15]);
hull() {
translate([0,innergrateXypos,0]) cube([1,2.5,z]);
translate([18,innergrateXypos-0.65,0]) cube([1,3.8,z]);
}
} }
module grateY(x,y,z) { module grateY(x,y,z) {
translate([innergrateYxpos,0,0]) cube([strength,y/2,z]); hull() {
translate([innergrateYxpos,0,0]) cube([2.5,1,z]);
translate([innergrateYxpos-0.65,18,0]) cube([3.8,1,z]);
}
} }
module grateXY(x,y,z) { module grateXY(x,y,z) {
translate([0,0+strength/2,0]) { translate([0,0+strength/2,0]) {
rotate([0,0,-45]) rotate([0,0,-45]) {
cube([strength,y/2,z]); hull() {
translate([-2+1.4,8,0]) cube([2.8,1,z]);
translate([-2+1.4,27.6,0]) cube([2.8,1,z]);
}
}
} }
} }
module grateZ(x,y,z) { module grateZ(x,y,z) {
hull() {
translate([-(offset)+gratesize,-(offset)+gratesize,z])
cube([x-gratesize*2,y-gratesize*2,3.8]);
translate([-(offset),-(offset),z]) translate([-(offset),-(offset),z])
cube([x,y,strength]); cube([x,y,2.5]);
}
} }
module grates(x,y,z) { module grates(x,y,z) {
...@@ -104,7 +119,7 @@ module eurobox(x,y,z,handle,handlecaps,pipes,drilled,screws,locked,exploded) { ...@@ -104,7 +119,7 @@ module eurobox(x,y,z,handle,handlecaps,pipes,drilled,screws,locked,exploded) {
} }
} }
eurobox(300,400,220,true); eurobox(300,400,220,true,drilled=true);
/* testprobes */ /* testprobes */
......
No preview for this file type
...@@ -40,11 +40,12 @@ module H_HULL_PRESS_OUTER_SHAPE_NEGATIVE(over=0) { ...@@ -40,11 +40,12 @@ module H_HULL_PRESS_OUTER_SHAPE_NEGATIVE(over=0) {
translate([5,13,6]) rotate([90,0,0]) cylinder(d=3, h=25); translate([5,13,6]) rotate([90,0,0]) cylinder(d=3, h=25);
translate([5,9,6]) rotate([90,0,0]) cylinder(d=5.6, h=2); translate([5,9,6]) rotate([90,0,0]) cylinder(d=5.6, h=2);
translate([5,-6,6]) rotate([90,90,0]) cylinder(d=6.3, h=2.6, $fn=6); translate([5,-6,6]) rotate([90,90,0]) cylinder(d=6.3, h=2.6, $fn=6);
translate([5,-6-1.3,0]) cube([5.45,2.6,15],true);/*rotate([90,90,0]) cylinder(d=6.3, h=2.6, $fn=6);*/
} }
module H_HULL_PRESS_OUTER_SHAPE(over=0) { module H_HULL_PRESS_OUTER_SHAPE(over=0) {
intersection() { intersection() {
translate([1.5,10,6]) rotate([90,90,0]) cylinder(d=17, h=30, $fn=6); translate([1.5,10,7]) rotate([90,90,0]) cylinder(d=19, h=30, $fn=6);
linear_extrude(height = 12, center = false, convexity = 10) linear_extrude(height = 12, center = false, convexity = 10)
polygon(points=[ [6.7,-3.6] polygon(points=[ [6.7,-3.6]
,[9,-5] ,[9,-5]
...@@ -61,6 +62,19 @@ module H_HULL_PRESS_OUTER_SHAPE(over=0) { ...@@ -61,6 +62,19 @@ module H_HULL_PRESS_OUTER_SHAPE(over=0) {
} }
} }
module H_PRESS_OUTER() {
size=8;
translate(edges[0]) rotate([0,-90]) translate([0,0,-115.5])H_HULL_PRESS_OUTER_SHAPE();
translate(edges[0]) rotate([0,-90]) translate([0,0,-19.5])H_HULL_PRESS_OUTER_SHAPE();
translate(edges[2]) rotate([0,90]) translate([0,0,-67.])H_HULL_PRESS_OUTER_SHAPE(-8);
}
module H_PRESS_OUTER_NEGATIVE() {
size=8;
translate(edges[0]) rotate([0,-90]) translate([0,0,-115.5])H_HULL_PRESS_OUTER_SHAPE_NEGATIVE();
translate(edges[0]) rotate([0,-90]) translate([0,0,-19.5])H_HULL_PRESS_OUTER_SHAPE_NEGATIVE();
translate(edges[2]) rotate([0,90]) translate([0,0,-67.])H_HULL_PRESS_OUTER_SHAPE_NEGATIVE(-8);
}
module H_HULL() { module H_HULL() {
union() { union() {
for (i = [0:3]) { for (i = [0:3]) {
...@@ -76,6 +90,7 @@ module H_HULL() { ...@@ -76,6 +90,7 @@ module H_HULL() {
module H_PRESS_INNER() { module H_PRESS_INNER() {
size=8; size=8;
union() { union() {
translate([62,18.6,8]) cube([4,9,15]);
for (i = [0:3]) { for (i = [0:3]) {
hull() { hull() {
translate(edges[i]) rotate([0,-45+90*i]) H_HULL_PRESS_INNER_SHAPE(); translate(edges[i]) rotate([0,-45+90*i]) H_HULL_PRESS_INNER_SHAPE();
...@@ -85,18 +100,6 @@ module H_PRESS_INNER() { ...@@ -85,18 +100,6 @@ module H_PRESS_INNER() {
} }
} }
module H_PRESS_OUTER() {
size=8;
translate(edges[0]) rotate([0,-90]) translate([0,0,-115.5])H_HULL_PRESS_OUTER_SHAPE();
translate(edges[0]) rotate([0,-90]) translate([0,0,-19.5])H_HULL_PRESS_OUTER_SHAPE();
translate(edges[2]) rotate([0,90]) translate([0,0,-67.])H_HULL_PRESS_OUTER_SHAPE(-8);
}
module H_PRESS_OUTER_NEGATIVE() {
size=8;
translate(edges[0]) rotate([0,-90]) translate([0,0,-115.5])H_HULL_PRESS_OUTER_SHAPE_NEGATIVE();
translate(edges[0]) rotate([0,-90]) translate([0,0,-19.5])H_HULL_PRESS_OUTER_SHAPE_NEGATIVE();
translate(edges[2]) rotate([0,90]) translate([0,0,-67.])H_HULL_PRESS_OUTER_SHAPE_NEGATIVE(-8);
}
module H_Poly(size) { module H_Poly(size) {
translate([-size/2,0,-size/2]) polyhedron( translate([-size/2,0,-size/2]) polyhedron(
...@@ -391,26 +394,28 @@ module handle(x,y,z,inner,exploded=false) { ...@@ -391,26 +394,28 @@ module handle(x,y,z,inner,exploded=false) {
translate(-exploded*3) handleBlock(x,y,z,blank=true); translate(-exploded*3) handleBlock(x,y,z,blank=true);
} else { } else {
handleBlock(x,y,z, base=true); handleBlock(x,y,z, base=true);
/* handleBlock(x,y,z,press=true); */ handleBlock(x,y,z,press=true);
/* handleBlock(x,y,z,moisture_inner=true); */ handleBlock(x,y,z,moisture_inner=true);
/* handleBlock(x,y,z,moisture_outer=true); */ handleBlock(x,y,z,moisture_outer=true);
translate([0,0,10])handleBlock(x,y,z,blank=true); translate([0,0,10])handleBlock(x,y,z,blank=true);
} }
} }
module handles(x,y,z,exploded) { module handles(x,y,z,exploded) {
handle(x,y,z,false,exploded); handle(x,y,z,false,exploded);
/* handle(x,y,z,true,exploded); */ handle(x,y,z,true,exploded);
/* mirror([0,1,0]) translate([0,-y,0]) { */ mirror([0,1,0]) translate([0,-y,0]) {
/* handle(x,y,z,false,exploded); */ handle(x,y,z,false,exploded);
/* handle(x,y,z,true,exploded); */ handle(x,y,z,true,exploded);
/* } */ }
} }
/* handle(300,400,220,exploded=[0,-20,0]); */ handle(300,400,220,exploded=[0,-20,0]);
intersection() {
translate([104,10,155]) cube(28.5,50,80);
handle(300,400,220); /* intersection() { */
} /* translate([104,10,155]) cube(28.5,50,80); */
/* handle(300,400,220); */
/* } */
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -12,17 +12,30 @@ module materialDot(radius, height, roundness) { ...@@ -12,17 +12,30 @@ module materialDot(radius, height, roundness) {
} }
module shapeZ(x,y,z) { module shapeZ(x,y,z) {
translate([0,0,-250]) minkowski() { translate([-3,-3,-250]) minkowski() {
cube([ cube([
x-(offset)*2, x-(offset-3)*2,
y-(offset)*2, y-(offset-3)*2,
1 1
]); ]);
cylinder( cylinder(
r=offset, r=offset-3,
h=500 h=500,
$fn=50
); );
} }
/* translate([0,0,-250]) minkowski() { */
/* cube([ */
/* x-(offset)*2, */
/* y-(offset)*2, */
/* 1 */
/* ]); */
/* cylinder( */
/* r=offset, */
/* h=500, */
/* $fn=50 */
/* ); */
/* } */
} }
module volume(x,y,z,extra) { module volume(x,y,z,extra) {
...@@ -58,8 +71,9 @@ module handleShape(x,y,z,extra,bool,borders){ ...@@ -58,8 +71,9 @@ module handleShape(x,y,z,extra,bool,borders){
translate([-strength*2,0,0]) rotate([90,0,90]) linear_extrude(height = 140, center = false, convexity = 10) translate([-strength*2,0,0]) rotate([90,0,90]) linear_extrude(height = 140, center = false, convexity = 10)
polygon(points=[[-10,-50] polygon(points=[[-10,-50]
,[25.7-2,-50] ,[25.7-2,-50]
,[25.4-2,-32.5] ,[25.4-2,-33.3]
,[18.5,-32.5] ,[18.5,-33.3]
,[18.5,-30]
,[10,-5] ,[10,-5]
,[10,strength] ,[10,strength]
,[20,strength] ,[20,strength]
......
module pushInAdapterStraignt() { module pushInAdapterStraignt() {
difference() { difference() {
union() { union() {
cylinder(d=0.95,h=3.6, $fn=10); cylinder(d=9.5,h=36, $fn=10);
translate([0,0,0.1]) cylinder(d=1.5,h=1.2, $fn=20); translate([0,0,1]) cylinder(d=15,h=12, $fn=20);
translate([0,0,2.3]) cylinder(d=1.5,h=1.2, $fn=20); translate([0,0,23]) cylinder(d=15,h=12, $fn=20);
} }
translate([0,0,-0.1]) cylinder(d=0.7,h=10, $fn=10); translate([0,0,-1]) cylinder(d=7,h=100, $fn=10);
} }
} }
module sidepipe(z) { module sidepipe(z) {
/* translate([0,0,0.6+strength+1.7]) { */ /* translate([0,0,0.6+strength+1.7]) { */
translate([0,0,1+1.7+0.3]) { translate([0,0,10+17+3]) {
difference() { difference() {
cylinder(d=0.6,h=z-1, $fn=10); cylinder(d=6,h=z-10, $fn=10);
translate([0,0,-0.1]) cylinder(d=0.4,h=z, $fn=10); translate([0,0,-1]) cylinder(d=4,h=z, $fn=10);
} }
} }
} }
module pipes(z,exploded) { module pipes(z,exploded) {
translate(exploded) translate([1,6,0]) { translate(exploded) translate([10,60,0]) {
color("#fff") sidepipe(z); color("#fff") sidepipe(z);
color("#fff") translate([0,0,1.1]) { color("#fff") translate([0,0,11]) {
pushInAdapterStraignt(); pushInAdapterStraignt();
} }
} }
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
...@@ -3,8 +3,8 @@ $fn=20; ...@@ -3,8 +3,8 @@ $fn=20;
strength = 2.5; strength = 2.5;
gratesize = 16.8; gratesize = 16.8;
innergrateXypos = 80; innergrateXypos = 76;
innergrateYxpos = 70; innergrateYxpos = 65;
roundborderInner = 5; roundborderInner = 5;
recess = 7.87; recess = 7.87;
......
linear_extrude(height = 0.46, center = false, convexity = 10, twist = 0)
import("dark.svg");
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
linear_extrude(height = 0.46, center = true, convexity = 10, twist = 0)
import("light.svg");
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!