Shop OBEX P1 Docs P2 Docs Learn Events
MicroCNC — Parallax Forums

MicroCNC

GavinGavin Posts: 134
edited 2007-01-08 22:30 in Propeller 1
I started a MicroCNC group on yahoo to design a micro based cnc controller.
http://groups.yahoo.com/group/MicroCNC/

It is now starting to look like it should be on here.
Going through my various micros and comparing capablities the prop won hands down.
It is still fairly new to me so I am on here asking for help.

Gavin
«1

Comments

  • T ChapT Chap Posts: 4,223
    edited 2006-11-28 04:57
    I am using the Propeller for several 4 motor/encoder applications including a CNC machine designs. What are you still trying to figure out, maybe I can offer some suggestions. Shown is a 4 motor bipolar in progress that will use the Prop along with the Allegro 3986 mosfet drivers.
    576 x 383 - 39K
  • GavinGavin Posts: 134
    edited 2006-11-28 05:53
    I am have a CNCed Seig X1 mill that runs Turbocnc.
    I want to put more cnc machines in the shed without having to get more PCs, figured the Prop has enough grunt to do the axes control and maybe lots more.
    Got the prop months ago but have only been using it a week and still learning it.
    Learning the prop is taking a while but the more I learn the easier it is looking.
    Just knowing other have done it means I can do it too[noparse]:)[/noparse]
    The more information I collect the easier it should be.

    Gavin
  • T ChapT Chap Posts: 4,223
    edited 2006-11-28 06:06
    On my boards for CNC stuff, I put an RS232 connector to program the Propeller from, and also put a D-sub 25 for the parallel port from Mach3. You can change parameters on the drivers via usb2serial, or change your code as needed. With some help I have set up the Propeller to run 4 motor drivers and read 4 quadrature encoders, comparing the encoder count to the step inputs, and pausing the PC at a certain threshold of missed steps. I am not sure about how you would simultaneously run several machines at the same time, but maybe that is not what you are implying. You could certainly daisy chain several machines together with a parallel cable, and tell which machine to run when needed via usb/serial. In this case, you'd daisy chain the machines step and dir control with parallel cables, and also daisy chain serial cables from the USB port to each machine controller. Then, have a simple standalane application to select which machine is to be used prior to running.
  • GavinGavin Posts: 134
    edited 2006-11-28 07:59
    Was going to put a 26 way header for a 26 to D25 IDC cable or it could be used to connect directly to driver boards.
    I may not be able to emulate an entire parallel port, going to need some other pins for video and keyboard etc.
    If I make it configueable then with some restrictions it should be able to replace a Turbocnc, EMC or Mach pc.

    You closed the loop with encoders? For a router that size you could have used servo drivers with step/dir input.
    Have you got it taking G-codes or are you controlling it via a pc?

    A two prop solution might get me the I/O for parallel port emulation.
    One to replace the pc and the other as the stepper controller

    Gavin
  • T ChapT Chap Posts: 4,223
    edited 2006-11-28 08:40
    I am controlling via PC for CNC machine use, but for other applications using usb2serial, sending it positions for 4 motors, the Propeller then handles all motion control, accel/decel etc. How will you input Gcode to the Propeller? I suppose you could have the Propelle read a text file off a USB dongle with the Gcodes, but you'll have to write a bit of code to do arc interpolation among others. It is doable, just a bit of time coding it, trial and error. I am not sure you wouldn't be better off with a $100 junker PC. You should't bother with using the Prop as stepper sequence driver, the 3986 mentioned earlier is the best way to go, send it step, direction, step rate(whole, half, 1/4, or 1/16), decay rate, and it will manage the mosfets and PWM for you. For 5 bucks a motor using the 3986 you can't go wrong. The only hassle is it is only available in Tssop(.5mm pitch). There is no dip version or stamp version that I am aware of. I am building boards for it right now, but it is not fun, I veiw it as a mandatory learning curve though. I am reading the stemp counts into the Propeller, letting the 3986 handle the motors, the compare function in to code will allow you to specify the error prior to taking action. If your software would allow it, you could pause the gcode at X number of missed steps(cumulative error), then you could have code the Propeller to attempt to autocorrect and compenasate for the error, if it corrects, tell the PC software to continue where it left off. I don't personally like this idea, as I consider a misstep a possible spindle bind, or just hit a limit, in either case I want the machine to shut down and stop the spindle. Granted, you could attempt one error correction, then shut down. I like steppers, not servos, although you could use servos on th Prop as well. Not my choice though. Long story short is you could do it all on one Prop.

    4 motor setup using Prop as step/dir source(alternative is the same, except step and dir is inputs from PC instead of outputs)

    encoders 8 pins
    step out 4 pins
    dir out 4 pins
    step rate to drivers 2 pins
    disable to drivers 1 pin

    subtotal Prop pins used: 19 of 32
  • GavinGavin Posts: 134
    edited 2006-11-28 10:33
    I use Toshiba TA8435 which are similar to the A3977, though hole and good enough for small size 23's and single chip.
    Working on a 4 axis driver board design that may get changed to all in one if I can get prop doing what I want.

    I was not going to let the prop control the microstep, just set it via dip switch, default to 1/8.
    The great thing with the prop is all cogs have access to all pins, so limit inputs can become encoder inputs just by software change.
    Want to use a jog encoder wheel to control single axis, so there will be at least one encoder input.

    You could have a point about stepper encoders, when I get crashes it is a pain to reset zero.
    An accurate home position could reduce the need for axis feedback.

    Junk PC's don't worry me, I have boat anchors everywhere but space is limited in the shed and pcs love swarf.
    Networking them would be nice, RS485? could do ethernet but why bother.

    Hmm one prop for g-codeing another for motors, limits etc. Might be an easy way out than trying to fit it all in one prop.

    Gavin
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-11-28 11:33
    originator99,

    You will need more support for those rails [noparse]:)[/noparse]
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-11-28 12:19
    Hi,
    The CNCmachne.jpg image really is attractive. I wonder how much one would pay for such?

    Since Gavin mentions RS-485, you can go one step further to a CRC network.
    I've been working with CANbus and the MCP2515 chip than can use the Propeller as its micro. I even made 25 boards and have gotten about 10 operational [noparse][[/noparse]it is an SPI interface and I've been using BasicStamps and SX-28s].

    In other words, are you in need of an RS-485 communications capablity with allowance for multiple masters and 40 nodes? If so I am letting a pair of blank boards go at near cost $12USD via postal delivery world wide. A zip file of documents, PBasic test programs, and schematics is available. Just PM me.

    I know this may seem like a blatant plug, but I am doing this at cost.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • GavinGavin Posts: 134
    edited 2006-11-28 12:57
    RS485 would allow some distance and the option for one PC to feed a few prop based cnc machines.
    I have visions of lying in a deckchair in the back yard while a bunch of machines are in the shed making money for me.
    A wireless laptop to a pc RS-485 g-code server?

    That dream is still off in the distance, I still need to get some speed curves working.
    Starting to get a good picture of the box and what it can do.
    Pretty much the same as this http://www.deskcnc.com/controller2nd.html

    Wondering now why I am doing it, well why not, a good way to learn a new micro is to do something real with it.
  • T ChapT Chap Posts: 4,223
    edited 2006-11-28 18:42
    You will need more support for those rails [noparse]:)[/noparse]

    Yeah I was thinking I was getting a lot of slop using the free air method!

    A company called 8020.net cut the materials to order, the table alone is around $900 unassembled. I think the idea of sending the text file serially from one PC to multiple Propellers is interesting. Of course thee would be a file size limitation without external stotage. But, ifd you were going to go the the trouble to translate Gcode into steps, It may be worth the time to explore it. You could DL the file to the machines ID, then ready the machines individually with a few locfal buttons: Ref Home, Zero X, Y, Z, A, Jog each motor L-R, Front-Rear, Up-Down. Sop, Pause, Start. Just put a key pad on each machine with the buttons mentioned, or some other configuration.

    Post Edited (originator99) : 11/29/2006 6:41:07 AM GMT
  • GavinGavin Posts: 134
    edited 2006-11-28 23:00
    G-codes don't take up much room so lots of memory is not required for simple machining jobs.
    3D work and curved surface are a different story, but a large serial EEPROM should hold a few programs.

    Local buttons are a good idea, small display for DRO, little serial LCD?
    Would be nice if touch panel displays were cheap, easier to use something like a Z22 PDA.

    Make a handheld pendant with LCD for manual control but also serial link to it?
  • T ChapT Chap Posts: 4,223
    edited 2006-11-29 05:19
    I like the ideas. Here is a new board using the Propeller and Allegro 3986 driver. This board isn't fully populated yet, it will daisy chain out to 3 other daughter boardsvia ribbon cables, then the Propeller will manage all driver parameters, count steps, count quadrature pulses and compare, and communicate with the PC as needed. The next revision will use all surface stuff. I left the Prop in DIP for the first Rev, as I am prone to blow a few of them up during design phase. Does anyone leave the eeprom as dip? I am triyng to think if there is a case ever to replace code with swapping eeproms. Hooking up a PC is a breeze, so why bother keeping the eeprom DIP?

    Keep us posted on your progress Gavin.
    722 x 480 - 56K
  • GavinGavin Posts: 134
    edited 2006-11-29 07:24
    I too prefer dip/through hole for prototyping too, tendancy to blow things up until code is debuged.
    I got extra dip props and eeprom when I ordered my prop kit, two of each incase one blows[noparse]:)[/noparse]
    That looks like a milled pcb, Eagle and pcb-gcode?

    Good reason for dip EEPROM is plugging in a bigger one later on, dip micro because it is easy to replace if faster one shows up.
    What software tools are you using on the pc end?
    Any thoughts on the serial comms protocol?
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-11-29 13:03
    A propeller based g-code interpreter with step and direction outputs would be neat and very similar to the g-rex from geckodrive. The nice thing about a uP doing the pulse generation is the high pulse rates you can acheive. I was working on a single cog 3 axis control that would do linear interpolation and trapizoidal velocity, I was getting somewhere but a long way from a finished article. For a dedicated CNC controller you could of course use a cog per motor. Then send g-code via serial or load from a USB drive using the new module from FTDI or something similar.

    My first step is going to be getting linear velocity ramping working properly in assembly and get a single axis acting in a way that is comparable to what Tcnc or mach can do.

    Graham
  • T ChapT Chap Posts: 4,223
    edited 2006-11-29 19:27
    I like RealBasic for putting together cross platform apps. It is very easy to get data in and out of the PC from the micro using USB2serial. I could help you with the app, it sounds like a straight forward thing just to send out some strings.You could get the 14 day demo, and then it is $100 for the license for your choice of platform.

    The board above is the barebones PCBexpress. Eagle to gcode is a slick option, I avoid making boards these days.

    I'll send you a PM with a link to an app you can check out to talk to the Prop. I assume you have a PC with either a seral port or USB2serial adapter. Ther are some other goodies I can send you to check out.

    Is you plan to generate gcode for a part, export the file to any number of machines each with a unique ID so the machine can be identified as to which one to dowload the file if on a network? If so, just a serial cable daisy chained between units will suffice. I don't remember what the max length is, but you could buffer at each link through a MAX3232, or just daisy chain the PC TX to all units. I don't see a big reason to need feeback, but if you did, you could find some method to get all machines to talk back to the PC, 1wire to serial off the PC and 1wire devices on each machine maybe.

    Graham, what is the issue with getting ramping done in asm? What is the max step output capability for 3 motors using Spin? Unless you were micro stepping, I would think that Spin would be sufficient of using 3 cogs.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-11-30 00:54
    It is the division to provide the time period for the a specific frequency. I was wanting to avoid look up tables and keep it fast and smooth. The geckodrive G-100 has max pulse rates of about 4Mhz and 16-bit frequency resolution.

    With servos you often need pulse rates that are pretty high especially if you are trying to go fast, one of my applications (a parallel kinematic machine) is all about speed.

    Graham
  • GavinGavin Posts: 134
    edited 2006-11-30 02:54
    Graham
    Hexapod on the prop?

    Re cnc mill
    Not sure if it will need 1 cog for 4 axis or simpler to have 1 cog per axis with extra cog as controller.
    If you get 1 axis working just copy it into another cog for another axis?

    Nice stepper code here
    http://www.embedded.com/showArticle.jhtml?articleID=56800129
    How to use it in a multiprocessor environment?

    So far it is taking me longer to learn prop/spin than it would to write the code[noparse]:)[/noparse]
  • T ChapT Chap Posts: 4,223
    edited 2006-11-30 03:51
    A quick and dirty method to distribute wirelessly is the Xbee or Xbee Pro, The pro is around $30 with better range essentially. Each machine can have it's own ID either in the Xbee programming or in the Propeller(easier route). One tranceiver on the PC, and one per machine. Range is pretty good on them. That's what I would do if wireless. Speed isn't great at 9600 but who cares about a few extra seconds. The Xbees are basically just straight wire, power, GND, input or output pins, just plug and play. They are bi directional.
  • GavinGavin Posts: 134
    edited 2006-11-30 04:21
    Graham,
    Those Geckos have heaps of chips.
    FPGA is one way to do it and is what I was looking at before finding the Prop.
    I am still a beginner on the prop but it is nice to know others have already got motors spinning.
    That's probably only about 5% of the entire project but it is the core part.

    It should be good enough for simple home cnc machines.
    Now a 4 motor 3 phase brushless controller with serial/IR/RC input would be fun.
    As well as flying bots it would make a nice big router controller.
    Nice little one for mini CDROM motors, nice big 500W one for industrial use.

    Originator, how much do those Xbees weight?
  • T ChapT Chap Posts: 4,223
    edited 2006-11-30 04:46
    super light, nothing to them, size of a quarter maybe
  • OzStampOzStamp Posts: 377
    edited 2006-11-30 05:33
    Hi Org99

    If you are in the process of making a stepper motor driver please do it properly especially
    if you are considering to sell the system to other people.
    Implement short circut detection ( all possible modes) phase to phase .. short to gnd etc etc.
    Desktop type cnc machines especially have depending on the mechanical construction and how the
    machines moves its bed etc ..lots of moving parts ... cables flexing/moving...
    Having worked in the industry for the last 10 years please take my word for it...
    Some of those cheap drivers you can buy virtually explode when there is a simple phase fault..

    Ronald Nollet
    Parallax Australia distributor
  • edited 2006-12-04 22:52
    Hey Originator.... I see you are talking about the XBee Pro for wireless communications... I use the Radiotronix Wi232DTS from www.radiotronix.com this little module is intended to replace the wire in a RS-232 system, it comes with DTS/RTS hardware control... it is super simple to use and fully configurable (transmission power level, master/slave. etc) and it can transmit at 115 Kbps no problem!!.. that is how I actually have it set up; ·I am trasmitting and receiving at 115kbps.. it has a 198 byte transmit buffer... you can actually change the rate at any time or any other parameters on the fly through a Command pin which is very simple to use, I haven't tried to use it over a long distance, but it is rated for a couple hundred feet over line-of-sight; nd the cost is comparable to Xbee at $ 30 per module at www.mouser.com I hope this helps..

    Post Edited (Joe "Bot" Red) : 12/11/2006 3:41:27 PM GMT
  • LitefireLitefire Posts: 108
    edited 2007-01-08 17:32
    Hey Joe. I'm really interested in trying out this RS-232 system... I have a mobile robot using a propeller that i'd like to reprogram on the fly.

    I'm wondering if you could give me some more info on your setup, and what i might need to try using the propeller in this way.

    Thanks so much!

    ~~Brian
  • LitefireLitefire Posts: 108
    edited 2007-01-08 17:34
    just read the rest of the post, would anyone give a comparison to the Wi232DTS with the XBee?

    how easy is the xbee to use with the propeller? and what hardware would i need to communicate between the prop and a computer? and finally, would it use the COM port behind my computer, or does the PC side have a usb connection (i hope).

    ~~Brian
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-08 18:09
    Hi Brian,
    I tried to find documentation on the Wi232DTS for comparison, but couldn't find a good link.

    The XBee is real easy to use with the Propeller - Simply use FullDuplexSerial just like you would with a COM port at 9600.

    I have boards to plug the XBee into a breadboard/solderboard, though they require 5V for operation, they can interface directly to the propeller at 3.3V (though I can modify for 3.3V power if needed). In about 2 weeks I'll have full 3.3V board available for a little less in SIP version or to go on the new Propeller ProtoBoard headers.

    As far as the PC side, I also have USB adapters for the XBee's that create a virtual COM port.

    http://www.selmaware.com/appbee

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·

    Post Edited (Martin Hebel) : 1/8/2007 6:14:44 PM GMT
  • LitefireLitefire Posts: 108
    edited 2007-01-08 18:39
    awesome, but can i also use it for programming the propeller wirelessly? i assume that it works the same way...

    this looks perfect, i'll look into it in more detail. any hints on the PC side of the txfr?

    ~~Brian
  • LitefireLitefire Posts: 108
    edited 2007-01-08 19:11
    Also, what would an approximate price be for a system between the prop and a computer? I'm kind of on a budget...
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-08 19:21
    Hi Brian,
    No, it can't be used for wireless programming directly at this time. The XBee does not support remote DTR control, and I don't think the Propeller IDE would care for the latency either.

    If that's your need (I came in at the end of the discussions) I don't think this will fit what you need.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-08 19:49
    The Wi232DTS doesn't support remote DTR control either (from reading the spec) so would not work for Propeller programming. The Propeller depends on the edge of DTR to cause a reset of the chip, then expects a complex interchange of data to occur within a fraction of a second to "prove" to the Propeller Tool that there's a Propeller chip running. It would be possible to make a wireless substitute for the serial programming connection, but neither the XBee nor Wi232DTS will do it.

    Mike
  • LitefireLitefire Posts: 108
    edited 2007-01-08 20:20
    okay, do either of you know a method to implement such a programming system? such a system would also be able to (i would have to assume) tx and rx bytes to/from the propeller, and would not JUST be a programming tool...

    ~~Brian
Sign In or Register to comment.