Fabio A. Cruz Sanchez
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: Documentation of the Open Source MFI author: Matthieu Lalin <matthieu.lalin@viacesi.fr>; tag: OSMFI --- # Open Source MFI ## 🎉 Welcome :::success This is a template for the documentation of the OSMFI ::: The document is structured in four main blocks 1. Hardware 2. Electronical 3. Software 4. Guide of utilisation # :heavy_check_mark: Hardware ## Bill of materials - ELECTRONIC EQUIPMENT: - [ ] 1x Power supply DC 220V-24V - [ ] 3x Stepper motor 17HS19-1684S-PG5 - [ ] 2x Driver DRV8825 (Pololu md20b) - [ ] 1x Load cell (DYMH-103) - [ ] 1x Force sensor amplifier (SEN-13879) - [ ] 2x Arduino nano cards - [ ] 2x LCD display - [ ] 1x Omron Solid State Relay (G3NA-210B-UTU-DC5-24) - [ ] 1x Thermocouple Amplifier AD8495 (1528-1407-ND) - [ ] 2x Push buttons - [ ] 2x Electrical resistor 220 Ohm - [ ] 2x Electrical resistor 4700 Ohm - [ ] Wires - MECHANICAL COMPONENTS: ![](https://hackmd.io/_uploads/Hkyb8qIZp.png) See the link: https://cad.onshape.com/documents/59b16c81bc51fa4513b7b3aa/w/b41da56b748dfed392686c43/e/54603c43afe217e1b0a85f45?renderMode=0&uiState=6527e1cbff8c4960ee829832 # :heavy_check_mark: Electronical ## Full wiring diagram ![](https://hackmd.io/_uploads/r1rwFYrb6.png) See the link: https://www.tinkercad.com/things/21Z0t2xGjvt-editing-components/editel?sharecode=Dp8P41lBpGLax38SC_PJbHlBYpowHJiJ5bP8Q98XGOU # :heavy_check_mark: Software ## Code for the first arduino ```arduino // Download the following libraries to run the LCD #include <Wire.h> #include "rgb_lcd.h" #include <AccelStepper.h> #define TC_PIN A0 // set the ADC pin used #define AREF 5.0 // set board voltage as 5.0 V #define ADC_RESOLUTION 10 // ADC bit resolution setting, 10 being the default value // Manipulation to convert an analogue value into a digital value to obtain a temperature. float reading, voltage; float get_voltage(int raw_adc) { return raw_adc * (AREF / (pow(2, ADC_RESOLUTION)-1)); } float get_temperature(float voltage) { return ((voltage - 1.25) / 0.005)-6; } AccelStepper stepper (AccelStepper::DRIVER, 3, 4); rgb_lcd lcd; // Definition of pins and variables const int relaisPin = 9; // Pin relay status management int sensHautPin = 7; // Pin status management motor drive button up int sensBasPin = 8; // Pin status management motor drive button down const int EtatPoidsPIN = 5; // Pin status Force applied at setpoint double Setpoint = 200; // Setpoint temperature in degrees Celsius double Input; // Temperature reading const int dirPin = 12; // Pin direction filament cutting motor const int stepPin = 11; // Pin steps filament cutting motor const int stepsPerRevolution = 200; // Number of steps motor revolution filament cutting unsigned long tempsPrecedent = 0; // Time variable unsigned long tempsPrecedent_decoupe = 0; // Time variable unsigned long intervalle = 500; // Time interval between each temperature reading (in milliseconds) unsigned long intervalle_decoupe = 15000; // Time interval between each step for filament cutting (in milliseconds) int colorR = 0; int colorG = 0; int colorB = 0; void setup() { // Declaration of motor command Input and Output pins pinMode(sensHautPin, INPUT); pinMode(sensBasPin, INPUT); // Declaration of the weight setpoint input pin pinMode(EtatPoidsPIN, INPUT); // Initialise the relay control pin pinMode(relaisPin, OUTPUT); digitalWrite(relaisPin, HIGH); // The relay is initially switched off // LCD definition lcd.begin(16, 2); } void moteurdecoupage() // Filament cutting loop { // Turns the motor to cut the filament for(int x = 0; x < stepsPerRevolution; x++) { digitalWrite(stepPin, HIGH); delayMicroseconds(1500); digitalWrite(stepPin, LOW); delayMicroseconds(1500); } } void moteursenspositif() // Motor start loop (positive direction) { stepper.setMaxSpeed(500); // Maximum speed (in steps per second) stepper.setSpeed(500); // Operating speed (in steps per second) stepper.runSpeed(); } void moteursensnegatif() // Motor start loop (negative direction) { stepper.setMaxSpeed(-500); // Maximum speed (in steps per second) stepper.setSpeed(-500); // Operating speed (in steps per second) stepper.runSpeed(); } void regulation() // Temperature control loop { //Recover values and convert them into a usable value reading = analogRead(TC_PIN); voltage = get_voltage(reading); Input = get_temperature(voltage); //Display on LCD screen lcd.setCursor(0, 0); lcd.print ("T mesure("); lcd.print ((char)223); lcd.print ("C):"); lcd.print (int(Input)); lcd.print (" "); lcd.setCursor(0, 1); lcd.print ("T cible("); lcd.print ((char)223); lcd.print ("C):"); lcd.print (int(Setpoint)); lcd.print (" "); // LCD colour management if((Input<(Setpoint-2)) || (Input>(Setpoint+3))) { colorG = 0; colorR = 255; } else { colorG = 255; colorR = 0; } lcd.setRGB(colorR, colorG, colorB); // Activation or deactivation of the relay depending on the temperature reading if (Input > Setpoint) { digitalWrite(relaisPin, 0); // Switch on the relay } else { digitalWrite(relaisPin, 1); // Switch off the relay } } void loop() // Main loop { // Timing and loop management unsigned long tempsActuel = millis(); if (tempsActuel - tempsPrecedent >= intervalle) { tempsPrecedent = tempsActuel; regulation(); } if ((digitalRead(sensHautPin) == HIGH) and (digitalRead(sensBasPin) == LOW) and (digitalRead(EtatPoidsPIN) == HIGH)) { moteursenspositif(); } if ((digitalRead(sensBasPin) == HIGH) and (digitalRead(sensHautPin) == LOW) and (digitalRead(EtatPoidsPIN) == HIGH)) { moteursensnegatif(); } unsigned long tempsActuel_decoupe = millis(); if (tempsActuel - tempsPrecedent_decoupe >= intervalle_decoupe) { tempsPrecedent_decoupe = tempsActuel_decoupe; moteurdecoupage(); } } ```` ## Code for the second arduino ```arduino // Download the following libraries to run the program #include "HX711.h" #include <Wire.h> #include "rgb_lcd.h" // Definition of load cell connection pins const int LOADCELL_DOUT_PIN = 2; const int LOADCELL_SCK_PIN = 3; const int POIDS_MESURE = 5; double POIDS; double POIDS_CONSIGNE = 500; HX711 scale; rgb_lcd lcd; void setup() { // Definition of the LCD display const int colorR = 95; const int colorG = 0; const int colorB = 183; lcd.begin(16, 2); lcd.setRGB(colorR, colorG, colorB); lcd.print("Calibration..."); // Initialise the load pin pinMode(POIDS_MESURE, OUTPUT); // Load cell calibration scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN); scale.read(); scale.read_average(20); scale.get_value(5); scale.get_units(5); scale.set_scale(200.f); // 200 for the value used to calibrate the sensor scale.tare(); scale.read(); scale.read_average(20); scale.get_value(5); scale.get_units(5); } void loop() { // Displays the weight applied on the LCD POIDS = (scale.get_units()); lcd.setCursor(0, 0); lcd.print("Poids exerce: "); lcd.setCursor(0, 1); lcd.print(POIDS,0); lcd.print(" g"); lcd.print(" "); // Conditioned extraction of the weight setpoint to the main arduino if(POIDS < POIDS_CONSIGNE) { digitalWrite(POIDS_MESURE, HIGH); } else { digitalWrite(POIDS_MESURE, LOW); } // Puts the ADC on standby scale.power_down(); delay(100); scale.power_up(); } ```` # :heavy_check_mark: Guide of utilisation ![](https://hackmd.io/_uploads/SJjTs68-a.jpg) ![](https://hackmd.io/_uploads/SyDexCLbT.jpg) For the moment, the interface is not directly interactive. If you want to modify variables for the experiment, you have to work directly on the code: ## How does it work? - PREPARATIONS 1. To begin with, you need to supply power to the power supply units and the ARDUINO card. 2. The load cell will take a few seconds to calibrate. ![](https://hackmd.io/_uploads/HyWs1R8Wp.jpg) 3. At the same time, the temperature of the casting cylinder will rise to the set temperature. 4. Once the load cell is calibrated, one of the LCD displays the weight applied to the piston. ![](https://hackmd.io/_uploads/rkSN10UW6.jpg) ![](https://hackmd.io/_uploads/rykHJCUZp.jpg) 5. Once the set temperature has been reached, the colour of the other LCD changes (the temperature is then regulated to maintain the set temperature). ![](https://hackmd.io/_uploads/r1OeAp8-a.jpg) ![](https://hackmd.io/_uploads/rkQvA6UWT.jpg) ![](https://hackmd.io/_uploads/HJqPCa8ZT.jpg) 6. The tests are ready to start - THE TEST 1. Insert the plastic shavings into the casting cylinder 2. Position the piston above the cylinder opening and start its descent using the push buttons controlling the motors. 3. Wait for each cycle (number of cycles to be chosen) of cutting the filament and take the quantity cut. 4. Weigh the quantity of each sample and average the mass 5. Calculate the MFI value 6. Repeat the experiment with different applied forces NB: The higher the MFI value of a thermoplastic, the lower its viscosity. ## Which variables change what? - If you want to change the force to be applied to the piston, you have to change the value of the following line : ```arduino double POIDS_CONSIGNE = 500; ``` (the variable "POIDS_CONSIGNE" is expressed in "g") The setpoint weight defines the state of the stepper motors: if the setpoint is exceeded, the motors stop, if it is not exceeded, the motors run. - If you want to change the time between two filament cuts, you have to change the value of the following line : ```arduino unsigned long intervalle_decoupe = 15000; ``` (the variable "intervalle_decoupe" is expressed in "ms") - If you want to change the setpoint temperature, you have to change the value of the following line : ```arduino double Setpoint = 200; ``` (the variable "Setpoint" is expressed in "°C") ![](https://hackmd.io/_uploads/S1yH-3UWa.jpg) Detail to consider: The setpoint temperature is 20°C lower than the temperature of the extruded plastic at the nozzle outlet. ## Next step ? - [ ] Integrate an interactive interface allowing the above variables to be modified without having to intervene directly on the code. - [ ] Replace the pressure buttons for raising and lowering the piston pressure plate with a 3-position button - [ ] design a tipping funnel to facilitate the insertion of plastic chips into the casting cylinder

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully