Node Spacedeur: verschil tussen versies
(→Grote Schakelaar header) |
(→2025 - new wiring) |
||
(36 tussenliggende versies door 4 gebruikers niet weergegeven) | |||
Regel 1: | Regel 1: | ||
− | [[Category: | + | [[Category:Nodes & network devices]] |
+ | |||
+ | 192.168.6.29 cc:50:e3:8b:27:c7 | ||
PoE powered Node on Ethernet for the door of the Space itself. | PoE powered Node on Ethernet for the door of the Space itself. | ||
[[Bestand:SpacedeurNode1.jpg|miniatuur|SpaceDeur node]] [[Bestand:SpacedeurNode2.jpg|miniatuur|"Motherboard" with POESP and all ext. components connected]] | [[Bestand:SpacedeurNode1.jpg|miniatuur|SpaceDeur node]] [[Bestand:SpacedeurNode2.jpg|miniatuur|"Motherboard" with POESP and all ext. components connected]] | ||
+ | |||
+ | = Mechanics = | ||
+ | |||
+ | 3D printed (openscad file lost in the midst of time ??, [https://github.com/MakerSpaceLeiden/ACNode-3DPrintable-Enclosures?tab=readme-ov-file new version] in the works) | ||
+ | |||
+ | [[Bestand:Spacedeur-openener-01.jpg|300px]] | ||
+ | [[Bestand:Spacedeur-openener-02.jpg|300px]] | ||
+ | [[Bestand:Spacedeur-openener-03.jpg|300px]] | ||
+ | |||
+ | [[Bestand:Spacedeur-openener-04.jpg|300px]] | ||
+ | [[Bestand:Spacedeur-openener-05.jpg|300px]] | ||
+ | |||
+ | with an ~40x40 NMEA motor -- 5mm diameter axle & 31x31 mount plate m3x45 depth in motor. | ||
+ | |||
+ | [[Bestand:Spacedeur-nmea17.png|600px]] | ||
+ | |||
+ | === Mechanics - new version === | ||
+ | |||
+ | [https://github.com/MakerSpaceLeiden/ACNode-3DPrintable-Enclosures?tab=readme-ov-file new version] being created (May 2025): | ||
+ | |||
+ | [[Bestand:Spacedeur-openener-ng-01.png|300px]] | ||
+ | [[Bestand:Spacedeur-openener-hg-02.png|300px]] | ||
+ | [[Bestand:Spacedeur-openener-ng-03.png|300px]] | ||
+ | |||
+ | |||
+ | Assembly order: | ||
+ | |||
+ | # Mount all inserts | ||
+ | # Insert 5mm bearing | ||
+ | # Insert the 4 bolts for the motor | ||
+ | # Insert spool | ||
+ | # Insert 5mm rod from top | ||
+ | # Mount motor with the 4 screws; take a few turns each time; going round about 5-6 times in total before really tightening it | ||
+ | # Push rod down; make to size & insert/tighten grub-screws | ||
+ | # Mount switches | ||
+ | |||
+ | ==== v1.03 - changes ==== | ||
+ | |||
+ | # Yellow; failed print; gap of 2 layers at 2/3. Cause unclear. | ||
+ | |||
+ | Issues: | ||
+ | |||
+ | # Top hole about 0.3 mm off | ||
+ | # Left switch could use a bit more space | ||
+ | # Both switches could go a mm down or the lever a mm up to get more clearance to mount the bolt-inserts without the solder iron touching the lever. | ||
+ | # Rope hole not ideally placed; more to the wall would align nicer. | ||
+ | |||
+ | ==== v1.04 - changes ==== | ||
+ | |||
+ | # Move left/open switch 0.8mm to the left | ||
+ | # Recenter bearing; correct bearing size: [https://www.amazon.nl/-/en/dp/B078NK6BP3 ZZ MR115-2RS]; ID=5mm, OD=11MM, H=4MM. | ||
+ | # Seriously thinner spring | ||
+ | # Move rope further away; wider hole | ||
+ | # Added extra holes/option to use smaller/low activation force [https://nl.mouser.com/ProductDetail/Panasonic-Industrial-Devices/AV3232613?qs=8udjAbt9EKhxQzDQ0%2FplTw%3D%3D&srsltid=AfmBOood44ZPQ-Vx9KUolE-rZgSxCkostRRnaUXv6c6mRvC5fmI2JMPR AV3232613 microswitches] | ||
+ | # Colour: black | ||
+ | |||
+ | Todo: | ||
+ | |||
+ | # Replace tie-wrap by wire tube holder | ||
= Electronics = | = Electronics = | ||
Regel 14: | Regel 75: | ||
* transistor for amplifying the pulses on GPIO16 for the buzzer | * transistor for amplifying the pulses on GPIO16 for the buzzer | ||
* ''pull-up resistor for MS1, ensuring the motor is making half-steps (?)'' | * ''pull-up resistor for MS1, ensuring the motor is making half-steps (?)'' | ||
− | * R-C circuit for the [[Grote Schakelaar|a.k.a. "Grote Schakelaar"]] | + | * R-C circuit for the [[Project Grote Schakelaar|a.k.a. "Project Grote Schakelaar"]] |
* socket for A4988-type stepper motor driver | * socket for A4988-type stepper motor driver | ||
+ | ** Vmotor: 8 - 35V | ||
+ | ** Maximale stroom: 1A (2A piek) | ||
+ | ** Vlogic: 3,3 - 5V | ||
* header for the POESP board | * header for the POESP board | ||
* 8-pin RFID reader connector (brown/red pin is rightmost) | * 8-pin RFID reader connector (brown/red pin is rightmost) | ||
Regel 21: | Regel 85: | ||
* 2-screw terminal for powering auxillary devices (not connected) | * 2-screw terminal for powering auxillary devices (not connected) | ||
* 2-pin terminal for the buzzer, which sounds when RFID is read successfully | * 2-pin terminal for the buzzer, which sounds when RFID is read successfully | ||
− | * 2-pin terminal for the [[Grote Schakelaar|a.k.a. "Grote Schakelaar"]]. High when switch is off (or wire broken). Goes low when the switch is on. | + | * 2-pin terminal for the [[Project Grote Schakelaar|a.k.a. "Project Grote Schakelaar"]]. High when switch is off (or wire broken). Goes low when the switch is on. |
== Pinout of the RFID reader connector == | == Pinout of the RFID reader connector == | ||
Regel 94: | Regel 158: | ||
== Grote Schakelaar header == | == Grote Schakelaar header == | ||
− | Cabling to the [[Grote Schakelaar]]. | + | Cabling to the [[Project Grote Schakelaar]]; met deze [[https://github.com/MakerSpaceLeiden/AccesSystem/blob/master/lib-arduino/ACNode/examples/SpaceDeur/SpaceDeur.ino#L264 code]]. |
=== Wiring: === | === Wiring: === | ||
Regel 111: | Regel 175: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Value !! Interpretation | + | ! Value !! Interpretation || |
|- | |- | ||
− | | low || Handle in horizontal position - space closed [[Bestand: Grote_Schakelaar_Closeup_Gesloten.JPG |60px]] | + | | low || Handle in horizontal position - space closed. || [[Bestand: Grote_Schakelaar_Closeup_Gesloten.JPG |60px]] |
|- | |- | ||
− | | high || Handle in vertical position -- open.[[Bestand: Grote_Schakelaar_Closeup_Open.JPG |60px]] | + | | high || Handle in vertical position -- open. || [[Bestand: Grote_Schakelaar_Closeup_Open.JPG |60px]] |
|- | |- | ||
|} | |} | ||
Regel 129: | Regel 193: | ||
|- | |- | ||
| 2 || power ground | | 2 || power ground | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | == 2025 - new wiring == | ||
+ | |||
+ | === 2025 - wire motor/node === | ||
+ | |||
+ | Wire between the motor and the node. There are connectors hidden behind the motor; these can be | ||
+ | disconnected and are small enough to fit through 16mm standard PVC pipe. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Kleur !! Stekker !! Functie !! Kleur UTP, Stekker eind | ||
+ | |- | ||
+ | | Blauw || Motor 1A, Zwart Male interconnect || UTP Blauw || Blauw, Stepper connector | ||
+ | |- | ||
+ | | Rood || Motor 1B, Red Male interconnect || UTP Blauw-Wit || Rood, Stepper connector | ||
+ | |- | ||
+ | | Groen || Motor 2A, Red Female interconnect || UTP Bruin-Wit || Groen, Stepper connector | ||
+ | |- | ||
+ | | Zwart || Motor 2A, Zwart Female interconnect || UTP Blauw || Groen, Stepper connector | ||
+ | |- | ||
+ | | Rood || End detect close, 3 pin interconnect || UTP Orange-Wit, Groen-Wit || IO-GND ?? Rood ?? | ||
+ | |- | ||
+ | | Zwart || GND detect, 3 pin interconnect || UTP Orange || IOA ?? Geel ?? | ||
+ | |- | ||
+ | | Geel || End detect open, 3 pin interconnect || UTP Groen || IOB ?? Zwart ?? | ||
|- | |- | ||
|} | |} | ||
Regel 134: | Regel 225: | ||
= Software = | = Software = | ||
− | Software: https://github.com/MakerSpaceLeiden/AccesSystem/blob/master/lib-arduino/ACNode/examples/SpaceDeur/SpaceDeur.ino | + | <s>Software: https://github.com/MakerSpaceLeiden/AccesSystem/blob/master/lib-arduino/ACNode/examples/SpaceDeur/SpaceDeur.ino</s> |
<s>Todo: currently Grote Schakelaar does not work (ESP needs to be coded to use GPIO34 signal / send info to MQTT). Partially coded up at https://github.com/MakerSpaceLeiden/AccesSystem/compare/master...dirkx:master -- but not tested yet.</s> | <s>Todo: currently Grote Schakelaar does not work (ESP needs to be coded to use GPIO34 signal / send info to MQTT). Partially coded up at https://github.com/MakerSpaceLeiden/AccesSystem/compare/master...dirkx:master -- but not tested yet.</s> | ||
+ | |||
+ | Updated 2022/2/21 with https://github.com/MakerSpaceLeiden/AccesSystem/releases/tag/cache-fix-2022-02-22-1.01 | ||
+ | |||
+ | == Stepper motor test script == | ||
+ | |||
+ | #include <AccelStepper.h> // for the stepper motor. | ||
+ | |||
+ | // Stepper motor-Pololu / A4988 - wiring | ||
+ | // | ||
+ | #define STEPPER_DIR (0) // was 2 | ||
+ | #define STEPPER_ENABLE (12) // was 4 // sleep | ||
+ | #define STEPPER_STEP (2) // was 5 | ||
+ | |||
+ | #define STEPPER_MAXSPEED (8000) | ||
+ | #define STEPPER_ACCELL (3000) | ||
+ | |||
+ | // Simple overlay of the AccelStepper that configures for the A4988 | ||
+ | // driver of a 4 wire stepper-including the additional enable wire. | ||
+ | // and makes sure it comes on in the 'off' position. So we do not | ||
+ | // get a loud 'click' on startup. | ||
+ | // | ||
+ | class PololuStepper : public AccelStepper { | ||
+ | public: | ||
+ | PololuStepper(uint8_t step_pin = 0xFF, uint8_t dir_pin = 0xFF, uint8_t enable_pin = 0xFF) | ||
+ | : AccelStepper(AccelStepper::DRIVER, step_pin, dir_pin) { | ||
+ | |||
+ | pinMode(STEPPER_ENABLE, OUTPUT); | ||
+ | digitalWrite(STEPPER_ENABLE, LOW); // dis-able stepper first. | ||
+ | setPinsInverted(false, false, false); | ||
+ | setEnablePin(enable_pin); | ||
+ | setMaxSpeed(STEPPER_MAXSPEED); | ||
+ | setAcceleration(STEPPER_ACCELL); | ||
+ | |||
+ | // power it down - to prevent the stepper motor from | ||
+ | // needlessly heating up (in the door closed position | ||
+ | // the motor does not need to actively 'brake'). | ||
+ | // | ||
+ | disableOutputs(); | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | PololuStepper stepper = PololuStepper(STEPPER_STEP, STEPPER_DIR, STEPPER_ENABLE); | ||
+ | |||
+ | void setup() { | ||
+ | Serial.begin(119200); | ||
+ | // put your setup code here, to run once: | ||
+ | stepper.enableOutputs(); | ||
+ | } | ||
+ | |||
+ | int i = 0; | ||
+ | |||
+ | void loop() { | ||
+ | stepper.run(); | ||
+ | static unsigned long t = 0; | ||
+ | if (millis() - t > 1000) { | ||
+ | Serial.printf("%d -> %d\n", i, stepper.currentPosition()); | ||
+ | t = millis(); | ||
+ | }; | ||
+ | switch (i % 3) { | ||
+ | case 0: | ||
+ | stepper.moveTo(5000); // specify end poistion. | ||
+ | Serial.println("Start"); | ||
+ | i++; | ||
+ | break; | ||
+ | case 1: | ||
+ | if (stepper.currentPosition() >= 5000) { | ||
+ | stepper.moveTo(0); // specify end poistion. | ||
+ | i++; | ||
+ | }; | ||
+ | break; | ||
+ | case 2: | ||
+ | if (stepper.currentPosition() <= 50) { | ||
+ | i++; | ||
+ | }; | ||
+ | break; | ||
+ | }; | ||
+ | } | ||
= Troubleshooting = | = Troubleshooting = | ||
+ | |||
+ | You can now telnet to the node. Or open a webbrowser on the node directly: http://192.168.6.29. This will you show you the log. | ||
Before unplugging anything else, always unplug the ethernet connector from the POESP board FIRST! | Before unplugging anything else, always unplug the ethernet connector from the POESP board FIRST! | ||
Regel 144: | Regel 314: | ||
'''Never disconnect the stepper motor wires from their screw terminals if the ethernet cable is connected / system is powered''' | '''Never disconnect the stepper motor wires from their screw terminals if the ethernet cable is connected / system is powered''' | ||
− | 1. Reset the node by unplugging, counting to 30, and then re-plugging the (hopefully labeled, otherwise see space network diagram) | + | 1. Reset the node by unplugging, counting to 30, and then re-plugging the (hopefully labeled, [[Network setup overview|otherwise see space network diagram]]) PoE cable in the server cabinet. Check the green light on the POESP board. Wait 60 seconds before trying the RFID tag. |
2. If the light on the POESP board is not on/green: | 2. If the light on the POESP board is not on/green: | ||
Regel 151: | Regel 321: | ||
* If no light, unplug the POESP board from the motherboard, connect ethernet. | * If no light, unplug the POESP board from the motherboard, connect ethernet. | ||
* If POESP led lights up - troubleshoot the corresponding module/connection. | * If POESP led lights up - troubleshoot the corresponding module/connection. | ||
− | * If POESP led does not light - POESP is dead. Get a spare from the read shoe box in the lower left drawer next to the electronics table. | + | * If POESP led does not light - POESP is dead. Get a spare from the read shoe box in the lower left drawer next to the electronics table. (If that does not solve it, mail "noc", it might be a POE/network problem) |
* Inform "deelnemerlijst" (all members) of the situation, and make sure there is a spare POESP with firmware in the red shoe box when you are done. | * Inform "deelnemerlijst" (all members) of the situation, and make sure there is a spare POESP with firmware in the red shoe box when you are done. | ||
(Todo: add instructions on how to upload firmware to POESP) | (Todo: add instructions on how to upload firmware to POESP) |
Huidige versie van 23 mei 2025 om 16:22
192.168.6.29 cc:50:e3:8b:27:c7
PoE powered Node on Ethernet for the door of the Space itself.
Mechanics
3D printed (openscad file lost in the midst of time ??, new version in the works)
with an ~40x40 NMEA motor -- 5mm diameter axle & 31x31 mount plate m3x45 depth in motor.
Mechanics - new version
new version being created (May 2025):
Assembly order:
- Mount all inserts
- Insert 5mm bearing
- Insert the 4 bolts for the motor
- Insert spool
- Insert 5mm rod from top
- Mount motor with the 4 screws; take a few turns each time; going round about 5-6 times in total before really tightening it
- Push rod down; make to size & insert/tighten grub-screws
- Mount switches
v1.03 - changes
- Yellow; failed print; gap of 2 layers at 2/3. Cause unclear.
Issues:
- Top hole about 0.3 mm off
- Left switch could use a bit more space
- Both switches could go a mm down or the lever a mm up to get more clearance to mount the bolt-inserts without the solder iron touching the lever.
- Rope hole not ideally placed; more to the wall would align nicer.
v1.04 - changes
- Move left/open switch 0.8mm to the left
- Recenter bearing; correct bearing size: ZZ MR115-2RS; ID=5mm, OD=11MM, H=4MM.
- Seriously thinner spring
- Move rope further away; wider hole
- Added extra holes/option to use smaller/low activation force AV3232613 microswitches
- Colour: black
Todo:
- Replace tie-wrap by wire tube holder
Electronics
Todo: Add schematic / POESP pinout NB: currently POESP v1.1 is used, as the USB/UART and Eth ICs are heating much less in this version. Schematics is for v1.0 (any major differences?)
On the motherboard there are:
- resistor between "Set V++" and GND, setting the voltage output for the stepper motor ("Vmot" terminal of A4988) to 12V
- transistor for amplifying the pulses on GPIO16 for the buzzer
- pull-up resistor for MS1, ensuring the motor is making half-steps (?)
- R-C circuit for the a.k.a. "Project Grote Schakelaar"
- socket for A4988-type stepper motor driver
- Vmotor: 8 - 35V
- Maximale stroom: 1A (2A piek)
- Vlogic: 3,3 - 5V
- header for the POESP board
- 8-pin RFID reader connector (brown/red pin is rightmost)
- 4-screw terminal for the stepper motor
- 2-screw terminal for powering auxillary devices (not connected)
- 2-pin terminal for the buzzer, which sounds when RFID is read successfully
- 2-pin terminal for the a.k.a. "Project Grote Schakelaar". High when switch is off (or wire broken). Goes low when the switch is on.
Pinout of the RFID reader connector
pin | function |
---|---|
1 | SDA |
2 | SCK |
3 | MOSI |
4 | MISO |
5 | IRQ |
6 | GND |
7 | RESET |
8 | 3v3 |
Pinout of ESP32
ESP GPIO | function |
---|---|
2 | Stepper DIR |
4 | Stepper Enable |
5 | Stepper STEP |
16 | Buzzer |
34 | Grote Schakelaar |
13 | MOSI |
12 | MISO |
14 | SCK |
15 | SDA |
32 | RESET (optioneel) |
33 | IRQ (optioneel) |
Stepper screw terminal
see labels on each wire, match with those on terminals
Pin | functie |
---|---|
1 | A - kleur onbekend |
2 | iA - kleur onbekend |
3 | B - kleur onbekend |
4 | iB - kleur onbekend |
Grote Schakelaar header
Cabling to the Project Grote Schakelaar; met deze [code].
Wiring:
Pin | function |
---|---|
1 | Switch; pulled up; to pin 34 of ESP 32 |
2 | Digital ground |
Interpretation of the voltages:
Value | Interpretation | |
---|---|---|
low | Handle in horizontal position - space closed. | |
high | Handle in vertical position -- open. |
2-screw terminal
Pin | function |
---|---|
1 | 12Volt |
2 | power ground |
2025 - new wiring
2025 - wire motor/node
Wire between the motor and the node. There are connectors hidden behind the motor; these can be disconnected and are small enough to fit through 16mm standard PVC pipe.
Kleur | Stekker | Functie | Kleur UTP, Stekker eind |
---|---|---|---|
Blauw | Motor 1A, Zwart Male interconnect | UTP Blauw | Blauw, Stepper connector |
Rood | Motor 1B, Red Male interconnect | UTP Blauw-Wit | Rood, Stepper connector |
Groen | Motor 2A, Red Female interconnect | UTP Bruin-Wit | Groen, Stepper connector |
Zwart | Motor 2A, Zwart Female interconnect | UTP Blauw | Groen, Stepper connector |
Rood | End detect close, 3 pin interconnect | UTP Orange-Wit, Groen-Wit | IO-GND ?? Rood ?? |
Zwart | GND detect, 3 pin interconnect | UTP Orange | IOA ?? Geel ?? |
Geel | End detect open, 3 pin interconnect | UTP Groen | IOB ?? Zwart ?? |
Software
Todo: currently Grote Schakelaar does not work (ESP needs to be coded to use GPIO34 signal / send info to MQTT). Partially coded up at https://github.com/MakerSpaceLeiden/AccesSystem/compare/master...dirkx:master -- but not tested yet.
Updated 2022/2/21 with https://github.com/MakerSpaceLeiden/AccesSystem/releases/tag/cache-fix-2022-02-22-1.01
Stepper motor test script
#include <AccelStepper.h> // for the stepper motor. // Stepper motor-Pololu / A4988 - wiring // #define STEPPER_DIR (0) // was 2 #define STEPPER_ENABLE (12) // was 4 // sleep #define STEPPER_STEP (2) // was 5 #define STEPPER_MAXSPEED (8000) #define STEPPER_ACCELL (3000) // Simple overlay of the AccelStepper that configures for the A4988 // driver of a 4 wire stepper-including the additional enable wire. // and makes sure it comes on in the 'off' position. So we do not // get a loud 'click' on startup. // class PololuStepper : public AccelStepper { public: PololuStepper(uint8_t step_pin = 0xFF, uint8_t dir_pin = 0xFF, uint8_t enable_pin = 0xFF) : AccelStepper(AccelStepper::DRIVER, step_pin, dir_pin) { pinMode(STEPPER_ENABLE, OUTPUT); digitalWrite(STEPPER_ENABLE, LOW); // dis-able stepper first. setPinsInverted(false, false, false); setEnablePin(enable_pin); setMaxSpeed(STEPPER_MAXSPEED); setAcceleration(STEPPER_ACCELL); // power it down - to prevent the stepper motor from // needlessly heating up (in the door closed position // the motor does not need to actively 'brake'). // disableOutputs(); } }; PololuStepper stepper = PololuStepper(STEPPER_STEP, STEPPER_DIR, STEPPER_ENABLE); void setup() { Serial.begin(119200); // put your setup code here, to run once: stepper.enableOutputs(); } int i = 0; void loop() { stepper.run(); static unsigned long t = 0; if (millis() - t > 1000) { Serial.printf("%d -> %d\n", i, stepper.currentPosition()); t = millis(); }; switch (i % 3) { case 0: stepper.moveTo(5000); // specify end poistion. Serial.println("Start"); i++; break; case 1: if (stepper.currentPosition() >= 5000) { stepper.moveTo(0); // specify end poistion. i++; }; break; case 2: if (stepper.currentPosition() <= 50) { i++; }; break; }; }
Troubleshooting
You can now telnet to the node. Or open a webbrowser on the node directly: http://192.168.6.29. This will you show you the log.
Before unplugging anything else, always unplug the ethernet connector from the POESP board FIRST!
Never disconnect the stepper motor wires from their screw terminals if the ethernet cable is connected / system is powered
1. Reset the node by unplugging, counting to 30, and then re-plugging the (hopefully labeled, otherwise see space network diagram) PoE cable in the server cabinet. Check the green light on the POESP board. Wait 60 seconds before trying the RFID tag.
2. If the light on the POESP board is not on/green:
- disconnect ethernet. Disconnect stepper, RFID, and buzzer/schakelaar from the motherboard. Reconnect ethernet.
- If no light, disconnect ethernet and remove the A4988 stepper driver. Reconnect ethernet.
- If no light, unplug the POESP board from the motherboard, connect ethernet.
- If POESP led lights up - troubleshoot the corresponding module/connection.
- If POESP led does not light - POESP is dead. Get a spare from the read shoe box in the lower left drawer next to the electronics table. (If that does not solve it, mail "noc", it might be a POE/network problem)
- Inform "deelnemerlijst" (all members) of the situation, and make sure there is a spare POESP with firmware in the red shoe box when you are done.
(Todo: add instructions on how to upload firmware to POESP)