Project of the Month built by gbritnell

Help Support Home Model Engine Machinist by donating using the link above or becoming a Supporting Member.
Home Model Engine Machinist > CNC and 3-D Printers > Software and Programming > Tips for Arduno software for Rotary Table Controllers

Reply
 
Thread Tools
Old 11-24-2017, 08:04 PM   #271
fugalguido
 
Join Date: Aug 2017
Posts: 9
Default

Ok, got the buttons to work thanks to Torfilli's(sp) LCD.cpp code. But I need some operator directions as I mentioned previously on the use of the menu's. When I get to the setup menu and go to setup the step pin #, to say pin#2, I change it to from 1 to 2 the up down buttons, then rotate through to the Save and select yes, then hit select button. It doesn't save. It appears to reboot, when I go back to the setup menu Step pin is still at #1.



Again to be 100% clear, I need a operators manual or instruction on the use of the menus, not a discussion on the hardware.


Also another question where to you hook up the enable control from the drive. On my previously used programs a pin was defined for enable.


fugalguido is offline  
 
Reply With Quote
Old 11-25-2017, 09:40 AM   #272
rodw
 
Join Date: Dec 2012
Posts: 1,046
Liked 311 Times on 242 Posts
Likes Given: 161

Default

Quote:
Originally Posted by fugalguido View Post
Ok, got the buttons to work thanks to Torfilli's(sp) LCD.cpp code. But I need some operator directions as I mentioned previously on the use of the menu's. When I get to the setup menu and go to setup the step pin #, to say pin#2, I change it to from 1 to 2 the up down buttons, then rotate through to the Save and select yes, then hit select button. It doesn't save. It appears to reboot, when I go back to the setup menu Step pin is still at #1.



Again to be 100% clear, I need a operators manual or instruction on the use of the menus, not a discussion on the hardware.


Also another question where to you hook up the enable control from the drive. On my previously used programs a pin was defined for enable.
Well it seems to me that a discussion on the hardware resolved your buttons issue.

I don't have a configured Arduino to guide you so am unable (and unwilling) to document a user manual.

Hitting save in the setup menu will save the parameters to the UNO's EEPROM and it should be read from there on startup. And yes, it reboots at this point to force reload of the new config. Oh wait, you are not using a UNO are you? A 32 bit Arduino might be a bit different in the EEPROM department. As I said use different hardware, you are on your own.

Configs are numbered sequentially from 0 and the current default config # is saved in eeprom and loaded on startup. Its possible your system is getting confused and not loading the config you changed. Load Config 0 and see if its correctly configured. Turn it on and off and see if the same config is loaded and check the parameters after startup. There is also a linear config type that might be used for drilling holes or as a milling machine table motor drive so make sure its a rotary config you are using.

If you go through the various #defines at the start of the program, you should be able hardcode the default step and direction pins but that will probably break the multiple config functionality (which also depends on the EEPROM anyway).

In my experience, the stepper enable signal is actually a disable signal so if it goes to +5v, it disables the stepper motors. Documentation for the stepper drivers I have does not recommend connecting it. If you wanted to add an estop button, you could steal 5 volts from the Arduino (unless its a 3.3 volt variety) and pass it through the estop button to the drive (dis)enable input. You'd just need to check which state (high or low) disables the drives.

Many people are using this software without an ounce of trouble and you are the first to report issues loading configs. It will be related to your hardware.
Let me know how you get on.


__________________
RodW
Brisbane, Australia
vehiclemods.net.au
rodw is offline  
 
Reply With Quote
Old 11-25-2017, 05:09 PM   #273
fugalguido
 
Join Date: Aug 2017
Posts: 9
Default

Thanks for the reply. Yes, an UNO. Here what I did on your recommendation , Changed the DIR to 0, changed the STEP to 0, hit Save=yes. After rebooting up, the Dir did change to a 0, but STEP stays at 1. Went into the program IDE as per your advise, in the # define changed STEP_PIN to 0, uploaded, went into the setup on the UNO, STEP stayed at 1. The problem is with the STEP pin not changing states both thru the on board programing or the IDE (it is stuck on one) I also tried to change the STEP_PIN to a 4 in the #define , just see what would happen, no change stays at 1. Found another problem, can't change the #define DIR_PIN though the IDE, but can change it though the UNO and save it.

So in summary;

STEP pin can't be changed and saved at all from either the IDE or the UNO.

DIR pin can't be changed and saved from the IDE, but can from the UNO.
fugalguido is offline  
 
Reply With Quote
Old 11-25-2017, 06:20 PM   #274
fugalguido
 
Join Date: Aug 2017
Posts: 9
Default

I just tried hooking up the Uno to the stepper driver using the pins the Uno is stuck on in RodW's program(Step pin 1 and dir pin 2), no movement in any function. I went back to Chuck's program and the Gary Liming program, everything works great using their programs. Did this to verify the drive, motor and wiring there ok. Have the config menu settings as follows DevTyp= Rotary /JgAn=30 seconds /DirP=2/StpP=1 /Stp/Rv=200 /M/step=1:1 /D/Rat=1:1 /MaxHz=10k /MinHz=5k, Also in the Contin menu (I am assuming this means continuous rotation) the only way to get out this menu is to reset the Uno, is this the way it is supposed to work?

I did change the GoDivde portion(bug?) as you advised in the other thread after I got the keypad working. This Uno was just purchased in the last 6 months so it is up to date a far as the revisions. The keypad buttons seem to work properly now, so what could be the problem now.

I could scope the two pins for switching signals, but like said they work on the other programs using those pins, so I don't think they're the problem. Whats next?
fugalguido is offline  
 
Reply With Quote
Old 11-25-2017, 10:12 PM   #275
rodw
 
Join Date: Dec 2012
Posts: 1,046
Liked 311 Times on 242 Posts
Likes Given: 161

Default

If you have to reset the UNO to escape out of Continuous Turn, I think there is still a button problem. The shields I used seemed to use very poor quality switches and I actually wore switches out when developing this sketch so I replaced the shield as I had similar problems to what you are experiencing. I would check the button function with a simple sketch (hopefully provided by your shield manufacturer) to confirm all buttons work as expected and do not stick. (or scope the A0 output).

From your settings, I might know what your problem is. But first let me explain the config settings

StepP = Step Pin
DirP = Direction Pin
JgAn = the amount the table jogs in jog mode
Stp/Rv = 200 = standard 1.8 degree stepper eg steps per revolution)
M/step = Microstepping (eg. Gecko stepper driver would need 10:1)
D/Rat = 1:1 this is the gearing ratio. a standard Rotary Table might be 90:1 or 40:1
MaxHz = 10k this is the fastest speed (steps/sec) that the stepper will operate at
MinHz = 5k this is the slowest speed the stepper will operate at. (stepper starts at MinHz and ramps up to MaxHz)

I believe that your frequency settings are far too high for a 1:1 stepper config with no microstepping. From my experience, the average stepper maxes out at about 450 rpm. (7.5 rev per second)
So the maximum frequency your stepper can operate at is 7.5 * 200 = 1500 steps per second (1.5k) and you have 10k.
With my 10:1 microstepping, the maximum frequency I could do was about 15,000 but I backed off to 10,000 Hz to be safe. You should do the same
You will need to set MinHz and MaxHz to say 750 and 1000 for native resolution

With hindsight, pins 1 & 2 are not an an ideal choice because they are used for USB communications. You get some buzzing from the stepper if connected when uploading a new script. Selecting say pins 3 & 4 might be a better option which avoids this.
__________________
RodW
Brisbane, Australia
vehiclemods.net.au
rodw is offline  
 
Reply With Quote
Old 11-26-2017, 06:19 PM   #276
fugalguido
 
Join Date: Aug 2017
Posts: 9
Default

So, the JgAn if this is set to 1 degree, then each push of the right or left button the table moves 1 degree?

If it was working right, to get out of the continuous turn hit the Select button?

I think that I am going to build the button circuit on a separate board using industrial quality buttons and some 1% resistors to mimic the keypad. I did high end audio/analog design for 20+ years so I have the parts.

I will change the freq. setting to what you recommend and see what happens. I will report back, thanks.
fugalguido is offline  
 
Reply With Quote
Old 11-26-2017, 08:06 PM   #277
rodw
 
Join Date: Dec 2012
Posts: 1,046
Liked 311 Times on 242 Posts
Likes Given: 161

Default

Quote:
Originally Posted by fugalguido View Post
So, the JgAn if this is set to 1 degree, then each push of the right or left button the table moves 1 degree?

If it was working right, to get out of the continuous turn hit the Select button?

I think that I am going to build the button circuit on a separate board using industrial quality buttons and some 1% resistors to mimic the keypad. I did high end audio/analog design for 20+ years so I have the parts.

I will change the freq. setting to what you recommend and see what happens. I will report back, thanks.
Sorry about the cryptic prompts but they kept getting shorter as the memory got tighter. If it is not a faulty button, it is possible for some reason that you have a memory overflow error. This could occur if the later versions of the compiler consume more static RAM than the earlier compiler versions.

However, I've not had any other reports of this happening from recent users of the sketch.

Yes, JogAn sets how far a rotary table moves on each press of the jog buttons
Yes, Select should Exit and go back one level in all of the procedures.
When Continuous turning, it will ramp down down to a stop on exit.

The code is very readable. All procedures that actually do something (as opposed to getting user input) start with "go" as in
goDivide() and goConTurn()
__________________
RodW
Brisbane, Australia
vehiclemods.net.au
rodw is offline  
 
Reply With Quote
Old 11-26-2017, 08:29 PM   #278
fugalguido
 
Join Date: Aug 2017
Posts: 9
Default

Is there a way to see if memory overflow is the problem? I am using 1.8.1. I see that the newest is 1.8.5.

Also, if I mimic the button circuit on the keypad that you used, I should go back to your original keypad/LCD program instead of Torfollis (sp) right, even though I am using the my LCD portion of the keypad?
fugalguido is offline  
 
Reply With Quote
Old 11-28-2017, 03:44 AM   #279
rodw
 
Join Date: Dec 2012
Posts: 1,046
Liked 311 Times on 242 Posts
Likes Given: 161

Default

Quote:
Originally Posted by fugalguido View Post
Is there a way to see if memory overflow is the problem? I am using 1.8.1. I see that the newest is 1.8.5.

Also, if I mimic the button circuit on the keypad that you used, I should go back to your original keypad/LCD program instead of Torfollis (sp) right, even though I am using the my LCD portion of the keypad?
There is no way of knowing except things stop working. Just shorten a few more menu prompts and see if things change. What the problem is that the Arduino stores text variable data in static RAM but on startup, it copies these over into limited dynamic global RAM, effectively creating 2 copies of each string. For unchanging menu text, this is very wasteful of resources. There is a way to use the static versions of strings using the PROGMEM definition but the text cannot be changed.

The most useful extension anybody could make to this script would be to modify the LCD library so PROGMEM variables could be used for all of the menu prompts. This would free up an enormous amount of global memory.


__________________
RodW
Brisbane, Australia
vehiclemods.net.au
rodw is offline  
 
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotary Table Fix cfellows Tools 12 08-13-2013 06:09 PM
Rotary Table -- What Do I Need To Know? Jeremy_BP Tools 10 01-17-2012 02:42 PM
Rotary table for my X2 tmuir Tools 16 02-03-2010 09:40 AM
X2 table dissassembly tips wanted tmuir General Engine Discussion 3 05-14-2009 11:43 PM
Rotary table Julian Tips and Tricks 3 11-04-2007 07:01 PM



Newest Threads






- Top - Member List