Announcement

Collapse
No announcement yet.

Arduino based index table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Arduino based index table

    Hello,

    Im new here but have been lurking for some time and wanted too get some suggestions.

    Im in the progress of setting up a small but capable home shop and wanted some advise on some software.

    And seeing what i want isnt new and there aint no point in reinventing the wheel i thought ill ask here.

    Im looking for recomendations or suggestions on what software to use on a arduino/stepper rotary/index table.
    Got the stepper allready mounted to the rotary table and got plenty of arduinos laying around same goes for drivers still got a couple of dm556 drivers laying around.
    leftovers and spares of my cncrouter table.
    but seeing that isnt something new i thought ill ask here on what you guys use.

    Cheers corn

  • #2
    I use a Teensy (Arduino compatible) with a Nextion touchscreen on my rose engine. One of the functions is to index the spindle. It stores 5 different settings for index size and can also read from a file. Here's the code to determine the steps by degrees or divisions:
    /// <summary>
    /// Index Size
    /// </summary>
    /// <comment>
    /// Converts unit size of index to steps
    /// </comment>
    /// <param name="newIndexSize">Unit size of index</param>
    /// <returns></returns>
    void IndexSize(double newIndexSize)
    {
    const char* indexId_Char = "Index ID:";
    const char* index1_Char = "Index1";
    const char* index2_Char = "Index2";
    const char* index3_Char = "Index3";
    const char* index4_Char = "Index4";
    const char* index5_Char = "Index5";
    const char* indexSizeChar = " Size:";

    int stepsPerRevolution = (int)round(configSetup.microsteps_Spindle * configSetup.steps360_Spindle * configSetup.gearRatio_Spindle);

    #ifdef DEBUG
    Serial.print(indexId_Char);
    Serial.println(configIndex_Main.indexId);
    Serial.println(newIndexSize);
    #endif // DEBUG

    switch (configIndex_Main.indexId)
    {
    case 1:
    {
    configIndex_1.sizeInUnits = newIndexSize;

    // Default: Divisions
    if (configIndex_1.degreeOrDivision == BY_DEGREES) // Degrees
    {
    configIndex_1.sizeInSteps = stepsPerRevolution * (newIndexSize / 360);
    }
    else
    {
    configIndex_1.sizeInSteps = stepsPerRevolution / (newIndexSize);
    }

    #ifdef DEBUG
    Serial.print(index1_Char);
    Serial.print(indexSizeChar);
    Serial.println(configIndex_1.sizeInSteps);
    #endif // DEBUG

    break;
    }
    case 2:
    {
    configIndex_2.sizeInUnits = newIndexSize;

    // Default: Divisions
    if (configIndex_2.degreeOrDivision == BY_DEGREES) // Degrees
    {
    configIndex_2.sizeInSteps = stepsPerRevolution * (newIndexSize / 360);
    }
    else
    {
    configIndex_2.sizeInSteps = stepsPerRevolution / (newIndexSize);
    }

    #ifdef DEBUG
    Serial.print(index2_Char);
    Serial.print(indexSizeChar);
    Serial.println(configIndex_2.sizeInSteps);
    #endif // DEBUG

    break;
    }
    case 3:
    {
    configIndex_3.sizeInUnits = newIndexSize;

    // Default: Divisions
    if (configIndex_3.degreeOrDivision == BY_DEGREES) // Degrees
    {
    configIndex_3.sizeInSteps = stepsPerRevolution * (newIndexSize / 360);
    }
    else
    {
    configIndex_3.sizeInSteps = stepsPerRevolution / (newIndexSize);
    }

    #ifdef DEBUG
    Serial.print(index3_Char);
    Serial.print(indexSizeChar);
    Serial.println(configIndex_3.sizeInSteps);
    #endif // DEBUG


    break;
    }
    case 4:
    {
    configIndex_4.sizeInUnits = newIndexSize;

    // Default: Divisions
    if (configIndex_4.degreeOrDivision == BY_DEGREES) // Degrees
    {
    configIndex_4.sizeInSteps = stepsPerRevolution * (newIndexSize / 360);
    }
    else
    {
    configIndex_4.sizeInSteps = stepsPerRevolution / (newIndexSize);
    }

    #ifdef DEBUG
    Serial.print(index4_Char);
    Serial.print(indexSizeChar);
    Serial.println(configIndex_4.sizeInSteps);
    #endif // DEBUG

    break;
    }
    case 5:
    {
    configIndex_5.sizeInUnits = newIndexSize;

    // Default: Divisions
    if (configIndex_5.degreeOrDivision == BY_DEGREES) // Degrees
    {
    configIndex_5.sizeInSteps = stepsPerRevolution * (newIndexSize / 360);
    }
    else
    {
    configIndex_5.sizeInSteps = stepsPerRevolution / (newIndexSize);
    }

    break;
    }
    }

    }
    Full project is here.

    Comment


    • #3
      I also dabble in CNC and Arduino stuff. I wanted a ELS for my small
      lathe and put together a stepper and related parts to drive my lead
      screw by different lengths and speeds. I used a keypad and lcd
      display for interface. Would be happy to share what I have if it would
      help!!
      olf20 / Bob

      Comment


      • #4
        You might also look into what you might be able to do with an ESP-32 board. You could create a control system that uses your smart phone or tablet as the operator interface,

        Comment


        • #5
          Originally posted by kf2qd View Post
          You might also look into what you might be able to do with an ESP-32 board. You could create a control system that uses your smart phone or tablet as the operator interface,
          You can do the same with an Arduino.

          Comment


          • #6
            Originally posted by elf View Post

            You can do the same with an Arduino.
            But with the ESP you have the option of using BlueTooth or WiFi. The ESP is a dual processor so you can have a web page on one cpu and the rotab on the other. All built into one chip.

            Comment


            • #7
              If you can compile and run this code on an ESP32, I might be convinced it's a viable option

              Comment


              • #8
                Everyone seems to want to go hi-tech with these things, screens and all. Since a stepper driver just needs a step input has anyone ever considered using a good old phone dial? Though now I come to think of it I can't remember when I last saw a rotary dial phone, even in a junk shop.

                Comment


                • #9
                  Originally posted by Baz View Post
                  Everyone seems to want to go hi-tech with these things, screens and all. Since a stepper driver just needs a step input has anyone ever considered using a good old phone dial? Though now I come to think of it I can't remember when I last saw a rotary dial phone, even in a junk shop.
                  Screens aren't absolutely necessary, but they make it easier to determine what has been set. Rotary potentiometers can be set to whatever step size you want. My pendant for a cnc mill can be set to move .1, .01, .001, or .0001 or any other arbitrary dimension in inches or millimeters or whatever unit of measure you want to use.

                  Comment

                  Working...
                  X