Mini Mill DRO, a different approach

Results 1 to 15 of 15

Thread: Mini Mill DRO, a different approach

  1. #1


  2. #2
    Registered James Newton's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    1397
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hey that's pretty neat. What model of rotary encoder did you use? And is that an Arduino or what?

    James hosts the single best wiki page about motors for CNC hobbyists on the net:
    http://techref.massmind.org/techref/io/motors.htm Disagree? Tell him what's missing! ,o)


  3. #3
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hi James, thank you

    It is a 600 pulses per rotation encoder; got from eBay
    On the code, I count the encoder channels A and B on rise and fall, for a total of 2400 pulses per rotation.
    The processor is a Arduino mini-pro (5 V, 16 MHz).
    The display is a 4 digit I2c module, I will change it to a 8 digit SPI to show the + or - sign and 0.0005 position.

    Wagner



  4. #4
    Registered
    Join Date
    Jul 2004
    Location
    N/A
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Very interesting project .can you open Arduino code and circuit diagram.



  5. #5
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hy qazplm800,

    The code can be found here: Mini Mill DRO
    The connections are indicated on the code.

    Also, see the full DRO: Mini Mill DRO

    Wagner



  6. #6
    Registered
    Join Date
    Jul 2004
    Location
    N/A
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach



    Last edited by qazplm800; 07-01-2015 at 11:26 AM.


  7. #7
    Registered
    Join Date
    Jul 2004
    Location
    N/A
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    HI Wmcnc
    Thank you for your contribution and answer.
    my machine screw 4mm pitch / encoder pulse 500.
    ( Encoder factor (1/((600*4)/(12*0.08))*10000) )
    How to calculate change Arduino code.
    Best regards.
    tk



  8. #8
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hi qazplm800,

    On the equation:

    600 is the number of pulses per revolution of the encoder
    4 if the is the number of interruptions per pulse (The code measures the encoder lines A and B on rising and falling)
    12 is the number of teeth on the timing pulley
    0.08 if the pitch on the timing belt (in inches)
    10000 is the count on the display per inch of displacement

    Applying the equation, the factor for my machine is 4.
    1 inch of displacement will be 12.5 teeth on the belt (1 / 0.08). This will turn the pulley 1.041666 rotation (12.5 / 12), in a encoder with 600 pulses per revolution, this will generate 625 pulses (1.041666 * 600), times 4 interruptions per pulse, a total of 2500 counts. 2500 counts times factor of 4, gives the value 10000 (one inch, since the code puts a decimal point on the 5th display)

    If you need more help, please send more information about your application.
    Do you want to measure in inches or mm ?
    1/10000 or 1/1000 of a inch ?
    1/1000, 1/100 or 1/10 of a mm?
    Is your screw connect directly to the encoder ? No reduction ?

    Wagner



  9. #9
    Registered
    Join Date
    Jul 2004
    Location
    N/A
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    HI..Wagner
    my max7219 number left and right reversion.
    can tell me change this question Arduino code.
    yes screw connect directly to the encoder no reduction no pulley.
    I want to measure 1/100 mm.
    Best regards.
    tk
    IMG_20150702_212012.jpg



  10. #10
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hello qazplm800,

    Nice picture.

    As I understand, your machine screw is 4 mm pitch, meaning that at one turn of the screw, your setup moves 4 mm and you want the display to show 4.00
    I also understand that your encoder generates 500 pulses per rotation.

    So, 1 turn = 4.0 mm, 500 pulses * 4 interruptions equal 2000 counts. To convert to 400 units, multiply by 0.2

    change the line:
    #define SCF 4.000000 // Encoder factor (1/((600*4)/(12*0.08))*10000)
    to
    #define SCF 0.2 // Encoder factor 4 mm pitch, 500 * 4 pulses/rotation 1/100 mm resolution (400/(500*4))

    To revert the display and move the decimal point to the 3rd display, change the display function (this is untested)

    change the function ThrDsp(void) to:

    void ThrDsp(void) // Display measure
    {
    long v;
    int i,n,m;


    n=0;
    v=DroMea;
    if(v<0)
    {
    n=1;
    v*=-1;
    }
    for(i=0;i<8;i++)
    {
    m=v%10;
    switch(i)
    {
    case 0:
    case 1:
    lc.setDigit(0,7-i,m,false);
    break;
    case 2:
    lc.setDigit(0,7-i,m,true);
    break;
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    if(m)
    lc.setDigit(0,7-i,m,false);
    else
    {
    if(n)
    {
    n=0;
    lc.setChar(0,7-i,'-',false);
    }
    else
    lc.setChar(0,7-i,' ',false);
    }
    break;
    }
    v/=10;
    }
    }



    Good luck,

    Wagner

    PS. The forum messed-up the function text format. Missed the indentation.
    Please find attached the plain text of it.

    Attached Files Attached Files


  11. #11
    Registered
    Join Date
    Jul 2004
    Location
    N/A
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hi....Wagner
    Displays ten position only displays 1-9. not display 0
    I try to learning change Mill DRO Arduino code question.
    But i was kindergarten Arduino C language.
    max7219 number left and right reversion is my wrong PCB
    Could you tell me Change two problem.
    Once again thank you for your help.
    Best regards.
    tk
    dro_001_1.png



  12. #12
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hi qazplm800,

    My mistake.
    Please change the code (on the function ThrDsp) from if(m) to if(v), as follows:


    case 7:
    if(
    v) // was if(m) before
    lc.setDigit(0,7-i,m,false);
    else
    {


    Please let me know if this works.

    Wagner



  13. #13
    Registered
    Join Date
    Jul 2004
    Location
    N/A
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Mini Mill DRO, a different approach

    Hello Wmcnc.





    Arduino DRO is completed.
    Thank for your contribution this DRO. and quick answers my question.
    Arduino DRO let me learn a lot. Again have a problem then help me.

    Best regards.
    tk



  14. #14
    Registered
    Join Date
    Apr 2006
    Location
    Greece
    Posts
    7
    Downloads
    1
    Uploads
    0

    Default

    Hi the code working for me to, But I want to attach a steppermotor
    to the code, can any body help?



  15. #15
    YankGee's Avatar
    Join Date
    Jul 2016
    Location
    1
    Posts
    1
    Downloads
    0
    Uploads
    0

    Default

    Hi..i am a new user here. I think your encoder generates 500 pulses per rotation. 1 turn = 4.0 mm, 500 pulses * 4 interruptions equal 2000 counts. To convert to 400 units, multiply by 0.2. Change the line:
    #define SCF 4.000000 // Encoder factor (1/((600*4)/(12*0.08))*10000)
    to
    #define SCF 0.2 // Encoder factor 4 mm pitch, 500 * 4 pulses/rotation 1/100 mm resolution (400/(500*4))
    To revert the display and move the decimal point to the 3rd display, change the display function

    china circuit board assembly



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Mini Mill DRO, a different approach

Mini Mill DRO, a different approach