Measure pressure in tube with stepper motor?



  • Hey there,

    I've got a ceramic printing kit connected to the DUET.

    The kit has a feeder - a stepper motor with lead screw that pushes a piston in an acrylic tube.
    I'd like very much to know the pressure in the tube. I've read that there's a way to calculate pressure like that a DC motor (something with current?)...
    was wondering if there's a nice way to calculate the pressure with the current setup.

    thanks!

    0_1560785338193_ee1ff709-5e7e-4868-9965-a5fa873812c6-image.png



  • In theory it might be possible to use the "stallGuard2" feature of the TMC2660 drives to do what you want. It's the mechanism used by sensorless homing.
    https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2660_datasheet.pdf

    It would require experimentation and firmware hacking to verify if this is even possible.

    It is probably easier to use a DC motor with something like ODrive, or a servo. And check the motor current.
    Or even easier to use a load cell on the piston axle.



  • @bondus said in Measure pressure in tube with stepper motor?:

    stallGuard2

    how can I read the load from the tmc with the DUET ?



  • I'd perhaps start by verifying stallguard can work at the speed you need, if the stepper is moving very slowly it might not be table to work. I.e. try adding sensorless homing to the stepper and see if you can get the stepper to stall and trigger an endstop while extruding normally?

    Then you'd probably have to dive into the firmware code get a hold of the load angle to infer the pressure.


  • administrators

    The M122 report includes the highest and lowest values seen in the SG (StallGuard) register since the last M122 command or since the Duet was powered on. The range is 0 (high load) to 1023 (low load). The stall threshold set in M915 affects the SG value.



  • you lost me..

    any straight forward examples/codes ?



  • @dc42 said in Measure pressure in tube with stepper motor?:

    M122

    M122:

    === Diagnostics ===
    RepRapFirmware for Duet 2 WiFi/Ethernet version 2.02(RTOS) running on Duet WiFi 1.02 or later + DueX5
    Board ID: 08DGM-917DA-G4MSJ-6J9FD-3S46S-9SP7A
    Used output buffers: 3 of 20 (9 max)
    === RTOS ===
    Static ram: 25524
    Dynamic ram: 98548 of which 0 recycled
    Exception stack ram used: 368
    Never used ram: 6632
    Tasks: NETWORK(ready,648) HEAT(blocked,1232) MAIN(running,3924) IDLE(ready,200)
    Owned mutexes:
    === Platform ===
    Last reset 00:30:53 ago, cause: software
    Last software reset at 2019-06-18 18:30, reason: User, spinning module GCodes, available RAM 6728 bytes (slot 2)
    Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0441f000 BFAR 0xe000ed38 SP 0xffffffff Task 0x4e49414d
    Error status: 0
    Free file entries: 10
    SD card 0 detected, interface speed: 20.0MBytes/sec
    SD card longest block write time: 0.0ms, max retries 0
    MCU temperature: min 31.1, current 31.6, max 32.8
    Supply voltage: min 11.7, current 12.1, max 12.2, under voltage events: 0, over voltage events: 0, power good: yes
    Driver 0: standstill, SG min/max not available
    Driver 1: standstill, SG min/max not available
    Driver 2: standstill, SG min/max not available
    Driver 3: standstill, SG min/max 0/1023
    Driver 4: standstill, SG min/max not available
    Driver 5: standstill, SG min/max not available
    Driver 6: standstill, SG min/max not available
    Driver 7: standstill, SG min/max not available
    Driver 8: standstill, SG min/max not available
    Driver 9: standstill, SG min/max not available

    Date/time: 2019-06-18 19:01:11
    Cache data hit count 4294967295
    Slowest loop: 2.12ms; fastest: 0.07ms
    I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0
    === Move ===
    Hiccups: 0, StepErrors: 0, LaErrors: 0, FreeDm: 240, MinFreeDm: 234, MaxWait: 119359ms, Underruns: 0, 0
    Scheduled moves: 62, completed moves: 62
    Bed compensation in use: none
    Bed probe heights: 0.000 0.000 0.000 0.000 0.000
    === Heat ===
    Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1
    Heater 1 is on, I-accum = 1.0
    === GCodes ===
    Segments left: 0
    Stack records: 1 allocated, 0 in use
    Movement lock held by null
    http is idle in state(s) 0
    telnet is idle in state(s) 0
    file is idle in state(s) 0
    serial is idle in state(s) 0
    aux is idle in state(s) 0
    daemon is idle in state(s) 0
    queue is idle in state(s) 0
    autopause is idle in state(s) 0
    Code queue is empty.
    === Network ===
    Slowest loop: 22.94ms; fastest: 0.00ms
    Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) Telnet(0)
    HTTP sessions: 1 of 8

    • WiFi -
      Network state is running
      WiFi module is connected to access point
      Failed messages: pending 0, notready 0, noresp 0
      WiFi firmware version 1.22
      WiFi MAC address cc:50:e3:0d:26:13
      WiFi Vcc 3.31, reset reason Turned on by main processor
      WiFi flash size 4194304, free heap 27568
      WiFi IP address 192.168.252.180
      WiFi signal strength -61dBm, reconnections 0, sleep mode modem
      Socket states: 0 0 0 0 0 0 0 0

    should I read something else?


  • administrators

    @cj-bravo said in Measure pressure in tube with stepper motor?:

    Driver 0: standstill, SG min/max not available
    Driver 1: standstill, SG min/max not available
    Driver 2: standstill, SG min/max not available
    Driver 3: standstill, SG min/max 0/1023
    Driver 4: standstill, SG min/max not available
    Driver 5: standstill, SG min/max not available
    Driver 6: standstill, SG min/max not available
    Driver 7: standstill, SG min/max not available
    Driver 8: standstill, SG min/max not available
    Driver 9: standstill, SG min/max not available

    That tells me that the only driver that has moved is driver 3 since power up ot the last M122, and the load on that driver has varied between almost nothing and very heavy (probably stalled).



  • How about placing a force sensor between the lead screw and the piston and connect it to something that can read it? This will also give you the pressure.

    Ali has many such sensors, e.g.

    https://www.aliexpress.com/item/10kg-Thin-Film-Water-Pressure-Sensor-Resistor-type-Flexible-Pressure-Resistor-Force-Sensor-Gas-Pressure-Measurement/33010033536.html


Log in to reply