Welcome to Our Community

Some features disabled for guests. Register Today.

Building positioning system: How to log the traveled coordinates in Excel table?

Discussion in 'Control Software' started by Sylven Claessen, Apr 9, 2019.

  1. Sylven Claessen

    Builder

    Joined:
    Apr 8, 2019
    Messages:
    1
    Likes Received:
    0
    Hi fellow makers,

    I am building a positioning system for measuring the efficiency in energy transfer between 2 coils (inductors), in multiple positions.
    I've bought the LEAD CNC 1010 with the Arduino Compatible Motion Control System (Crowduino with stepper motor board using GRBL).

    My intention is to
    - Do a few modifications on the LEAD CNC as you can see in the pictures.
    - Position the 2 coils (stationary and moving) close to each other and SET this as a ZERO POINT
    - Execute a program which will
    1. Move the moving coil x mm (let's say 100mm) right on X-axis. In steps of 1 mm. And at each step, it will pause 0.5 sec
    2. Move the moving coil 1 mm down on the Y axis
    3. 100 mm left X-axis. In steps of 1 mm. And at each step, it will pause 0.5 sec
    4.... continue like illustrated in How coil on CNC will move.jpg

    In those pauses, a program (Probably codes in Python) will read the oscilloscope's channel 1 & 2, which the coils are connected to. And write the values of channel 1 & 2 in an Excel table (or other table).

    I would like the coordinates of the CNC to also be written in that same Table.
    So that I can just hit START. Come back 30 minutes later and the efficiency at every coordinate is logged into a table.

    My question (hoping someone of you might know) is:
    0. Has this been done before?
    1. Is this possible?
    2. Is this possible using OpenBuilds Software?
    3. What would I need to do to create this software?

    Ps. I have never written in G-code before, but I'd guess it is quite easy to code this positioning procedure.

    I hope that my question is clear enough. If not, feel free to ask for clarification. Thanks!
     

    Attached Files:

  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2013
    Messages:
    1,190
    Likes Received:
    591
    0: probably, pretty much everything has been done, even if you can cannot find it on google (-:

    1: yes.

    2: no. because you need coordination between the gcode that is sent to move the machine and the oscilloscope reads and the file writes, you will need a custom program for this. I would use Python because the basics of communicating with GRBL already exist.... gnea/grbl .. simple-stream

    3: grab a copy of the simple-stream script and add what you need. you may want to create a function from the existing code called something like 'talktogrbl(x,y,z)' that will make the machine move and return true if all is ok.

    talktogrbl would send a string of gcode like this
    G1 X{} Y{} Z{}
    where the {} are replaced by the numbers given to the function. you will need a header and footer to safely set up and stop the machine, look at any existing Gcode for details, such as that produced by cam.openbuilds.com

    then the rest is something like (pseudocode)
    Code:
    sendheader()
    positions = array of places to go as x,y,z tuples
    
    for position in positions:
       talktogrbl(position[0], position[1], position[2])
       result =  measurecoil()
       writetofile(position,result)
    
    sendfooter()
    
    writetofile will write the given position and result as a CSV string to the output file.
    Excel knows how to read in CSV files (-:

    Hope this helps ... simpler than the offside rules in rugby as my math teacher used to say (-:
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice