Shop OBEX P1 Docs P2 Docs Learn Events
New To Electronics - Have Propeller and stepper motor - Now what? — Parallax Forums

New To Electronics - Have Propeller and stepper motor - Now what?

Nicholas01Nicholas01 Posts: 5
edited 2009-08-20 12:27 in Propeller 1
I have a small sand blasting business on the side. I am working on automating my blaster with an x & y axis motor driven roller system. I emailed Parallax a while ago and told them my scenario, they recommended I get the 40 pin Propeller Education Kit, which I did. I also grabbed a couple of 6V 2A stepper motors with power supplies. I understand the Propeller chip can run a stepper motor, but I can't find to see any codes in the Object Exchange. I am too new to electronics to understand what would control the motor with out text that says "this is how you would program/control a stepper motor".
If anyone out there can help me with:
1. the hook up of the motor to the bread board (can I wire the motor wires directly to the outputs of the microcontroller?), and;
2. the program to run the motors.
Please, if you're kind enough to respond, understand that I am extremely new to electronics. Thank you very much!

Comments

  • GranzGranz Posts: 179
    edited 2009-08-14 02:16
    I have not used steppers with the Prop, but am pretty familiar with them.

    I did a search in the Prop forum and found a couple threads which may help:

    http://forums.parallax.com/showthread.php?p=830952

    http://forums.parallax.com/showthread.php?p=827788

    There are others there, but these looked like the most useful for beginners.

    Then take a look at the documentation for Parallax's Stepper Motor.
    www.parallax.com/Store/Accessories/MotorServos/tabid/163/CategoryID/57/List/0/Level/a/ProductID/65/Default.aspx?SortField=ProductName%2cProductName

    At $13 each, it is well worth it to buy a couple and spend some time playing with them until you feel comfortable and then you can transfer the lessons learned to your real project. Don't underestimate the mechanical side of the setup either though. To me it is a lot easier to control steppers, than to link the stepper motor to what you want moved.

    Good luck with your project.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-14 02:29
    Do not hook up the motor directly to the microcontroller. The voltages and amount of current involved can destroy the Propeller and won't make the motor even twitch.

    Here's a nice Nuts and Volts Column on the subject. It includes a schematic of one possible hookup using a couple of L293D motor driver chips and some sample Spin code that you can use as the basis of your project.

    www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol7/col/NV136.pdf
  • Nicholas01Nicholas01 Posts: 5
    edited 2009-08-14 02:34
    I really appreciate the replies guys! Thank you very much!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-08-14 02:47
    Nicholas01 said...
    ... I am too new to electronics to understand what would control the motor with out text that says "this is how you would program/control a stepper motor". ...

    Honestly, Nicholas, if I were you, I would NOT try to learn about microprocessors via the Propeller. The Propeller can probably do the kinds of things you want to do down the road, but if you have no experience at all with these kinds of things, I think you are going to find the Propeller a very difficult route to start with. My suggestion is to start with one of the STAMPs that Parallax sells. There are tons of materials available to help you learn about microprocessors via the Stamp, step by step, and the programming code for the Stamp is about as easy as code can get. After you learn how to work the Stamp, then you can graduate to the Propeller, which has all sorts of wonderful features the Stamps do not have, features that allow you to control your steppers the way you probably want to. It's also possible that, once you get good with the Stamp, you might not even need the Propeller for your sandblasting application - maybe you'll figure out a way to use the Stamp after all. But personally I do NOT think the Propeller is ripe for total newbie usage. It's better to start with the basics (the Stamp) and work your way toward the more sophisticated Propeller. You will still get good use out of the materials you have already bought and you'll not be wasting money if you do it that way.

    Anyway, that's just my 2 cents worth.

    good luck with whatever you do,
    Mark

    smile.gif
  • T ChapT Chap Posts: 4,223
    edited 2009-08-14 03:03
    If more info were known about your project you could get a little farther. What kind of work are the steppers doing? What supply did you buy? What is connected to the steppers? Automating something of any robust nature to move equipment will require some voltage, 24-36 volts DC, and you will likely need some heavier duty steppers, bipolar Nema 23 size at a minimum will provide some good torque. Some people get into electronics to solve a need or explore an idea, such as your automation project. Some want to learn every aspect of things while others just want to get it to 'work' and do a job for them. Know what you want to do helps make suggestions.

    There is no info on what type interface you need to run the system, what decided how the motors will move? With steppers, you can get as deep as you want with building your own drivers(PCBs that contain the power switching required to turn on and off the stepper coils, usually with transistors, Mosfets are commnon). You could spend a long time getting a home brewed driver dialed in, as you will quickly learn that current limiting will be a factor to deal with if you are using any motors that are doing any real work. Unless you are just wanting to learn everything possible about steppers, I'd jump straight over building drivers and buy ready made drivers that accept step and direction inputs, plug and play. Geckodrive.com has great drives(G210 for example will drive a bipolar from 0 - 7 amps i think). Again, think bi-polar, 4amp rated motor is a good start, 36 volts supply, that is if you are wanting to move some weight.

    Post a better description of your needs and maybe you will get pointed a little closer to the mark. The Propeller is great for managing the step and direction outputs, but to get the proper code advice you need to indicate how things will be run.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-14 03:11
    Normally I would agree with ElectricAye's viewpoint, but, in this case, there's a worked (and tested) example for the use of a Propeller to control a stepper motor and it's just as easy to control two stepper motors as it is to control one, particularly on the Propeller. You just need two instances of the stepper motor control object (like: OBJ stepper[noparse][[/noparse] 2 ]: "StepperObject" or whatever its file is called).

    It's easy to use a TV monitor or VGA display and PS/2 keyboard to monitor and control the system
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-08-14 03:20
    Mike Green said...
    Normally I would agree with ElectricAye's viewpoint, but, in this case...

    Nicholas, I have to warn you that Mike Green is a genius and a guru. You could cut off his head and his marrow would still be able to solve more problems than I can even think about having. To him, looking down upon us common slob mortals from his Olympian heights, all this microprocessor stuff is mere child's play. So you'll have to take that into account when you weigh his venerable opinion.

    smile.gif
  • Nicholas01Nicholas01 Posts: 5
    edited 2009-08-14 03:29
    You guys are rad! I am going through the Nuts and Volts article Mike sent me right now, and I am going to see if I can make a motor work. Though ElectricAye has me wondering about the BS2. Question though, with the BS2, can I run two steppers in an XY axis and three servo motors in at least 2 pre-programmed sequences? Sequences will be selected by pushbutton control.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-08-14 04:07
    Nick, if you want to flash an led then by all means get a BS2, easy to learn, easy to use. Now if you want to run a couple of stepper motors and then decide to add three servos motors I think the "simple" BS2 will not be so simple or so easy. Yet with the Propeller it puts all this all on the same level, simple for one, simple for many, add VGA/TV, add a keyboard, still simple and way easier than any other approach.

    *Peter*
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-14 04:41
    ElectricAye,
    A genius I'm not. I've known geniuses and I can tell the difference. I have a lot of experience over many years and I read the manual (most of the time) and the datasheet (most of the time) and I still have a fairly good memory (for some stuff). I've gotten better at thinking before acting and listening to what others have to say, then having my own opinion while trying to respect theirs.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-08-14 04:53
    Mike Green said...
    ...A genius I'm not. ...

    Oh yeah Nick, and I forgot to tell you: he's modest, too. A rare, killer combo. skull.gif
  • Agent420Agent420 Posts: 439
    edited 2009-08-14 10:38
    TChapman said...
    With steppers, you can get as deep as you want with building your own drivers(PCBs that contain the power switching required to turn on and off the stepper coils, usually with transistors, Mosfets are commnon). You could spend a long time getting a home brewed driver dialed in, as you will quickly learn that current limiting will be a factor to deal with if you are using any motors that are doing any real work. Unless you are just wanting to learn everything possible about steppers, I'd jump straight over building drivers and buy ready made drivers that accept step and direction inputs, plug and play. Geckodrive.com has great drives(G210 for example will drive a bipolar from 0 - 7 amps i think). Again, think bi-polar, 4amp rated motor is a good start, 36 volts supply, that is if you are wanting to move some weight.
    I'm going to second this - while the Nuts & Volts article and some of the other referenced Prop stepper examples give a good introduction to stepper motors, if you are going to apply them to a serious task of performing work in an automated system such as controlling a sandblaster, you should strongly consider purchasing pre-assembled stepper driver modules.· The L293 ic used the the N&V article is too simplistic for that type of application.

    Going with driver modules will save you a lot of time and frustration and let you concentrate on the real task at hand -·automation logic and control.·
  • RaymanRayman Posts: 14,848
    edited 2009-08-14 12:14
    I've got some unipolar stepper motor code and info here:

    http://www.rayslogic.com/propeller/Programming/Programming.htm



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-08-14 12:54
    If you are serious about larger stepper motors you have to be running them in bipolar mode and under current control off a higher voltage. There are solutions around but I have my own and that also includes a new module that I should have ready soon. It's a very compact 1.8" x 0.8" module (no heatsink) that's designed to be plugged into my Propeller based MultiPLC and the module is designed to drive large bipolar steppers in different modes including microstepping. The 18milliohm output MOSFETs are rated up to 30V for 7.5A continuous each (which translates to higher peak currents). That means plenty of grunt and also fine control for large stepper motors plus the interface to it is simple SPI from the Prop. Microstepping not only allows fine positioning but also smooth acceleration and deceleration as it avoids those "nasty" full or even half-steps.

    I haven't played with large microstepping motors for quite a few years and I am really looking forward to controlling a whole bunch of them at the same time with the Prop and this module is the thing that will do it.

    Here's a screenshot of the proto pcb artwork that should be made up next week.

    *Peter*
    710 x 320 - 45K
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-08-14 13:53
    So I have a question: if Nick goes with a ready-made stepper motor driver, does he really need the Propeller? Couldn't he operate a ready-made with a Stamp? I think I used a Stamp many years ago to run a compumotor controller, Zeta 6104, or something like that. It sounds like he's sandblasting and not cutting sophisticated shapes, so I'm just wondering why he would need the sophistication of a Propeller if he were to use a ready-made driver? Furthermore, something like a Zeta 6104 allows you to program it so it can operate in stand-alone mode. I'm just concerned that Nick is a total newbie and might get lost before he even gets started. In my humble opinion the educational materials for the Propeller are not (yet) suited for pure, unsullied, innocent newbie encounters of the high amperage kind.

    another 2 cents worth,
    Mark

    smile.gif
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-08-14 22:21
    Hello Angelo,

    could you post a description of the precicision that you need ?

    if you just want to drive over an area driving from leftest to rightest make a small step forward then drive from rightest to leftest and repeat

    on a minor speed it will be possible to do that with some simple DC-motors with a gear.
    Depending on the precicision with or even without a decoder counting pulses which gives a feedback about the rotation of the motor-axle

    if the precicision and speed could or must be low it will be enough to use a DC-motor with a gear with a high ratio
    and to switch on / off the motor for half a second or any other short time required to move on for 1/10 inch or something like that.

    Then the hardware requirements would fall down from a stepper-motor-control to a simple H-bridge-circuit and a DC-motor

    If you would like to use LCD or a PC to display status-information and send commands to the control a basic stamp will suit this

    If you would like to create a stand-alone control with a VGA-monitor and PC-keyboard as userinterface WITHOUT a PC
    the propeller is the way to go. Nonetheless I have to say that developing this control you have to move up the learning curve
    for programming a microcontroller.

    If you want to do this not only to be more productive by using automation but also for learning programming or having fun
    on realising a project like this jump into the propeller-world

    If you just want to increase productivity:
    As your project seems to be a professional thing which will save a lot of money through the automation you should consider
    and compare between saving money by developing it yourself and start saving money months later after finishing learning programming
    or pay money for a professional programmer and start saving money in three weeks.

    So anyway please post a detailed description of what you want to to in the end for which reasons and what your programming-skills are

    best regards

    Stefan

    Post Edited (StefanL38) : 8/14/2009 10:36:15 PM GMT
  • CounterRotatingPropsCounterRotatingProps Posts: 1,132
    edited 2009-08-14 23:10
    Nicholas01 said...


    ... Question though, with the BS2, can I run two steppers in an XY axis and three servo motors in at least 2 pre-programmed sequences? Sequences will be selected by pushbutton control.
    Hi Nick,

    that much control for the BS2 alone is probably pushing the envelope.· The off-the-shelf stepper and servo controllers can often run just with push button control, without a microcontroller at all.· Boards from Peter Norberg are nice - and Parallax has some too (I *think*).

    It comes down to the overall complexity - or better said - to the *most* complex of the actions/sequences.· When you can do that one, all the others·should be easier.

    Echoing what the others here I have said, it seems like you might need a combination of controller board(s) and micro of some kind.· The micros can do certainly do these things without a controller board, but then you have to do the electronics that the board would have done for you.· Sometimes that's easier and cheaper, other times the effort the controller board saves you is worth it. Plus these make the micro have to work less - you can have it tell the controller - "go to here" - one command, one number, instead of having to have the controller do a lot more watching and tweeking with discrete electronics.·· (With·a yes nod too towards ElectricAye's suggestion of a programmable controller.)

    There are a lot of geniuses here (Yes - you ARE TOO Mike!! - And ElectricAye sure ain't no dummy :-P )·· And there are tons and tons of posts and people here working on robotics, which means a vast trove of knowledge on motors!· If you can't find the help here, there's probably no where else this cool.

    If you can describe the flow of work, we might be able to make more refined suggestions for you.

    cheers, and welcome to the forums!
    - Howard
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (CounterRotatingProps) : 8/14/2009 11:15:37 PM GMT
  • Nicholas01Nicholas01 Posts: 5
    edited 2009-08-15 00:53
    Thanks for all the feedback guys. I realize that I am jumping into deep water head first, but I like a challenge. I wish I got into electronics years ago, this is challenging, but very fun.

    So, here is what I want the machine to do:

    Machine manouvers a blast hose on an x-axis and y-axis
    Each axis will have 2 stepper motors
    Motors will have to run at a couple of different speeds

    2 servo motors will adjust angle of blast hose

    1 servo motor will operate the blast hose start trigger

    Pushbuttons will activate each pattern of blasting (minimum 4 patterns = 4 pushbuttons)

    Red strobe light while unit running


    OPERATION:
    1 Pushbutton 1 to start pattern 1
    2 Red strobe light turns on
    3 Servo motor activates blast hose start trigger
    4 20 second delay until axis motors start
    5 x-axis, y-axis, angle servo motors follow pre-programmed 20 min pattern
    6 Emergency Stop & Reset options available during run time
    7 Servo motor de-activates once pattern complete
    8 Red strobe light shuts off
    9 Pushbutton #2 to start pattern 2
    10 Repeat steps #2 to 8 (pattern is 20 min)...and so on

    The patterns are unique to each product & stage
    The pattern for each product & stage will not change

    The blast area is 1" wide, so 1/4 steps and 1/2 steps are not necessary, full steps are more than adequate.

    Thank you for your input
  • T ChapT Chap Posts: 4,223
    edited 2009-08-15 03:14
    Initial thoughts. I am assuming you are using some hobby type servos to do those jobs? I think you'll find that they are not robust enough for an industrial type application. You may look at steppers for the hose angle(use threaded rod to push things, with steppers you'll have a lot more torque with threaded rod. You can solonoids for the trigger(even a power car door lock, see alleletronics.com). You can fire the actuators via relays via mosfets from the Prop. A mosfet is in over simple terms a switch, an N type mosfet would bve typical to switch on a relay or DC actuator, where the mosfet conducted the ground path to the part, and the + side was hardwired to +V.

    http://forums.parallaxinc.com/www.allelectronics.com/index.php?&page=item&id=DLA-1&index=1

    If you are trying to automate a process, you can use limit switches and have the motors run in a direction on boot until they hit a switch, which 0's out the steps in the code.

    Don't bother with the typical L298 or similar stepper drivers, you'll only waste time and get frustrated. Buy real drivers, and higher amp steppers, US digital sells some 4 amp bipolarnema23's for around $60 each that are work horses. You can find cheaper but that is just an example. Don't bother with unipolar. At least from your description there are weight and forces involved, and I think you'll find 2 amp steppers a disappointment. You need 24 volts minimum, 36 is better and can be built with 3 parts: a 24volt transformer (4amps available at All), a bridge rectifier, a large cap, like a 2200 uF 50 or 100 Volt.

    You must have a stepper driver that allows you to set the current limiting based on the motors rating.

    Your code will have to include excel and decel. You can't just turn on a stepper full blast, you have to ramp up. Also, if you intend to track the pulses and not get out of whack, you'll need to decel as well, you can just run a stepper wide open and kill it, you'll lose pulses. The Propeller very easily accepts encoders to track a motors position if things are critical, but if you ramp up and down, and don't stall the motors, you'll stay in sync all day long.

    I posted a code somewhere down the thread that already moves steppers very well, you only need to send the method the parameters(position where you want it to go to). The code does everything else for you. If you have an interest I'll post the full program, which will be a good starting point to jump off from.

    The pushbuttons are easy, you'll need some pullup resistors, like a 10k to hold the input to the Prop up to 3v3, then the switch shorts the input to GND. A loop in the code is always asking If switch1 == 0 then dosomething, else keep checking.

    The first steps are to start learning the basics of Spin, never mind the Stamps. Get some leds blinking, then the steps and direction for the stepper drivers are next to try out. A loop of ON and OFF for the Step Pin is all that is required to move the stepper (if using an external driver). The time between the sequences (on and off) dictates the speed of the motor. A fixed pulse width to the stepper would be nice, the Propeller has timers that manage those things easily. See the code I posted recently that shows the use of the timer setting the pulse width.
  • LeonLeon Posts: 7,620
    edited 2009-08-15 03:32
    Industrial servos make a lot more sense than stepper motors in that sort of application.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-08-15 07:48
    about emergency-stops:

    emergency-stops should disconnect power on the most straight-forward hardwired way as possible
    to minimize faultsources and reduce maintaining. Of course you can add signaling the push of the emergencystop to the
    controller but you should NEVER realise an emergency-stop by detecting the pushed switch in software and switch power of by an IO-pin of the control

    depending on the torque that is "loaded" on the axle of the motor you can start the pulses at a certain frequency
    This is called driving the steppermotors in start/stop-mode

    So you don't have to start ramping at 1 Hz. It might be some hundred Hz or even 1000 Hz
    Can you specifiy the maximum speed needed in Millimeters/second ?

    If the speed is low a smaller steppermotor combined with a high ratio-gear MIGHT suit too

    As $60 for a suitable steppermotor is more than a few cents can you tell details about how the driving mechanism ?

    How much money would be OK to spend for the project
    (only an estimated value. Is 2x $60 already "how can I make it cheaper ?" or is spending $500 no problem ?)

    best regards

    Stefan
  • Nicholas01Nicholas01 Posts: 5
    edited 2009-08-15 14:13
    The steppers I have are rated for 361oz/in. I found a motor calculator somewhere on the web a while ago and added in some basic information of what I am moving, I bought a stronger motor than it recommended. The aluminum chassis will be driven with threaded redi-rod as suggested above. But I am planning on the moving unit to weigh between 50-75lbs and it will run on a flat plain. I don't really worry about spending the money, to get my system professionally automated I was given a starter price of $50,000.00. I am hoping to put this unit together for under $2500.00. So a hundred bucks here or there is still cheap in my eyes. I am comfortable with the mechanical side of the unit, I have a good background in gearing and chassis (grew up with race cars & I run a fabrication shop).

    Makes sense about the emergency stop cutting off the main power. My guess is my best option is to have the unit move towards a set of x & y axis limit switches to get zero'd out before it starts each pattern.
  • T ChapT Chap Posts: 4,223
    edited 2009-08-15 15:09
    For homing to a limit switch, pull the pin connected to the normally open switch high with a 10k res with gnd on one side of the switch. If the pin is showing gnd, then the switch is pressed there will be gnd on the pin. If the switch is open there is 3v3 on the pin. This way you findout really quick on boot whether you limit switch is working properly. On boot, check the pin. If high(3v3) then run at low speed towards the home switch. Runa loop looking for the pin to go to gnd. When the machine hits the switch and goes to gnd, reverse the motor direction and roll back off the switch. While rolling back loop code that looks for 3v3. Once the machince rolls back off the switch the the code resets your position variables to 0 (or where you want to park the position values). The run the normal code. If on boot, the home code detects gnd alreadu, it may either mean that the wires to the switch are damaged, the switch is damaged, or the machine has ran agaisnt the switches. So you can have code that first attempts to roll off the switch for some fixed amount of pulses/distance to try to correct itself. If it can correct and find 3v3, then great. Proceed as usually to the main code. If not then alert to the falut condition with a beep or led. Btw a cheap little piezo buzzer is a great way to get feedback when you don't have tv, lcd, etc. The code for the buzzer can set different beep patterns and frequencies on the buzzer that indicate status as needed. Very handy for a small price. See piezo object.

    As Stefan pointed out, I mispoke about ramping, as below a certain rpm/moad you can just set the speed. Only real world practice will show you if not ramping will work at the speeds you need, but the load on the system but be tested, not just the motor alone. Steppers have high torque at low speeds. Low torque at high speeds. DC motors have lower torque at low speeds, the reverse in general.

    Post Edited (TChapman) : 8/15/2009 3:21:16 PM GMT
  • he1957he1957 Posts: 58
    edited 2009-08-20 12:27
    Gidday Nicholas01,

    +++
    So, here is what I want the machine to do:

    Machine manouvers a blast hose on an x-axis and y-axis
    Each axis will have 2 stepper motors
    Motors will have to run at a couple of different speeds

    2 servo motors will adjust angle of blast hose

    1 servo motor will operate the blast hose start trigger
    +++

    This is essentially a 4 axis CNC configuration. For the triggering, a solenoid mechanism may suffice unless you need to be able to adjust the flow rate via the trigger, in which case this would be a 5 axis configuration. If you can get by with a 4 axis, there are several ready-made or kit versions of driver controls available these days. Have a look at www.cnckits.com.au - They also have a USA dealer. Their controller has 4 axes as well as two switchable outlets which could do what you've described. It is however, a stepper based system so I don't know if it can handle servo motors (which cost more and generally cause more damage when they or their controllers fail in some way).

    This controller - like most of the others connect via a standard PC style parallel port and use step/direction signals to control the motors. An inexpensive personal computer (PC) is generally used to connect to these controllers parallel ports but there is no reason why a Propeller could not do same - especially if you want "canned" sequences.

    The PC's ofter use either TurboCNC or Mach-3 (both inexpensive and very popular) as the controlling software to send the appropriate signals from the PC to the controller. G-Code (NC or Numerical Control) "language" is "understood" by these programs. G-Code can be written by hand or by using drawing software designed to generate same. An inexpensive program called "SimplyCAM" is an excellent such tool.

    If you've never seen G-code, it's basically a co-ordinate language that tells the mechatronics how to move from point to point, at what rate and how.

    Example: [noparse][[/noparse]Comments are either enclosed in () or begin with ;] - depending on whos software you use; alas, for a "standard" there are several choices wink.gif

    We set things like positioning to be absolute or relative from a current position, below assumes absolute (because Home would be co-ordinates 0,0,0 (for 3 axes)

    n0100 g28 ; Home all axis - eaxh axis will search for its's HOME sensor - often is seperate to a LIMIT sensor
    n0110 g00 x+100 y+100 ; Rapid X,Y to abs 100 (units can be millimeters or inches - be careful!)
    n0120 m03 ; Turn on spindle (or whatever is connected to this relay/switching device)
    n0130 m08 ; Turn on coolant (or whatever)
    n0140 z-10 f10 ; drop head 10 units at 10 units/minute
    n0150 g01 x50 y50 f25 ; move XY mechanism at 45 degrees back from current at 25 units/minute
    ...

    rapid means "as fast as you can"

    The programs such as Mach3 translate this into the required steps, rates or same and in the last line shown above as an interpolated move (ie both axes arrive at their destination concurrently - regardless of any differences in gearing of X and Y motor drive assemblies) The reference to 45 degrees assumes XY are same.

    For your project, you could:

    1. Seek for sensors to determine where the limits are
    2. Program for a specific number to steps between points
    3. Energise servos for a known time period (accelleration/ velocity etc)

    Of the above, the 1'st is less error prone. Steppers can be left bumping against an obstacle without damage, servos can't. But for options 2 and 3, lost position (caused maybe by binding) needs to be either detected or allowed for in some way.

    As mentioned, E-Stops are ESSENTIAL. Any such signals are connected as a "broken loop is fault" logic. This allows for broken wires which would otherwise go undetected.

    The Propeller is one very capable chip but I haven't yet seen anyone use it in such a controller (I intend to do so and this is one of my longer term projects - to build a large (3x4 metre router table). But for a quick start a cheap PC with a parallel port and a ready made controller is hard to beat.

    Because the Propeller does not need complex interrupt mechanisms and their inherent latencies and more error prone designs, I can dedicate a COG as an "interrupt/monitor" CPU - allocated to monitoring machine status with almost zero latency. Other COGs can be used to provide the motor driving and other signals indepenently.

    This was one of the major reasons I elected to start using it wink.gif


    Cheers,

    HarryE.
Sign In or Register to comment.