Arduino Rotary Table for Dummies

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
That's what I have in mind, but without the switch. My problem is modding the code to accept an outside signal instead of a button push. I've been wanting to learn more coding, so maybe this will be my chance, lol.
 
That looks like the same box I used for my rotary table. I found mine on eBay. This was my first project installing electronics into a box. I was surprised that I got all components to fit. Very pleased with the result. I'm thinking of doing a larger rotary table, thus a larger stepper, thus a larger stepper driver. This driver will not fit the box.
 
That looks like the same box I used for my rotary table. I found mine on eBay. This was my first project installing electronics into a box. I was surprised that I got all components to fit. Very pleased with the result. I'm thinking of doing a larger rotary table, thus a larger stepper, thus a larger stepper driver. This driver will not fit the box.
Unfortunately that box was too small for my driver board and even the LCD I got was a bit too wide to fit it. I ended up ordering this one: https://www.amazon.com/dp/B005T58ZTO?ref=ppx_yo2_dt_b_product_details&th=1 . It should arrive today, hopefully it works well.
I got the stepper mount done last night. I think it'll work out well. I'll post some pics when I get things farther along.
Thanks,
Mike
 
Any idea why it would fry a power supply when plugging it into the arduino? I set the output of the converter to 5.05VDC and as soon as you touch the plugs together they spark and fry both! Should I have had a higher voltage, was it trying to pull too many watts at this voltage? I have a 48VDC power supply going into my stepper controller & found a step down converter that would take 50VDC. I have another uno and a 48VDC to usb output coming tomorrow that I'm just going to plug into the USB port on the uno instead of the barrel connector, hoping it works better.
 
Any idea why it would fry a power supply when plugging it into the arduino? I set the output of the converter to 5.05VDC and as soon as you touch the plugs together they spark and fry both! Should I have had a higher voltage, was it trying to pull too many watts at this voltage? I have a 48VDC power supply going into my stepper controller & found a step down converter that would take 50VDC. I have another uno and a 48VDC to usb output coming tomorrow that I'm just going to plug into the USB port on the uno instead of the barrel connector, hoping it works better.
These low cost 'Buck' converters (I suspect you're using a buck converter vs. a transformer stepdown converter), can fail with the output switch full on, and that puts the full input into the output, (minus maybe a diode drop). These are very cheap power supplies, and have no protection against overvoltage. Unless you can find an overvoltage protection circuit, you just live with random failures that can result in blowing up low voltage micro processors. I believe the Uno has a 5 volt input, with a 3.3volt power supply on board, that too is a buck converter.
 
Hello
I have my components ordered to try and convert a 90-1 indexing head and a 72-1 rotary table I made based on the projects Philip Duclos published.
My electronics skills are weak but I am encouraged by this thread and Chuck Fellows thread.
My first question is what down load do I choose for the IDE installation. Windows installer or windows zip file. If I understand this right if I use the more convenient installer I will always have to be connected to the computer to run programs?
Dave
 
McRoth

The input voltage to all Arduinos can range from about 7 volts to 12 volts dc. For the internal 5 volt regulator to work, the input must be greater than 5 volts. The input is via the power connector not the five volt pins which are outputs from the regulator.

As for smoking your power supply etc, the most likely reason is that you had the polarity reversed with your connections. They are polarity sensitive and no second chances. I am also supprised the current limit feature (of most switch mode power supplies) didn't save it.

The cheap converters often marketed as buck regulators are reasonably reliable. I have used well over twenty or so without any problems but you would have to expect a failure from time to time. You should also check the output voltage with a volt meter before connecting to your Arduino.

Bruce
 
That's what I have in mind, but without the switch. My problem is modding the code to accept an outside signal instead of a button push. I've been wanting to learn more coding, so maybe this will be my chance, lol.
Depending on how the code is set up, the same boolean (true/false) changed by a push button could also be flipped by any sensor writing to the same variable. The MAP function is handy, as you can map any voltage range (potentiometer, proximity sensor, hall effect, etc) and have the software switch trigger when in a desired analog range.
edit* Without the caffeinated nerd language. You can have a proximity sensor change a condition to true when distance is within a certain range.
 
Thanks for the replies! I'm quite sure I had the polarity correct, I'm thinking it was pulling too much power at 5 volts, should've put it at 7 or 8 I'm thinking. They were cheap Amazon buck converters, so I'm not too worried about them. The step down to USB output is working good.
Zeb, thanks for the tip about the code. That does make sense to me.

Here are some progress pics. I have the stepper mounted and luckily I picked a powerful enough one, it turns great! I had the amps on the lowest setting at first and could hear it skipping steps accelerating and decelerating so I put it all the way up and it's good now.
 

Attachments

  • PXL_20211031_234029858.jpg
    PXL_20211031_234029858.jpg
    228.6 KB
  • PXL_20211031_234010497.jpg
    PXL_20211031_234010497.jpg
    191.7 KB
  • PXL_20211031_234111940.TS~2.mp4
    42.6 MB
Thanks for the replies! I'm quite sure I had the polarity correct, I'm thinking it was pulling too much power at 5 volts, should've put it at 7 or 8 I'm thinking. They were cheap Amazon buck converters, so I'm not too worried about them. The step down to USB output is working good.
Zeb, thanks for the tip about the code. That does make sense to me.

Here are some progress pics. I have the stepper mounted and luckily I picked a powerful enough one, it turns great! I had the amps on the lowest setting at first and could hear it skipping steps accelerating and decelerating so I put it all the way up and it's good now.
Here's the box I'm using.
 

Attachments

  • PXL_20211102_003212278.jpg
    PXL_20211102_003212278.jpg
    301.8 KB
The approach I took on this thread
http://www.homemodelenginemachinist.com/showthread.php?t=25091&page=3
was to accumulate the fractional error and add a step when it was > 1.0 add another step.

Chuck Fellowes followed another approach. For the start of each division, he tracked how far around the circle he was and calculated how far around the circle he would be after the division, take the difference and move that number of steps.

Ultimately the result is identical. The adjustment algorithm depends a bit on the complete methodology you use to do your divisions.

As far as the data structure goes, using int or long will make no difference unless the number of steps moved exceeds the resolution of the data type. When I did this, I wanted to avoid the use of floats and inevitable rounding errors so I measured angles in the number of seconds of a degree using an unsigned long as there are 1,296,000 seconds in a circle. I wrote routines to input and display this value for angles in degrees, minutes and seconds but internally worked with seconds. Then when actually moving the rotary axis, I implemented a trapezoidal acceleration/deceleration algorithm to maximise torque on startup and overshoot at the end of the move. (You can't do instantaneous accelleration to maximum speed due to the laws of physics).

So what on the surface looks like a simple application becomes amazingly complex, particularly if you use interrupt driven step generation.
YOUR LINK IS NO LONGER PROPER AND GETS A "OPPS" ERROR
 
This is the unit I made.
IMG_20220314_172320.jpg


reduction 1 : 4
IMG_20220314_172332.jpg


inside
IMG_20220314_172222.jpg

print
IMG_20220308_191329.jpg

milling the PCB
IMG_20220308_165351.jpg


Because I don't get a nice number for the original multiplier (35.555...) I modified 3 lines:

line 32? -> const int Multiplier=(StepsPerRotation*TableRatio); // I deleted division by 360
line 102? -> ToMove=map(Degrees,0,360,0,Multiplier); // here is map used to get the amount of steps ToMove
line 109? ->ToMove=map(Degrees,0,360,0,Multiplier);

The degrees input is here limited to 360 degrees.
Steppermotor is set 1/16 so 3200 steps/rev and the ratio is 4 --> Multiplier is 12800

I am happy that it works. :)
 
Last edited:
I am wondering if a n ESP32 would be a better choice than an Arduino. It includes wifi which would enable wireless CNC control, or control from a mobile phone.
 
No need for speed. A wire is more secure than wireless, but maybe that is an old idea.
 
adzijderlaan

This project has been around for a long time and while the original contributor did (I think anyway) a reasonably good job of it. Yes there were a few issues but it was a good starting point for most.

The main problem has been around the use of integers rather than reals so changing those is a good start. I have modified the sketch for many people for ratios from 4:1 to 120 :1 all of which have been successful.

As for exceeding 360 deg you need to use long integers otherwise it fails when you set a step deg of 280 deg or so. See the below section of code. When you are setting up a work piece in a four jaw chuck on the rotary table you need to be able to select 90 deg steps for the initial adjustment and finally say 1080 for the final check which gives you three continuous revs.

If you would like my sketch, send me an email.

Bruce Weir-Smith
Western Australia




void rotation(long tm, int d)
{
for(long i = 0; i < tm; i++) // Problem Fix
{
digitalWrite(stp, HIGH);
delay(stepdelay);
digitalWrite(stp, LOW);
delay(stepdelay);
}
 
Kim
Just send me an email along with the ratio of your rotary table and I will send you the sketch along with instructions to change the ratio if you ever need to.

Adzijderlaan

When you send me an email, could you also include the ratio you are using. I also have been to Amsterdam several times.

Bruce W-S
 
Libraries are simply programs someone smarter than me has written that our program can reference making everyone&#8217;s life a lot easier and you need the 2 attached below. Download the zip files and make sure you know where they are saved.
To install the libraries open the Arduino IDE program and click on &#8220;Sketch&#8221;, &#8220;Include Library&#8221; and &#8220;Add .ZIP Library&#8221;. Navigate to where you saved LiquidCrystal_I2C-master.zip, select it and click &#8220;Open&#8221;. Do this again and select the Keypad.zip file. You need to close the Arduino IDE and open it again for the libraries to be recognised.

Just started to read through the project and came across this oddball reference (strange numbering)
Is it something to do with my browser not being set to a particular setting or what...?
 
Bruce, any chance we can get a copy of your code/sketch to upgrade my existing rotary table software..
I've been using an older version of the one previously published in this web site with very good results, other than some adjustments required between Arduino and motor drive ( I was having some backlash issues).
Seen your approach to handle the integers seems such a bright idea that I would love to upgrade my existing version.

Kind regards
Jaime
 
Back
Top