Coder Social home page Coder Social logo

jonny999999 / cable-length-cutter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 77.85 MB

Firmware for a custom built machine that winds and cuts cable to a specific length using an esp32 controller on a custom pcb

Home Page: https://pfusch.zone/cable-length-cutter

CMake 1.09% Makefile 0.09% C 25.40% C++ 73.42%

cable-length-cutter's Introduction

Overview

Firmware and documentation of a custom built machine that winds and cuts cable to certain lengths.
Extensive details about this project can be found on the website: pfusch.zone/cable-length-cutter

Photo machine

Photo of the built machine

Current Features

  • Measure length using rotary encoder
  • Wind to set length while start-button is pressed
  • Automatic wire cutter
  • Control interface:
    • 2x 7-Segment display showing lengths and notifications
    • Buzzer for acoustic notifications
    • 4 Buttons and Potentiometer for setting the target length
    • Reset and Cut Button
  • Stepper motor controlling a linear axis guiding the cable while winding
  • Store last axis position at shutdown

Usage

Panel Layout

Electrical Details

For detailed documentation of all electrical aspects, see connection-plan.pdf.

Printed Parts

All designed and 3D-printed parts can be found in the cad/ folder. These parts were designed using FreeCAD.

Components

Custom pcb with ESP-32 microcontroller

See connection-plan.pdf

Rotary encoder LPD3806-600BM-G5-24C

- Pulses: 600 p/r (Single-phase 600 pulses /R,Two phase 4 frequency doubling to 2400 pulses)
- Power source: DC5-24V
- Shaft: 6*13mm/0.23*0.51"
- Size: 38*35.5mm/1.49*1.39"
- Output :AB 2phase output rectangular orthogonal pulse circuit, the output for the NPN open collector output type
- Maximum mechanical speed: 5000 R / min
- Response frequency: 0-20KHz
- Cable length: 1.5 meter
- size: http://domoticx.com/wp-content/uploads/2020/05/LPD3806-afmetingen.jpg
- Wires: Green = A phase, white = B phase, red = Vcc power +, black = V0

Variable Frequency Drive T13-400W-12-H

See docs/vfd/

Stepper-driver TB6600

See docs/stepper-driver_TB6600-Manual.pdf

Linear Axis with Nema-12 28HB40 Stepper

See connection-plan.pdf

Installation

For this project ESP-IDF v4.4.4 is required (with other versions it might not compile)

#download esp-idf
yay -S esp-idf 
#alternatively clone the esp-idf repository from github and do `git checkout release/4.4`

#run installation script in installed folder
/opt/esp-idf/install.sh

Build

Set up environment

source /opt/esp-idf/export.sh

(run once per terminal)

Compile

cd board_single
idf.py build

Flash

  • connect FTDI programmer to board (VCC to VCC; TX to RX; RX to TX)
  • press REST and BOOT button
  • release RESET button (keep pressing boot)
  • run flash command:
idf.py flash

cable-length-cutter's People

Contributors

jonny999999 avatar

Watchers

 avatar

cable-length-cutter's Issues

Optimize guide_auto-home: store old position in nvs to prevent long crash

Prevent stepper from crashing into the hardware limit for too long .

Currently it moves for the entire axis length to the left after startup
e.g. when almost at start position already, long annoying sound and possible hardware damage occours

  • when starting auto-home, move to the left for remaining distance + certain offset to be sure => crashes for less time

idea 1: store repeatedly:

  • store current position in nvs repeatedly
    • each time stopping?
    • at certain interval when changed?
    • => bad idea due to limited write cycles of flash

idea 2: store at brownout:

  • use brownout detection interrupt -> store when power down detected, see https://www.esp32.com/viewtopic.php?t=6855
    • test if current ps turns off slow enough
    • at starup only?
    • when already running use current value?

idea 3: use ADC to detect power-down:

  • use ADC that measures 12V input voltage
    • use adc threshold interrupt to store position in nvs when 12V start to decrease
    • this gives controller more time until power is actually gone
    • see issue esp-idf on adc_digi -> seems to be difficult in esp-idf v4.4.4

idea 4: external comparator circuit and digital interrupt

  • build external comparator circuit and digital interrupt
    • opamp as comparator and trim potentiometer to adjust threshold
    • use free digital GPIO as digital input
    • use interrupt at falling edge
    • ISR stores current pos in nvs

Guide Axis: weird movement at reset

axis travels about 4 times left and right for approx 2cm and then to 0 (as desired)

steps to reproduce:

  • wind up 50m
  • press RESET

=> should drive straight to 0

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.