Fiveteenth Week

MACHINE DESIGN

WEEK 2 : MACHINE DESIGN WEEK

Index

  1. WEEK TASK : For the week´s assignment the goal is : Learn about
    1. .Introduction and Thanks.
    2. My week Rol. The Code Team experience.
    3. .Settings.The enviroment.
    4. Installing.
    5. References Programs for begin.
    6. The music picker machine code.
  2. Files
  3. My Week Problems Solved
  4. Things I Learned
  5. My Week Conclusions
  6. First things i want to do this week is say thanks, the last 2 weeks were really difficult to me, my ancient Yorkie died (the best pet i had in my live) while i was programing our machine website and a lot of people have helped me to get up with their advice, understanding and affection :

  7. My instructors : Epifanio Cueva Lorenzo . His support the 1st day when i arrived back to the fablab. I will never forget your empathy and advices.
  8. Covadonga. Your hug, your sweet words always, thanks for be as you are.
  9. My Guru : Nuria Robles. For her patient, support and love when you called me "my little girl" at the last review, really felt you .
  10. My new colleague, the old fabAcademy student Borja for your advice preparing the enviroment.
  11. The people at Fablab Sevilla for inspire me to help others.
  12. To my classmate Javi Burón for getting me out of the labyrinth of the "Picker Algorithm" and allowed to me make my generative visuals for my next show.

  13. To the rest of my classmates Dani, Alvaro and Juan, for their patient and empathy the last weeks, thanks guys.

    HERE IS THE WEBSITE :

    MTM : THE MUSIC PICKER MACHINE WEBSITE

    THE CODE TEAM EXPERIENCE

    At the CEU Fablab Team, we are 5 people working on the machine but just Javi Burón and me with programming background. I never used Python for code steppers so thanks to another languages experiences such as maxuino (a mix between arduino and max) always had clear the things to make with moves but i didn´t knew nothing about Gestalt Nodes, never used a RS 485 and of course never saw Nadya´s examples before.

    The Music Picker Machine involve me deepthly during 2 weeks in long reading sessions, so i learn a lot things about Gestal Frameworks Networking, about Python, about other machines, about my system, as all weeks, i learned a lot about new commands lines for solve things.

    Here are an Essential :

    Python for beginners : If you are new in Python like me read it: Python Introduction

    Official Getting Started webpage

    1.Download and install Python : Official website

    Discarting Electronics Problems

    I had a lot problems for solved problems finding the RS485 so this learned me a lot about connections and the method for resolved conflicts directly from my Terminal.

    Our instructor always is with us learned in correct way, comments our fails and mistakes for adcquire new methods for work. During the fabAcademy just me are using a laptop with OSX so he is always finding solutions for my problems. This week assignment he help me to resolve a strange problem by a driver conflict which was causing misterious things (sometimes usb port appears sometimes not) every time i wont code during the last weeks. The solution make all works in minutes but find it was 2 days installing and uninstalling things from 0, reading tutorials, a lot forums and trying command lines at terminal. I love spent time with this kind of search but this week i felt very tired and was more difficult than other times.

    The Problem was a D2XX Driver have a "helper" (after this i called it the unhelper) that sometimes cause a conflict finding FTDI devices. The solution for solved the problem was find at the Installation Manual D2XX Driver.

    Set Up the Enviroment

    1. Following the Tutorial :

    I created a new Folder for all things and have all in focuss :

    a) Download Python 2.7 : I downloaded it from official site. First and after see another MTM web references i dowloaded the 3.3 version apropiated for my 10.10 OSX but finally during RS 485 problems, uninstalled it and installed 2.7 version for discart software conflicts.

    Downloading Python IDE or Python interpreter:

    IDE Options : Official website

    My IDE election: pyCharm. It's easy for a python beginner and also quite powerful for managing python projects. Borja advice me about it. When i was testing and identifing the gestalt nodes i had problems with sintax so idecided use it for know quick where are my mistakes writing the code.

    Interpreter

    IDE Options : Official website

    Getting started: Tutorials for Beginners

    Python interptreter VS Python IDE (PyCharm): The interpreter is the command line in the Terminal. You can use it for programming. The PyCharm is an IDE for programming: supports listing all program files, syntax highlighting and other features.

    b) Download and install PySerial 2.7 : I dowloaded from official.

    c) Download and install FTDI

    d) Download Nadya Peek´s Gestalt Master : Gestalt is a control system framework for personal fabrication. Useful links for understanding the Gestalt framework:

    e) Download E.Moyer Github Master :

    2. Installing all downloaded

    a) Setup Gestalt: STEP by STEP

    Navigate via Terminal to the folder you where have pyserial extracted, in this folder you should have a file called "setup.py"

    sudo python ./setup.py install

    b) ¿Programming the Gestalt Node with and AVR? Why? -> No

    Are nodes already programmed? Yes, we have it.

    c) Installing pyserial -> in order to talk over serial . pySerial is a module to communicate python with the serial port ( Python Serial Port Extension ).

    Navigate in the command line where your pyGestalt folder is located. Run the command:

    sudo python ./setup.py install

    3. References Codes for begin:

    The Nadya´s Gestalt master contains, in addition to framework, code example which is a good seed to begin work. In the folder "examples/machines" will find several projects. I was studying the examples for identify the main functions that makes things work so i commented all:

    At the pic below you can see how i made the first modify, every time you connect your RS485 you must to change the lines in Serial Function, in my case :

    We made the FTDI cable for serial communication, following the steps in :

    Official website

    This Wire connect to the gestalt board, engine and feed the board with 12v and a maximum of 2A.

    Here is the simple diagram reference :

    And the fabNet pin connectors described al Mechanical Design Week :

    The Picker Machine & Gestalt Nodes

    As you see above, our machine use 3 Axis for the moves.

    The order to connect all electronics is important : Every time you want to check or add another node always Switch OFF the Power Suply first for not damage the nodes.

    - Connect the each motor with his Gestalt node

    - Connect the Main Gestalt Node to the FabNet

    - Connect the RS485 to the computer

    - Connect the Power Suply

    - Switch on the Power Suply

    I was trying everything to be correct, accessing from console or terminal to the folder : "/examples/machines/htmaa" and run the script :

    single_node.py (if you are using linux, remember to put before sudo to work properly).

    If all goes well, the blue led from gestalt board blinks and at terminal screen you will see instructions indicating that we must press the button what you want to link to the program. Click the button and observe the motor connected to the board begins to rotate.

    Before connect another gestalt node i was testing all motors and drivers for be sure all electronics is correct. All works fine so i decided to start connecting the second Stepper.

    Music Picker Machine : The Code from Pilu Caballero on Vimeo.

    It's time to try two Gestalt with our instructor for advance, repeat the previous step interconnecting two boards as described in the diagrams provided below.

    Before you run a new program, it must be said that within the source code you will find the following command/funtion:

    virtualMachine(persistenceFile = "test.vmp"), with the line managed to save the address of the Gestalt linked in other executions of the program, this it´ss not necessary to press the buttons on the board every time you run the script.

    If you want to start over and the gestalt boards linking different axes (e.g. define as "y axis" a board that acted as "x axis" or simply replace them with others) we must delete this file, is a common mistake to have linked a board and trying to run with another different board get errors because the device is not. Once clarified this, you can run another script in the same folder, which in this case will move two axes of our machine.

    When running in console python xy_plotter.py blinked bue leds of the two boards and on-screen gave us instructions to press the button on the board that would be the "x axis ", once you press another message asked us repeat the same action for the "x axis ". After this the script continued its runtime and both engines were its rotational movement.

    OUR PICKER MACHINE CODE

    WHAT moves must to do our motors :

  14. X Axis move the machine to the Music Sheet 70 mm size between notes each 2mm
  15. Y Axis move the Header to make holes perforation
  16. Z Axis Roll Music Sheet beetwen line notes each 4mm

    1. Modifying xy_plotter.py example for add the z Axis : My Instructor suggested the xyz_Example from oficial tutorial for deserve as back up. But i decided add all by me for learn and practice all tutorials reviewed.

    2. After this and as i haven´t the machine i decided start with something with the goal to have the main things before work with my classmate Javi , so i declared the variables based in the steppers moves for apply 8 notes and add more notes later.

    3. And a example Array for this variables :

    4. A For folowwing the Python reference : It has the ability to iterate over the items of any sequence, such as a list or a string.

    Finallly We was ready for focuss and here are our code :

    OUR VARIABLES

    Javi gently change some things such the expression for Y Axis to ´revolutions´

    OUR SONG

    The song data is stored in a bidimensional array, first dimension are the lines of each song and second dimension are the notes within each line. I used this great online editor to understand the notes that the music box used and how the roll sheets are structured. By the way the above song array is the intro theme of Star Wars!!

    THE MAGIC

    This is where all the magic happens: we iterate for each line of the song, creating the neccesary instuctions for the machine and appending each movement within the moves array, in pseudocode :

  17. For each line in song position the z_roller
  18. If not empty then for each note move the first x_note in the row
  19. Make the perforation with y_perforation one revolution
  20. Go back to the position x = 0
  21. Move to next line

    The last for loop is taken straight from the example code and feeds the machine with the moves array and checks that the last move has happened before sending the next one.

    For surprise to my classmates i made some helps for our Final Video based in some sheet perforated :

    Design Words for Music Picker Vídeo from Pilu Caballero on Vimeo.

    Prototype Words for Music Picker Vídeo from Pilu Caballero on Vimeo.

    Building Time Words for Picker Music Machine video from Pilu Caballero on Vimeo.

    Code Words for Music Picker Machine Vídeo from Pilu Caballero on Vimeo.

    WEEK´s LEARNED

    This week i learned a lot about the Python enviroments, about Gestalt Frameworks. Obviously hot to power our machine, hot to wire better. At programming i learned about the use of arrays for motors movements and new midi parsers.

    WEEK FILES

    The Music Picker Machine Code

    Javi´s midiparser

    WEEK CONCLUSIONS

    Work with people that neve consider the effort for advance, people as don´t believe in communication as a group was really difficult.

    My own goal was have the music picker machine program and now we have the main things.

    Probably if my fabmates focuss in the design we would have the machine ready for work.

HAVE YOU TASK COMPLETED
Explained your individual contribution to this project on your own website YES