Just finished:
Arduino UNO
Wagner
Just finished:
Arduino UNO
Wagner
Looks great.
Will the details of the hardware and software be available or is this a proprietary item?
Hi arvidj,
Thank you.
Details to come (hardware and software). I'm working on the diagram, and pictures.
Wagner
Diagram:
Attachment 190476
Wagner
Looking really good and looking forward to the source sketch.
Here is the software:
Indexer.zip
\Indexer\Indexer.ino.........The main code
\Libraries\Wlcd................Modified version of LCD4Bit
\Libraries\Wstepper..........My striped down version of AccelStepper
Wlcd is a modified version of LCD4Bit; includes code for activating cursor, create custom characters and digital read keys.
Wstepper is a rewrite, stripped down version of AccelStepper. Contains the minimum to control the stepper motor with acceleration and deceleration.
My thanks to the people who created the original libraries.
Wagner
First thing when running the code, you must set the configuration.
Steps/Rev: 200.........Stepper motor, number of steps per revolution
MicroStep: 8............Stepper controller, number of micro steps
Reductn: 72.............Total gear train reduction
MxVl(°/M): 1200........Maximum velocity in degrees per minute
Acc(°/s²): 20...........Acceleration in degrees per second per second
Bcklsh(°): 0..............Backlash compensation in degrees
Wagner
Thanks. I'll try to build it in the next couple of days. It looks straight forward but it always does when someone else does all the hard work!
Are you using WINAVR? What version?
Thanks very much for the code and the hardware layout.
A quick look at the code suggests it is well done and well commented.
I have a Nano and an LCD lying around and will give it a try. I don't have a Stepper Driver handy but can at least put the LCD and keypad thru its paces.
Thank you arvidj and lakeside53 for your comments
[IMG][/IMG]
More pictures:
Cnc Index - Control Photos by WmCnc | Photobucket
CNC Indexer - Mechanics Photos by WmCnc | Photobucket
Don't forget in the first run to go thru the config screens. Use the left/right keys to select digit and the up/down to increase/decrease values.
lakeside53 - No I don't use WINAVR.
Wagner
In case I have problems, what compiler/make or other system do you use?
A suggestion : there are some of us that will piece this together, but many more that would be intimidated by anything to do with compiling C etc.. If you could upload the hex file, it may help.
lakeside53,
You may want to take a look here ... Arduino - HomePage ... to see what the arduino is all about and the tools that are available for it. I think you will find that there is no need for a hex file. You need know nothing about C to paste the supplied code into the IDE, select verify\ compile from the menu, then upload from another menu.
Of course this assumes you actually have an arduino attached via USB to your PC, but there was an implied PC-to-micro controller programming environment in the hex file availability question.
I guess I lied about how easy it would be to get it to work. You will also need to read the "How to install a library" part of the arduino IDE instructions, but that should only add 10 minutes to the learning curve an is something you'd need if you choose to do any additional arduino programming.
But there is no programming necessary as all of the code was in the zip file so it really is just cut-n-paste or open files.
Thanks.
I've been using the Ardunio UNO for a while. I'm currently running grbl on a system similar to what was just posted, but for an entirely different use (using a rotary "table" while controlling DSLR to automatically take high quality 360 degree photos of tiny objects). Grbl is supplied via github as source, and hex for those that don't want to build it.
My concern was for a handful of other overs on HSMThere has been a few threads over there - and a hex file would really simplify it for some (and others of course want the sketch!). Some guys just want to use the end product, and have no interest or aptitude for the journey.
BTW.. after a couple of minor hiccups with the libraries loaded twice (my fat fingers combined with misleading error messages!) and the IDE hanging (weird), it built fine under 1.0.5. I can't test it yet though as my lcd is still on the way.
Good morning to all,
For this project I've only used the Arduino environment.
The folder "Indexer" must be copied to your sketch folder and the lib folders "Wlcd and Wstepper" to your sketch\libraries folder.
After that, just use the Verify or, if you have the Uno connected, the Upload buttons.
In my instalation:
\Arduino
........\Wagner
..............\Indexer
.................Indexer.ino
..............\libraries
..................\Wlcd
......................Wlcd.h
......................Wlcd.cpp
..................\Wstepper
......................Wstepper.h
......................Wstepper.cpp
Anyway, this morning I've figured out where to find the generated hex file, and here it is:
Finally.. I just received the lcd sheild. No motor connected yet but that will happen tomorrow. I set the configuration to suit my system.
The code built fine (with Arduino 1.0.5) , but I seem to have a problems with both Jog and Continuous modes.
In Jog the up/down keys do not adjust the Jog degrees; the left/right seem attempt operation, but of course it was at zero jog so no increment of displays.
In Continuous the left or right keys start operation, but there is no way to stop other than pressing the reset switch on the lcd shield.
I did see on the schematic that you use D11/D12 for Continuous mode. Is there anything I need to do on the lcd to enable these for the Duo?
Before I dig into the sketch, can you please verify the code you uploaded is what you intended? And.. have I missed something in operation?
BTW... one small modification I'll need to make - the reduction gear parameter expects an integer... before any pulley or other gearing, mine is 1: 26.8512 due to the planetary gearbox.
OK.. an update. I uploaded the hex file you posted and JOG started working fine because of the default value of 000.001, but Continuous mode still can't be interrupted except with a hard reset.
BUT there is a bug with JOG that may have been the root cause of my initial report of Jog not working. - step down the jog increment below 000.001 (i.e. 000.000) it will not wrap to 100.000 and you can not step it back up again from zero.. Once at 000.000 jog appears not to work. Easy fix.
in f41()
case KDW:
Cnf.dJog/=10;
if(Cnf.dJog<=0) // was originally if(Cnf.dJog<0)
Cnf.dJog=100000;
A suggestion.. add a version number to your initial display to help discussion and bug tracking.
Hi lakeside53,
Yes, you have found a bug. The code should be (Cnf.dJog<=0); thank you.
The Continuous mode needs the digital inputs D11 and D12 connected (hardwired) on the keypad. See the diagram on post #4 and the picture:
The Gray and Orange wires connects the keys to digital inputs.
And the reason is that during continuous mode, the code must check if the key is still pressed, and at the same time generate pulses for the motor at maximum speed. The original way to read the keys on the LCD is analogRead() on pin A0 (all the keys are connected here, via divider resistors); But analogRead is very slow; if used in this case, the motor would not reach max speed.
So I've decided to connect the left and right keys to digital inputs and use digitalRead() on continuous mode. digitalRead is almost instantaneous.
If you don't want to connect the wires on your shield, change the line of code #1188 as follows:
if(mod<3)
while(stp.Run());
else
{
while(lcd.getkey()) // was while(lcd.digkey())
stp.Run();
stp.Stop();
while(stp.Run());
}
stpgon=stp.Gone();
I will think about the issue of the reduction rate, and get back to you later.
Wagner