Interrupt Driven Rotary Table controller

Discussion in 'Software and Programming' started by rodw, Nov 30, 2015.

Help Support HMEM by donating:

  1. Sep 16, 2017 #41

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    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.
     
  2. Oct 16, 2017 #42

    Stieglitz

    Stieglitz

    Stieglitz

    Well-Known Member

    Joined:
    Aug 18, 2012
    Messages:
    59
    Likes Received:
    10
    Thanks Rod this looks like something I will need soon.
    Cheers
    Allen
     
    rodw likes this.
  3. Nov 23, 2017 #43

    fugalguido

    fugalguido

    fugalguido

    Member

    Joined:
    Aug 3, 2017
    Messages:
    9
    Likes Received:
    0
    Rod,

    I get the same thing, I clicked the Rotarytable10.ino . Doesn't load the library BoolField.h Any ideas?
     
  4. Nov 23, 2017 #44

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    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()
     
  5. Nov 23, 2017 #45

    fugalguido

    fugalguido

    fugalguido

    Member

    Joined:
    Aug 3, 2017
    Messages:
    9
    Likes Received:
    0
    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?
     
  6. Nov 23, 2017 #46

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    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
     
    joco-nz likes this.
  7. Nov 26, 2017 #47

    cd_edwards

    cd_edwards

    cd_edwards

    New Member

    Joined:
    Nov 26, 2017
    Messages:
    1
    Likes Received:
    1
    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.
     
    rodw likes this.
  8. Nov 26, 2017 #48

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    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.
     
  9. Jun 23, 2018 #49

    Mumford

    Mumford

    Mumford

    New Member

    Joined:
    Jun 15, 2018
    Messages:
    2
    Likes Received:
    1
    Gender:
    Male
    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.
     

    Attached Files:

    Shehan Perera likes this.
  10. Jun 23, 2018 #50

    Scott_M

    Scott_M

    Scott_M

    Well-Known Member

    Joined:
    Apr 13, 2013
    Messages:
    252
    Likes Received:
    77
    Location:
    Medina, Ohio USA
    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/

     
    Shehan Perera likes this.
  11. Jun 23, 2018 #51

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    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.
     
  12. Jun 23, 2018 #52

    Mumford

    Mumford

    Mumford

    New Member

    Joined:
    Jun 15, 2018
    Messages:
    2
    Likes Received:
    1
    Gender:
    Male
    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.
     
  13. Jul 27, 2018 #53

    Shehan Perera

    Shehan Perera

    Shehan Perera

    Member

    Joined:
    Jul 17, 2018
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    Location:
    Sri Lanka
    #rodw

    Can you please give us the wiring diagram.
     
  14. Jul 27, 2018 #54

    Shehan Perera

    Shehan Perera

    Shehan Perera

    Member

    Joined:
    Jul 17, 2018
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    Location:
    Sri Lanka
     
    Last edited: Jul 27, 2018
  15. Jul 27, 2018 #55

    Stieglitz

    Stieglitz

    Stieglitz

    Well-Known Member

    Joined:
    Aug 18, 2012
    Messages:
    59
    Likes Received:
    10
    Hi Rod,Thanks so much.
     
  16. Jul 27, 2018 #56

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    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.
     
  17. Jul 27, 2018 #57

    Captain_Obvious

    Captain_Obvious

    Captain_Obvious

    Active Member

    Joined:
    Jun 3, 2017
    Messages:
    43
    Likes Received:
    17
    The code is already posted on this thread and it is not written by me.
     
  18. Jul 27, 2018 #58

    Shehan Perera

    Shehan Perera

    Shehan Perera

    Member

    Joined:
    Jul 17, 2018
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    Location:
    Sri Lanka
    Thank you rodw and captain_obvious

    Great work
     
  19. Jul 27, 2018 #59

    Shehan Perera

    Shehan Perera

    Shehan Perera

    Member

    Joined:
    Jul 17, 2018
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    Location:
    Sri Lanka
     
    Last edited: Jul 27, 2018
  20. Jul 27, 2018 #60

    ignator

    ignator

    ignator

    Well-Known Member

    Joined:
    Jan 22, 2012
    Messages:
    101
    Likes Received:
    13
    Gender:
    Male
    Location:
    USA, Iowa
    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.
     
    Shehan Perera likes this.

Share This Page