Shop OBEX P1 Docs P2 Docs Learn Events
3-axis CNC-control packages uploaded to the OBEX by Don Starkey — Parallax Forums

3-axis CNC-control packages uploaded to the OBEX by Don Starkey

StefanL38StefanL38 Posts: 2,292
edited 2014-04-19 14:05 in Propeller 1
Hi Everybody,

I just discovered this and want to give a heads up to a - not only an "object" - but a complete package that forms a 3-axis CNC-control.

3-Axis CNC Control Package

Don Starkey has uploaded his code and some documentation to the OBEX. Wow ! This looks very promising.
It is an already working system with some minor bug and potential to expand on.

I started the same project but didn't come to far. So I will switch over to this code. Working my way into understanding it
and then going on expanding new functions that seem useful to me.

Who would like to collaborate in this?


Some of the features are listed below:

- 3-Axis stepper driven control for a small milling machine.

- Analog feed rate override pot to adjust the feed on the fly. I like the intuitive feel of a knob over
push buttons. I use 0-200% over ride but it can be from 0 to any percentage you choose.

- Over travel / home limit switches on both ends of all 3-axis.

- Runs completely on 1 Parallax Propeller.
- Uses an external VT-100 terminal (free software running on an attached notebook computer)
for the user interface.

- 3-Axis linear interpolation with acceleration / deceleration.

- 2-Axis circular interpolation (with acceleration / deceleration) in XY plane.

- Limited amount of Z-axis movement during circular interpolation mode allowing for helical
interpolation.

- User configurable logic states for over travel/home switches for each axis.

- User configurable logic states for Step & Direction.

- User configurable Step pulse state & width.

- Tool length offsets, Fixture offsets.

- Setup screen for Steps/Inch, Rapid Feed rate Amount, Feed rate Override Pot Amount.

- Manual JOG mode.

- MDI editor.

- CNC Program editor.

- Single step mode.

- Program storage on attached SD card.

- Program overlay stored on SD card to allow very large SPIN programs to be loaded as modules.

Wow to me this is like chrismas and eastern pre-dated to january!
«1

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2013-01-08 12:27
    This is on my to do list for my Prusa RepRap. While I have done pcbs to take the pololu stepper drivers, or my own equivalents, I just have not had time to do it.

    Please keep the thread updated so I can follow your progress :)
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-01-09 07:54
    Can this control those cheap stepper motors from China? I have a bunch of those, it might be easier to set up.

    It takes G-code as input, so can we just use the G-code output from skeinforge or kisslicer?
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-09 08:38
    Hi Prof. Braino,

    the propeller-chip creates the signals for step and direction. So any stepperdriver-board that has step / direction-input
    will work together with this control. Maybe a voltage-shifter from 3.3V to 5V is needed.
    Examples:
    An L293D will not work because this chip needs signals for each H-bridge (at least four signal-lines)
    A L297-L298 combination will work or a TB6560 will work.

    The logic state of the outputs and pulse-length is user-configurable.

    As I am myself are just starting with this software I haven't tested it myself yet.
    If the G-Code is really standard G-Code I think it will work.

    Can you post some example-G-code produced by skeinforge and kissslicer?
    If I can look inside the G-Code I can say more.

    best regards
    Stefan
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-01-09 08:48
    This is neat! Could you use a small laminate/trim router as the cutting head in something like this? Keeping the speed of X an Y movement slow and not changing Z by too much each pass should allow it to keep up with the cutting and not bog down in the material. If not, what is normally used for the cutting head motor?
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-09 09:28
    Hi Rick,

    minimum is a "Dremel". If you want to have more cutting-power a high-speed spindle 10-15.000 rpm 750W up to 2 kW is used.
    The power of the spindle depends on what you want to mill. milling and drilling PCBs a dremel will do well.
    For wood if you have plenty of time it will do too.

    For aluminium or steel you need a real stiff mechanic and big stepper-motors (6A 3Nm) for the axis
    and a 1 -2 kW spindle

    best regards
    Stefan
  • MicksterMickster Posts: 2,611
    edited 2013-01-09 09:28
    Don't forget that ManAtWork produces a Prop-based servo amplifier that takes step and direction commands so one can do things the right way by closing the loop!

    Mickster
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-09 09:51
    Hi Mickster,

    Yes you are completely right.

    benezan electronics
    steppermotors with a very good price performance ratio

    high power stepper drivers (propeller-based !)

    now show me anything else with this specs and this low price

    best regards
    Stefan
  • MicksterMickster Posts: 2,611
    edited 2013-01-09 11:04
    But you can also go closed loop servo with this:

    http://benezan-electronics.de/shop/product_info.php?products_id=4

    Mickster
  • MicksterMickster Posts: 2,611
    edited 2013-01-09 14:07
    StefanL38 wrote: »
    Hi Everybody,

    I just discovered this and want to give a heads up to a - not only an "object" - but a complete package that forms a 3-axis CNC-control.

    3-Axis CNC Control Package

    Don't forget to download the file "Config.ovl.zip" in the lower right corner
    under Other Downloads: Auxiliary Files
    .

    Don Starkey has uploaded his code and some documentation to the OBEX. Wow ! This looks very promising.
    It is an already working system with some minor bug and potential to expand on.

    I started the same project but didn't come to far. So I will switch over to this code. Working my way into understanding it
    and then going on expanding new functions that seem useful to me.

    Who would like to collaborate in this?


    Some of the features are listed below:

    - 3-Axis stepper driven control for a small milling machine.

    - Analog feed rate override pot to adjust the feed on the fly. I like the intuitive feel of a knob over
    push buttons. I use 0-200% over ride but it can be from 0 to any percentage you choose.

    - Over travel / home limit switches on both ends of all 3-axis.

    - Runs completely on 1 Parallax Propeller.
    - Uses an external VT-100 terminal (free software running on an attached notebook computer)
    for the user interface.

    - 3-Axis linear interpolation with acceleration / deceleration.

    - 2-Axis circular interpolation (with acceleration / deceleration) in XY plane.

    - Limited amount of Z-axis movement during circular interpolation mode allowing for helical
    interpolation.

    - User configurable logic states for over travel/home switches for each axis.

    - User configurable logic states for Step & Direction.

    - User configurable Step pulse state & width.

    - Tool length offsets, Fixture offsets.

    - Setup screen for Steps/Inch, Rapid Feed rate Amount, Feed rate Override Pot Amount.

    - Manual JOG mode.

    - MDI editor.

    - CNC Program editor.

    - Single step mode.

    - Program storage on attached SD card.

    - Program overlay stored on SD card to allow very large SPIN programs to be loaded as modules.

    Wow to me this is like chrismas and eastern pre-dated to january!

    This is a VERY nice piece of work!!!!

    Mickster.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-01-12 08:15
    Anybody working on this over the weekend?

    I have to tile a floor :(
    Actually :) because its messy and I get to use power tools :)
  • richaj45richaj45 Posts: 179
    edited 2013-01-12 11:00
    Hello:

    So were is this "Config.ovl.zip" file located?
    I could not see it on the OBEX page.


    cheers,
    rich
  • SapiehaSapieha Posts: 2,964
    edited 2013-01-12 11:08
    Hi richaj45.

    I see it now placed in same zip file



    richaj45 wrote: »
    Hello:

    So were is this "Config.ovl.zip" file located?
    I could not see it on the OBEX page.


    cheers,
    rich
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-01-13 18:05
    The guys from pumping station one are working on a pick and place machine.

    http://boardforge.com/

    They have the chassis started (based on shapeoko), and the developer is working on the GUI.

    The motor control isn't nailed down yet, and arduino per reprap is being considered. But the don't have an embedded controls guy on the team yet.

    I told the developer about this thread, he's considering using the prop and will give the code a look. Anybody interested in pick and place?
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-15 23:58
    Now there are 100 downloads from the Obex. Of course this is not equeal with 100 people using Dons CNC-software intensively.
    (including me as I have to mount endswitches to my mechanic before I can start.) But there seems to be quit a good amount of interest.

    So I would like to ask some questions:
    - who has tested the softtware-package on a real CNC-machine?
    - if you have already tested it: what would you like to change/improve?

    - who is planning to using it?

    If you answer one question with yes I would appreciate if you post your experience and/or plans

    best regards
    Stefan
  • tonyp12tonyp12 Posts: 1,950
    edited 2013-01-16 20:17
    Can it only handle Dir & Step?, or can it handle 4 wire dual-hbridge (like a TI DRV8833)?
    and you manualy doing the stepping that you can expand in to halfstep and even microsteps.

    This is a SpinDemo of half-stepping on my quadstepper quickboard
    http://forums.parallax.com/showthread.php/138695-Now-Available-QuadStepper-board-for-QuickStart?highlight=quadstepper
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    VAR
      byte ByteArrayPinOut[4]          ' the 4 pin groups for each motor
      byte ByteArraySteps[8]           ' declare 8 steps including the halfsteps
      long LongArrayStepCnt[4]         ' each motor have a current step counter
    DAT
      PinOut  byte 8,16,20,24
      Steps   byte %1000,%1010,%0010,%0110,%0100,%0101,%0001,%1001
      StepCnt long 0,0,0,0
    PUB start | i
      repeat i from 0 to 3
       dira [Pinout[i]..Pinout[i]+3] :=%1111                ' set all pinouts to output
      repeat
        repeat i from 0 to 3                                ' test all 4 motors 
          repeat 200
            StepCnt[i]++ 
            outa [Pinout[i]..Pinout[i]+3] := Steps[StepCnt[i]&7]
            waitcnt(clkfreq/100 + cnt) 
    
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-16 23:14
    Hi Tony,

    thank you for sharing your code.
    The code from Don can handle only Dir/Step. I guess this is for several reasons:

    - The pattern how to switch ON/OFF the H-bridges is strict logical fpr full/half/microstep-mode so it can be done easily from a small piece of hardware (no FPGA needed ;-)

    - for high frequencies you need much more horsepower of the MCU to do all the details of the H-bridge switching

    - for switching the H-bridge you need twice as much IO-pins for the interface MCU-stepperdriver

    best regards
    Stefan

    P.S.: I want to point to my main thing: who is willing to collaborate the further development of this code?
  • babinda01babinda01 Posts: 54
    edited 2013-01-16 23:23
    Hi Stefan
    Thanks for pointing us to this work done by Don. And a huge thanks to Don for your efforts here.
    I would love to work on this, my prop skills are rather minimal but growing daily, but my pc programming skills are a little more advanced.

    Andrew
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-17 00:07
    Hi Andrew,

    If I have understood Don right, he himself has no time to develop it further but shared his code so that others (me and who else?) can develop it.
    MY CNC-mechanic will need some work until I can start really. But right now I have the flu (and can't work in my workshop) and after beeing healthy again
    my daily work and a community-project I'm involved needs a lot of time for the next 6 weeks. So my progress will be just in small steps.

    Do you have a CNC that is ready to run?

    Except for tweaking / expanding menues there is not much possible without a working hardware.

    best regards
    Stefan
  • babinda01babinda01 Posts: 54
    edited 2013-01-17 01:26
    Hi Stefan
    I've got a factory full of the things, but I do have a 4 axis engraver that I have been using as a test bed for my tinkering. I have a busy schedule for the week, but after that I will pull the current drives off it (I have been playing with drives that accept commands from a can bus - not a huge success), and put a set of gecko step and direction drives back on it, this should only take a couple of hours - then I will be good to go.

    Regards
    Andrew
  • tonyp12tonyp12 Posts: 1,950
    edited 2013-01-17 07:41
    >for high frequencies you need much more horsepower of the MCU to do all the details of the H-bridge switching

    Is this not where the Prop shines? (puts those cogs to work)
    I will make a stand alone cog that will interpet the DIR-STEP for Dons Obex.
    And you simple use find-and-replace: Mov OUTA with Wrlong SoftOUTA (a hub ram location)
  • Mark_TMark_T Posts: 1,981
    edited 2013-01-20 05:14
    The guys from pumping station one are working on a pick and place machine.

    http://boardforge.com/

    They have the chassis started (based on shapeoko), and the developer is working on the GUI.

    The motor control isn't nailed down yet, and arduino per reprap is being considered. But the don't have an embedded controls guy on the team yet.

    I told the developer about this thread, he's considering using the prop and will give the code a look. Anybody interested in pick and place?

    Actually I have mused about a pick-and-place intelligent robot... I was thinking with some serious but cheap compute power like a RaspPi connected to camera on
    the head assembly and a high-res camera looking at a parts tray, it might be possible for software to figure out which components are which, perhaps with
    some human intervention and dialog, and it would go to it. So instead of needing reel holders and so forth you just spread components on the tray in
    groups, do a brief touch-screen interaction to label the groups the machine can't figure out, then let it run...

    Obviously some sort of visual recognition package with training ability would be essential.

    As I said it is musings only at the moment, as it the pick-and-replace machine for recycling components from boards
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-01-20 07:04
    Mark_T wrote: »
    the head assembly and a high-res camera looking at a parts tray, it might be possible for software to figure out which components are which, perhaps with some human intervention and dialog, and it would go to it.
    Obviously some sort of visual recognition package with training ability would be essential.

    They've already started talking to the guy from openCV.

    http://www.embedded-vision.com/eric-gregori-biography

    http://buildsmartrobots.ning.com/group/usingopencvforrobotics

    So right not the main group is focused on the system design, with attention to the GUI and the physical parts for the CNC motion. They are looking for the low level control for the steppers and vacuum pump etc, and have stubs for the vision system.

    I told them I would send folks their direction, if you want to get in on this sign up and introduce yourself. This is going to be really nice.
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-21 13:23
    Hi,

    I want to come back on the original CNC-code for milling. I'm still busy with my daily work.
    Has anybody tested more than I? (I tried editing storing and re-reading a G-Code file).

    Has anybody tested the code with a real CNC-mill? At least move to home-position until home-switches
    turned On/Off?

    best regards
    Stefan
  • TinmukTinmuk Posts: 15
    edited 2013-01-26 17:36
    Hi,
    I just finished building a small XY table in my home shop for testing CNC applications. Right now I am trying Mach3 with it, but I am having some problems with it. However I would prefer a solution that does not involve Windows.

    I would be willing to do some testing, but I am a better machinist than programmer so it be would useability testing and such.

    Thanks,
    Robi
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-26 23:18
    Hi Robi,

    welcome to the propeller-forum. As this is your first post. Do you already have a propeller-chip?
    Don's code needs a PC with a VT100-Terminal software. I'm sure there are terminal-apps for linux.
    So this solution would avoid windows but would still need a PC. I would like to modify the code
    that a second propeller-chip works as the user-interface by using a small TV-screen or a VGA-Monitor.
    for Output and takes the userinput via PS/2-Keyboard.

    The download-package includes a schematic. There you can see which propeller-Chip-IO-pin is connected to what.
    The minor bug I mentioned is that Don wrote if the buffer is used in same cases a single step gets lost. If buffer is deactivated
    (in the source-code) everything works fine. So I would appreciate it if you would do useability testing.

    If you have any questions about the schematic or the code just post them here.

    best regards
    Stefan
  • Mark_TMark_T Posts: 1,981
    edited 2013-01-27 02:48
    StefanL38 wrote: »
    Hi Robi,

    welcome to the propeller-forum. As this is your first post. Do you already have a propeller-chip?
    Don's code needs a PC with a VT100-Terminal software. I'm sure there are terminal-apps for linux.

    There are probably hundreds, but "screen" is the obvious choice I believe.

    I had a brief go at using "screen" without any luck - just hanging... To be specific I tried:
    screen /dev/ttyUSB0 115200,cs8
    

    Using BST the VT100 output is unreadable, all one line.

    [edit: realised I needed to change my DTR->reset circuit to a capacitor (was a diode) to be compatible
    with screen (holds DTR low) - can see the VT100 interface now, but with an SDcard can't do much more,
    manual jog doesn't seem to do what I expect]
  • StefanL38StefanL38 Posts: 2,292
    edited 2013-01-27 03:33
    Hi,

    I'm glad that people start testing the software. Your questions show what of information new users of this software need.
    So a new version of the manual should emphasise on the VT-100 terminal standard. So keep the questions coming.

    I tested it with tera term and everything worked fine. I don't know much about the VT100 standard. But the little I know is that it uses special characters for cursor-positioning
    clearing the screen etc.

    So you really need a terminal-software that is able to display things according to the VT100 standard.
    The file Propeller CNC project.pdf is some kind of a manual and this manual says:

    "When the main program (CNC6.spin) is started, it loads all the required PASM code and displays the
    main menu on the attached VT-100 serial terminal. I use Teraterm, version 4.72 as the terminal
    emulation software on an attached notebook computer. All GUI is done using the serial terminal, all CNC
    code execution is done on the propeller and is not limited in any way by the speed of the terminal
    program or the laptop computer. The step calculation is very fast."

    So here is a downloadlink to Tera Term 4.76
    http://en.sourceforge.jp/projects/ttssh2/releases/

    best regards
    Stefan
  • Mark_TMark_T Posts: 1,981
    edited 2013-01-27 13:24
    Well for completeness here's what happens without an SD card -

    first a message about "SDcard possibly corrupt?" since it can't talk to a card, but then it draws the main
    control screen:
    CNC6.png

    I don't seem to be able to get any of the position figures to change (I've tied the limit switch pins (P10..P15) high.
    You can select Manual Jog (5), then Keyboard Jog (1), and select from 0.001, 0.01 etc, but the keypad arrows
    don't seem to do anything - the code is looking for those codes but it doesn't seem to have any effect,
    perhaps because the feed rate isn't configured? Shall pop an SDcard interface onto the breadboard at some
    point and have another attempt no doubt :)

    Having looked at the code it seems to do absolutely all calculations in floating point which will be a limiting factor.
    (Actually I think Bressenham's uses integers, but then the step pulses are timed using floating point calculations
    for acceleration/decelaration)
    975 x 605 - 74K
  • babinda01babinda01 Posts: 54
    edited 2013-01-28 01:01
    Hi Guys
    Just thought I would let you know I got my little test machine up and running today. I have had a very quick play with Dons code AND IT WORKS!!!!!!!
    I still need to get myself an ADS1000 chip soldered onto my proto board for the feed override, but I can jog, home and run a program ok.
    I need to play with the accel table a bit though as it isn't super smooth motion.
    I will play a bit more tommorrow if time permits, and let you know how I go.

    Regards
    Andrew
  • Mark_TMark_T Posts: 1,981
    edited 2013-01-28 05:44
    Yes that table looked suspect to me - it represents time intervals per step, so should have a 1 over square-root law, which looks
    about right except there are 3 missing values at the start, it should start 22.94, 13.02, 10.05, before the 8.4733,7.4651, ....

    [but really you should generate your own table from knowing the max acceleration allowable and your step size]
Sign In or Register to comment.