Interrupt Driven Rotary Table controller

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.
Yes the LCD library has a screensaver built in. There is a command to disable it so look through the setup code.
I never found it distracting.
 
Thanks Rod this looks like something I will need soon.
Cheers
Allen
 
Hi Rod

I Downloaded your Rotary Table 10 program but get an Error message when Verifying sketch, Error:

Temp1_RotaryTable10.zip\RotaryTable10\RotaryTable10.ino:1:23: fatal error: BoolField.h: No such file or directory
#include <BoolField.h>
^
compilation terminated.
exit status 1
Error compiling.

Rod,

I get the same thing, I clicked the Rotarytable10.ino . Doesn't load the library BoolField.h Any ideas?
 
Rod,

I get the same thing, I clicked the Rotarytable10.ino . Doesn't load the library BoolField.h Any ideas?

Please read post #4 which explains why you are getting that error. Review the first post again as it tells you what to do. Also, when you get it going, be sure to modify the code as per the later bug fix on GoDivide()
 
Please read post #4 which explains why you are getting that error. Review the first post again as it tells you what to do. Also, when you get it going, be sure to modify the code as per the later bug fix on GoDivide()

I did read post#4 previously, which why I knew that it didn't load the library. I had to manually load the library into the java folder. On previous Arduino programs that I have used it loaded the libraries automatically. Your program did load the Eprom library automatically, so I am confused why it didn't load the rest of the libraries. Now when I verify the code I get;

Users/montemeredith/Downloads/RotaryTable10/RotaryTable10/RotaryTable10.ino: In function 'void goDeviceMenu()':
/Users/montemeredith/Downloads/RotaryTable10/RotaryTable10/RotaryTable10.ino:955:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
addDevice("NEW Dev?");
^
/Users/montemeredith/Downloads/RotaryTable10/RotaryTable10/RotaryTable10.ino:962:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
loadDevice("LOAD Dev?");
^
/Users/montemeredith/Downloads/RotaryTable10/RotaryTable10/RotaryTable10.ino:969:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
eraseEeprom("ERASE All?");


Sketch uses 28946 bytes (11%) of program storage space. Maximum is 253952 bytes.
Global variables use 906 bytes (11%) of dynamic memory, leaving 7286 bytes for local variables. Maximum is 8192 bytes.

Is this still a problem?

On the GoDivide bug where is it described? And why wasn't in the revision 10 update or did it appear after that was released?
 
The Eeprom library is probably a standard Arduino library so a version was probably already installed.
The other libraries are unknown to the Arduino environment so they had to be unzipped into a folder as per the first post.
I have not provided a library but a complete working environment including some libraries so the autoinstall cannot work.
Something has changed in the current Arduino development environment and some compiler warnings are now generated.
The warnings should not be a problem on a UNO but I note from your last post from the available memory that you are using a much larger capacity Arduino so I guess it is also a 32 bit board. If this is the case, the warning could bite you. Say an internal pointer is a 16 bit long on a UNO and now it is 32 bits long, the current code could generate an invalid memory address. This new support for 32 bit processors could be the reason why the Arduino developers chose to tighten up the compiler warnings (eg what as once valid could be a problem today so they issue a warning)
The hardware requirements are listed on post #1 of this thread. Use different hardware and there are no guarantees this will work correctly.
The bux fix is listed on post #25 of this thread
 
I wish to thank you for this. I had been looking at creating something like this for my milling machine X axis.. Now I don't. :)
I've got it to compile and was surprised it actually compiled on a Arduino Pro board. 16mhz, using 98% of memory. I will however end up using possibly my Tau 32bit board instead. Got this from a kickstarter and it should be plenty fast enough to run this.
 
I wish to thank you for this. I had been looking at creating something like this for my milling machine X axis.. Now I don't. :)
I've got it to compile and was surprised it actually compiled on a Arduino Pro board. 16mhz, using 98% of memory. I will however end up using possibly my Tau 32bit board instead. Got this from a kickstarter and it should be plenty fast enough to run this.

Thanks for the feedback. I'm glad its working for you. If you were going to build it into a dedicated hardware box, I would not waste a 32 bit CPU on it. Please give me your feedback on your linear application as I have not seen anybody use it that way.
 
Hello,

I am new to the site so please excuse my noobness. First off, thank you for posting the code and making this project available to all. I am having an issue with getting the DIV to work correctly. When I select the number of divisions and press direction, the motor makes twelve full revolutions and stops. I am able to run CONT by holding the direction button down which stops when I release the button. I feel like I am close, but I must have a setting wrong somewhere. I am using a NEMA 34 motor with Arduino UNO with a SainSmart LCD shield, SainSmart Micro Stepper Driver with Pulse per rev is set at 5000 (I have tried all settings, and this seemed to sound the best) and I have tried all amp settings from 1 to 4.5 without any noticeable differences. I tried to change the settings on the LCD in setup to reflect the pins I used on the Arduino (2 and 3) where the DIR will change to 3, but the Steps revert back to 1 even when I change it and choose Save =Yes. Thank you for any help you can offer.
 

Attachments

  • Arduino INO Sainsmart Shield Sainsmart Micro Stepper.jpg
    Arduino INO Sainsmart Shield Sainsmart Micro Stepper.jpg
    87.3 KB · Views: 404
Hi Mumford
I used the Sainsmart shield as well. Here is what I did. This was quoted from another post here https://www.homemodelenginemachinist.com/threads/heavy-duty-arduino-dividing-head-project-“finished-“.24719/

OK, found it ( took awhile )

Find where you keep your libraries and open the LCD folder, in it open the file LCD.cpp in notepad. Change the backlight pin from 3 to 10, save and close. That should be all you need to get the Sainsmart working with the Freetronics library.
See photo

Scott

lcd-cpp-jpg.80579


View attachment 80579
 
If you really get stuck with pin assignments, there are some equates in the top of the main code. I've got a feeling you'd need to overwrite the first few bytes of the flash memory from a different sketch or it will keep reading values from there. Look in the Arduino docs for an example of writing to flash memory. (We put a signature in the first few bytes to ensure it contains valid data so it needs to be wiped out to reinitialise). Or just accept the default pin values.

The amp settings on your controller are determined by your stepper motor. If your amps are less than the motor rating, it will loose torque but still function.. So keep it as high as your stepper allows.
 
Thank you Scott_M and RodW for your help. Unfortunately, I am unable to overwrite the original sketch with any other programs or changes. I just get error messages like avrdude: verification error; content mismatch and problem uploading to board programmer is not responding. I will need to figure this new problem out before I can try any new fixes. Thank you again.
 
Hi, I've been a bit busy for the past few days, but I tried the new script and the division seems to work perfectly now. I tried divisions 3, 21, 37, 61 and 360. All holes lined up.

I'll do some more testing later and I will write down the results but for now it seems that we have
 
Last edited:
#rodw

Can you please give us the wiring diagram.

I don't appreciate multiple requests via PM and on multiple threads. Your PM was devoid of manners. There is only 4 wires required to drive a stepper motor driver from an Arduino, 2 of them are +5v and -5v. If you can't work it out, you should not be attempting this project.
 
Hello,

I am new to the site so please excuse my noobness. First off, thank you for posting the code and making this project available to all. I am having an issue with getting the DIV to work correctly. When I select the number of divisions and press direction, the motor makes twelve full revolutions and stops. I am able to run CONT by holding the direction button down which stops when I release the button. I feel like I am close, but I must have a setting wrong somewhere. I am using a NEMA 34 motor with Arduino UNO with a SainSmart LCD shield, SainSmart Micro Stepper Driver with Pulse per rev is set at 5000 (I have tried all settings, and this seemed to sound the best) and I have tried all amp settings from 1 to 4.5 without any noticeable differences. I tried to change the settings on the LCD in setup to reflect the pins I used on the Arduino (2 and 3) where the DIR will change to 3, but the Steps revert back to 1 even when I change it and choose Save =Yes. Thank you for any help you can offer.
 
Last edited:
Can you tell me about pin connections.
I am new to this field
Shehan, just like learning to use a lathe or mill, you take 'baby step' with Arduino. Look for a tutorial on using the UNO with the LCD display and keyboard. This will initiate your understanding of the wire connections between the UNO and any of the many devices that can be connected. Have you done the very first Arduino sketch that blinks a LED on the UNO board? Some copies (of the UNO) do not have that LED installed. The next sketch is the same, but with an external LED and resistor. This is a needed 'stepping stone' to understand what Arduino is about and the coding that the IDE (Integrated Development Environment) provides to enable non computer science, electrical engineers the ability to use microcontrollers.
 

Latest posts

Back
Top