New To Electronics - Have Propeller and stepper motor - Now what?
Nicholas01
Posts: 5
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!
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
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.
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
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
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.
It's easy to use a TV monitor or VGA display and PS/2 keyboard to monitor and control the system
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.
*Peter*
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.
Oh yeah Nick, and I forgot to tell you: he's modest, too. A rare, killer combo.
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.·
http://www.rayslogic.com/propeller/Programming/Programming.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
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*
another 2 cents worth,
Mark
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
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
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
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.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
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
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.
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
+++
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
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
Cheers,
HarryE.