PDA

View Full Version : stepper motor control?



Bill Henning
12-10-2009, 10:30 AM
I just went through the motor control section of obex (http://obex.parallax.com/objects/category/7/?page=1) and found four pages of great stuff... but none of them appear to be for controlling stepper motors!

Does anyone know of any stepper motor software in Obex?

If not, I guess I will have to write one.

Thanks!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus (http://mikronauts.com/products/morpheus/)dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus (http://mikronauts.com/products/propteus/) and Proteus (http://mikronauts.com/products/propteus/) for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz (http://mikronauts.com/products/mikronauts-625mhz-crystal/)
Las (http://mikronauts.com/software-products/largos/) - Large model assembler for the Propeller Largos (http://mikronauts.com/software-products/largos/) - a feature full nano operating system for the Propeller

Kye
12-10-2009, 10:46 AM
Wait, I'll write one... I can get to that on Saturday.

I've been trying to exapnd my collection of motor objects.

... Would you like position in steps and steps/second control?

I'll also make it support two motors at onceиlike the rest of my dual drivers. (Is 4 windings good? 1 pin for each?) X2 for dual stepper motors.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Post Edited (Kye) : 12/10/2009 2:52:43 AM GMT

hover1
12-10-2009, 11:08 AM
Bill,

Johnny Mac wrote one in a Nut and Volts article. I can't put my hand on it right now, but it was called "Stepping Out With Spin"

Jim


Bill Henning said...
I just went through the motor control section of obex (http://obex.parallax.com/objects/category/7/?page=1) and found four pages of great stuff... but none of them appear to be for controlling stepper motors!

Does anyone know of any stepper motor software in Obex?

If not, I guess I will have to write one.

Thanks!

w8an
12-10-2009, 11:25 AM
Here's some info to get you started..
http://forums.parallax.com/showthread.php?p=839549

Bill Henning
12-10-2009, 11:32 AM
Kye:

Thank you! That would be perfect. I need to control two steppers (X & Y direction), and while all I really need is N steps forward/reverse, N steps FWD/REV in T seconds would be very nice too!

hover1:

Thanks, will look for it...

w8an:

Thank you for the link!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus (http://mikronauts.com/products/morpheus/)dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus (http://mikronauts.com/products/propteus/) and Proteus (http://mikronauts.com/products/propteus/) for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz (http://mikronauts.com/products/mikronauts-625mhz-crystal/)
Las (http://mikronauts.com/software-products/largos/) - Large model assembler for the Propeller Largos (http://mikronauts.com/software-products/largos/) - a feature full nano operating system for the Propeller

Bob Lawrence (VE1RLL)
12-10-2009, 11:39 AM
hover1 said...
Bill,

Johnny Mac wrote one in a Nut and Volts article. I can't put my hand on it right now, but it was called "Stepping Out With Spin"

Jim



Try here:
www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol7/col/NV136.pdf (http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol7/col/NV136.pdf)

Ken Gracey
12-10-2009, 11:57 AM
Hey Kye, Bill,

A useful stepper object would be able to do half-steps and micro-stepping for CNC applications. I've got this old ShopBot-thingie in the garage (my short video is at http://www.youtube.com/watch?v=0NYyiHhnCV8) and it's not worth it's power consumption in full-step mode (0.015" steps) because it's a direct-drive gear/pinion setup. So, FlashCut CNC (and Gecko drives) offer some drivers that support microstepping. This increases my accuracy by using 1/10th steps (and 0.003" resolution). This particular machine was found locally on CraigsList for a song and a dance, but it does well with my robot bases.

Braking and ramping are other characteristics I'd like to see in a completely function stepper post on OBEX.

Sure appreciate your efforts.

Sincerely,

Ken Gracey
Parallax Inc.

Bill Henning
12-10-2009, 12:32 PM
Thanks Bob!

Hey Ken... for the time being, I'd rather use someone else's stepper object, that way I'd have more time for PropellerBasic http://forums.parallax.com/images/smilies/smile.gif

I agree about half-steps and micro-stepping... I have started acquiring parts to make a small CNC with an 18"x18" work area, for milling out robot parts, Morpheus case face plates, I/O panels etc.

If I got it to do 3mil resolution, maybe even milling some of my own prototype PCB's, shortening my new board development cycle... so I may end up doing micro-stepping later.

Best Regards,

Bill

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus (http://mikronauts.com/products/morpheus/)dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus (http://mikronauts.com/products/propteus/) and Proteus (http://mikronauts.com/products/propteus/) for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz (http://mikronauts.com/products/mikronauts-625mhz-crystal/)
Las (http://mikronauts.com/software-products/largos/) - Large model assembler for the Propeller Largos (http://mikronauts.com/software-products/largos/) - a feature full nano operating system for the Propeller

photomankc
12-10-2009, 12:35 PM
If you guys beat me to it (likely) I'd love to see what comes of it.и I'm looking to drive three of these:

http://www.allegromicro.com/en/Products/Part_Numbers/97060/

It takes care of chopping and microstepping based on digital input and can drive up to three amps.и My application will be a three axis CNC controller/driver that would be capable of acting as a stand-alone power drive with poor-man's digital readout or as a slave to a PC running CNC software.и I'd really love to be able to add an SD card and run the G-Code straight from that but that would be way down the road.и As soon as I get the ability to make my own PCBs I plan to start on this.

hover1
12-10-2009, 12:44 PM
Thanks Bob,

I normally can put my finger on that stuff pretty quick, but I am in the middle of packing to do a 4 day install in Wausau, WI. Forcast next 4 days: average 0 degrees F. Hey, where's the global warming?


Bob Lawrence (VE1RLL) said...

hover1 said...
Bill,

Johnny Mac wrote one in a Nut and Volts article. I can't put my hand on it right now, but it was called "Stepping Out With Spin"

Jim



Try here:
www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol7/col/NV136.pdf (http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol7/col/NV136.pdf)

Kye
12-10-2009, 12:46 PM
With all the stuff you guys are asking for and all the various stepper motors out there... well I'll have to retract the implication that I'll get a nice driver out soon.

I'll be going home for about a month during the holidays and I will not have acess to any stepper motors/powersupplies/etc. I don't believe I can finish the driver in a day so don't hold your breadth for me.

The good news however is that I plan to finish the full FAT32/FAT16 file system driver I was working on over the holidays. I'm finishing up finals week at school right now so my time is not my own.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Ken Gracey
12-10-2009, 01:08 PM
Nah, Kye. You could start simple and add functionality as time is available. We need ya! It looks like for any given object, usually one of them reigns as King on OBEX after a while. Such popular objects are ultimately very functional and often simple at the same time.

@Bill, If I were your manager, I'd also tell you to stick to the BASIC compiler.

Ken Gracey

photomankc
12-10-2009, 01:25 PM
I agree. A very basic driver that took step commands and could do half and and full step would be nice. Johnny Mac's code looked pretty easy to build off of.

Kye
12-10-2009, 01:36 PM
@Ken - Thanks,

So, I guess I can make multiple versions of the same driver for each different type of stepper motor. I think high level position and speed control will be enough for now at the lowest level.

Ramping and such may be put at a higher level.

... After a bit of research I looked into microstepping and its pretty much just a form of half stepping were you vary the current of each of the two coils your half stepping with to get a very fine accuracy.

This can be done using pwm. Now, I'm not sure if there is any point of varying the current based on sine waveforms or just ramping the current of one coil up while ramping the current of the other coil down in operation. Both methods seem plausible to me.

To make it a dual driver using one cog I'll have to write it in asm which I'd rather not do. But to do microstepping you'll need two channels of pwm per motor. Would be easier in spin.

Maybe I'll make a single motor per cog driver first.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Kye
12-10-2009, 01:44 PM
I'm thinking a unipolar and bipolar version. I'll do unipolar first with half stepping.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Bill Henning
12-10-2009, 02:12 PM
Except for spending some time on a couple of consulting gigs that have to get out the door ASAP I am spending my dev time on PropellerBasic :)


Ken Gracey (Parallax) said...

@Bill, If I were your manager, I'd also tell you to stick to the BASIC compiler.

Ken Gracey

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus (http://mikronauts.com/products/morpheus/)dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus (http://mikronauts.com/products/propteus/) and Proteus (http://mikronauts.com/products/propteus/) for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz (http://mikronauts.com/products/mikronauts-625mhz-crystal/)
Las (http://mikronauts.com/software-products/largos/) - Large model assembler for the Propeller Largos (http://mikronauts.com/software-products/largos/) - a feature full nano operating system for the Propeller

Beau Schwabe
12-10-2009, 02:19 PM
Just tossing in an idea...

How about current management? Typically with steppers, or any motor for that matter, you lose torque as the motor speeds up. If you regulate the current so that it remains constant, you can maintain constant torque, and thus higher current at higher speeds. To do this you need a boost regulator of some kind to increase the voltage the stepper sees at higher speeds verses the lower voltage it would see at lower speeds. I realize that this sort of thing is usually done at higher level applications and requires a fair amount of external hardware support for the DC-Dc conversion and the Stepper motor voltage regulation. But if an object were written equipped to manage the current based on speed and/or a feedback loop from the motor, it would be a nice little object addition.

I have done this with standard DC motors with very good results, the same technique could be applied to steppers.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

StefanL38
12-10-2009, 03:27 PM
I'm not familiar with the details of steppermotor-chopper circuits.
But as there is done choppering at all to limit the current
I would think this is just a matter of changing the on/off-ratio of the pwm signal that choppers the current.

Second thought. If the current is limitted through choppering by measuring the (averaged) current this should
include ALL effects. So it should include the effect of the increasing - hm don't know the word -
"the voltage generated through the moving of the magnetfield "through" the coils which lowers down the supplied voltage
as the generated voltage has opposite polarity."

So this should allow to go always to the current limit the steppermotor can stand without OVER-heating.
In the company I worked 3 years ago they used a lot high torque steppermotors 85V 3A. They drove them
with a current, that they warmed up pretty much (55░C)

best regards

Stefan

mikediv
12-11-2009, 01:00 AM
There were some posts months ago some of the guys were trying to help me and a few others get somethimg working on the prop to be honest I ended up just buying a cheap stepper board and controling it with the prop . I would love to see a driver for using the prop chip by itself
I bet it would be a very big hit with everyone

Graham Stabler
12-11-2009, 01:33 AM
You could say that there are three elements to stepper motors in typical CNC type scenarios:

1. The driver, creates the waveforms the motor requires from simple step and direction pulses
2. The motion control part. Creates pulse streams to provide the required motion profile, typically trapezoidal velocity profiles.
3. G-code interpreter or overall program issues motion commands.

1. If you buy a commercial stepper motor driver (or build one based on relevant chips) then that will cover you for 1. Or you could create a stepper driver object to do that with appropriate hardware, hopefully it would support micro-stepping and do the current limiting side of things etc. I would rather buy something to do this as the pros do the power electronics better than me.

2. Then you have the motion profile side of things and that should be a separate object as well with distance travelled (in steps), acceleration and maximum velocity as inputs. Two axis interpolation at least is required ideally.

3. This could be a separate object (g-code interpreter) but in many applications this would be your main program.

So basically don't try and do an object that does it all, divide and conquer.

Graham

Beau Schwabe
12-11-2009, 01:49 AM
Graham Stabler,

Yes, I agree, divide and conquer in small steps (no pun)


As far as power management is concerned, my days in motion control for prosthetic robotics is coming out...


StefanL38,

"I'm not familiar with the details of steppermotor-chopper circuits.
But as there is done choppering at all to limit the current
I would think this is just a matter of changing the on/off-ratio of the pwm signal that choppers the current."


This works if your supply voltage/current is rated at least 4 times the requirement for the Stepper, but often, and I think this is a misconception with stepper motors, the supply voltage/current is rated at the same requirement of the Stepper. This causes the stepper to operate ok but it's not as efficient as it could be with the power supply and you start to have problems at higher speeds.


Think of it this way...

In full step mode, each coil to the stepper only "sees" 1/4th of the total available power.
0001 , 0010 , 0100 , 1000

Alternative full step mode, each coil to the stepper only "sees" 1/2th of the total available power.
0011 , 0110 , 1100 , 1001


In half step mode, each coil to the stepper only "sees" 3/8th of the total available power.
0001 , 0011 , 0010 , 0110 , 0100 , 1100 , 1000 , 1001

...even if you alter the speed of the sequence, you still have the same power ratio. So two things you could do.

1) Start out with a supply 4 times the stepper requirement.
2) Add a DC-DC converter that effectively multiplies your voltage by a factor of 4 and that can maintain the required current drive of the stepper.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Post Edited (Beau Schwabe (Parallax)) : 12/10/2009 6:20:59 PM GMT

Graham Stabler
12-11-2009, 02:54 AM
Beau,

Mariss from Geckodrive suggests you can pretty much go all the way up to 20X the stepper's rated voltage assuming current limiting is in place to allow high speed operation, 20X is pretty high, I typically have used something more like 6 times. That would generally be done with just a single power supply, no level changing for different speeds, not as efficient but it does work.

Graham

Kye
12-11-2009, 03:01 AM
I think I can get an object easily done in spin that will use two channels of pwm to half step and microstep.

I'll put the number of microsteps you want in the constants section of the code and the driver will just use a sin/cos lookup rountine to decrease the duty cycle of one coil while increasing the duty cycle of the other smoothly.

The microsteps number will control how many sin/cos steps it does then between each step. Shouldn't require much more than a few lines of code. However, I'm only going to test my driver on the oscilliscope since I don't have time to make the necessary driver stuff. I'll post my code on saturday, then everyone can test.

Thanks,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Bill Henning
12-11-2009, 07:02 AM
Here is a simple full-step driver I cooked up based on the information in the
http://forums.parallax.com/forums/default.aspx?f=25&p=1&m=384380
thread and my data sheets.

It's not fancy, it's not super fast, but it works well enough for my current app.

Note: it does not do half or micro steps! I tried to do half steps, but my test motor did not like it - I was probably doing something wrong.




' delay is in 100us increments
' steps is number of steps to take - on an 18' stepper, 20 steps is one rotation
' dir is 1 or -1, for direction
' E=enable, AB=inputs for winding1, CD=inputs for winding2, bipolar stepper motor
' DCE BAE
' DC BA
' adapted from StefanL38's post

Pub FullStepMotor(delay,steps,dir)|Phase,count
' array should be made global and initialized, or stuffed into a rotating long
Phase[ 0 ] := %100_000_0
Phase[ 1 ] := %010_000_0
Phase[ 2 ] := %000_100_0
Phase[ 3 ] := %000_010_0

DirA := %110_110_0
count := 0
repeat steps
outa := Phase[(count+=dir)&3]
waitcnt(cnt + delay*8_000)
outa := 0


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus (http://mikronauts.com/products/morpheus/)dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus (http://mikronauts.com/products/propteus/) and Proteus (http://mikronauts.com/products/propteus/) for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz (http://mikronauts.com/products/mikronauts-625mhz-crystal/)
Las (http://mikronauts.com/software-products/largos/) - Large model assembler for the Propeller Largos (http://mikronauts.com/software-products/largos/) - a feature full nano operating system for the Propeller

KenBash
12-11-2009, 07:51 AM
Hey everyone... I'm running a 5 axis machine with the propeller right now. You feed it a go command and it drives all 5 axis from where it is, to where you want to be. I'm only doing step and direction but it's not a big deal to do a phase lookup using the direction flag for 4 transistor phase control. ( however, 5 motors would tie up a full 20 pins, with limit inputs, that's 25 pins, it starts to crowd the I/O but might be OK as a dedicated controller with a second prop feeding it the positioning data.


adding pulse width modulation to the outputs might let you do micro-stepping as well, but I haven't had the need to try to code it. I don't have ramping, but I do have speed control.

I'd have to clean up my code a bit to post it, but if you think it would make a worthwhile object I'll put it out here.

I have 4 axis code for the SX-48 that does have ramp control as well. ( full or half phase stepping ) You send it the XYZ coordinates in a 19.2K data packet and it drives to the correct position: Ramp up-ramp down or ramp up, run, ramp down.

It was an amazing accomplishment for me at the time. I tried to interest Parallax in it as a product, but they weren't interested.

The Propeller has enough horsepower that I'm getting reasonable 5 axis performance in SPIN. I haven't gotten good enough at pasm to feel comfortable re-writing it in assembly, but it should be pretty straight-forward if someone wants to take the ball and run with it.

K.B.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
" Anything worth doing... is worth overdoing. "

иииииииииииииииииииииииииииииииииииииииииииииии ( R.A.H. )
ииииииииииииииииииииииииииииииииииии

Bergamot
12-12-2009, 05:49 AM
photomankc said...
If you guys beat me to it (likely) I'd love to see what comes of it. I'm looking to drive three of these:

http://www.allegromicro.com/en/Products/Part_Numbers/97060/

It takes care of chopping and microstepping based on digital input and can drive up to three amps. My application will be a three axis CNC controller/driver that would be capable of acting as a stand-alone power drive with poor-man's digital readout or as a slave to a PC running CNC software. I'd really love to be able to add an SD card and run the G-Code straight from that but that would be way down the road. As soon as I get the ability to make my own PCBs I plan to start on this.

I've actually started work on a simple SD card G-Code interpreter in Spin, is this something that people would be interested in? I don't intend to support all of the exotic commands that rarely show up in CAM output, but basic line drawing shouldn't be too hard

Graham Stabler
12-12-2009, 09:35 AM
Ken,

Sounds good Ken, does it do interpolated moves too? If so between how many axes, sounds really neat.

I also have an stepper object that produces step and direction pulses but it only runs one axis at a time (or multiple axes but not synchronised), it is written in assembly and does trapizoidal motion profiles. It uses the exact same motion control technique as the G-rex by geckodrive, the counters are used in NCO mode and updated at regular intervals, the intergral of the frequencies is proportional to distance etc. It is possible to do coordinated moves I just have not got "a round toit" yet. That is why it has not been released as yet. Might be another Christmas project.

Cheers,

Graham

Kye
12-12-2009, 09:46 AM
Maybe you should post then Graham. I'm more interested in working on FAT code.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Kye
12-13-2009, 12:06 AM
Okay, Well since bill has something to use I'll put off developement on this until next year. I have a bit of other stuff to do today.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Bill Henning
12-13-2009, 01:03 AM
Thanks Kye!

I am looking forward to your stepper control object.


Kye said...
Okay, Well since bill has something to use I'll put off developement on this until next year. I have a bit of other stuff to do today.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus (http://mikronauts.com/products/morpheus/)dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus (http://mikronauts.com/products/propteus/) and Proteus (http://mikronauts.com/products/propteus/) for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz (http://mikronauts.com/products/mikronauts-625mhz-crystal/)
Las (http://mikronauts.com/software-products/largos/) - Large model assembler for the Propeller Largos (http://mikronauts.com/software-products/largos/) - a feature full nano operating system for the Propeller

Kye
12-13-2009, 02:32 AM
Thanks for giving me a bit of time. I'll give it all the quality of my other current motor driver objects.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

neoteric
12-13-2009, 09:00 AM
Bergamot,
I would find a simple Gcode program very helpful in some projects I have been working with.

grouchy
12-13-2009, 12:55 PM
Bergamot,
I'd like to see this too





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Rudy's CNC Freewareии http://www.enter.net/~schleinkofer

KenBash
12-14-2009, 10:50 PM
I've attached my 5 Axis code. I took some time to clean off the unnecessary stuff. I haven't run this on a machine yet, but it should work.

Yes Graham, it is interpolative , 5 axis motion.


If this looks like a good object for the exchange, I'll post it there.

Ken

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
" Anything worth doing... is worth overdoing. "

иииииииииииииииииииииииииииииииииииииииииииииии ( R.A.H. )
ииииииииииииииииииииииииииииииииииии

T Chap
12-14-2009, 11:16 PM
Here are some files Mike Green put together some years ago that were for 3 axis, 1, 1/2, 1/4, 1/16 CNC control. Some variations included encoder use where the output steps were compared with encoder count, and would stop the machine if the steps were not accurate within X steps. I used these for years until I finally replaced the controller all together. Honestly, I do not recall what was the final set of files that made up the working system, most of Mikes work is very documented though, and may help out with what you guys are doing.

As far as ramping as Ken mentioned, that is a complex issue on CNC's. For other situations where ramping/decel is required on single or multi axis projects that wouldn't really require all moves to be precisely sync'd, I have some Spin code that works well for multi axis operation that I use on my pick and place, so that the moves are all ramped and decel'd with no regard for perfect sync. So, on cutting parts it would not work. If there is an interest I can post it separate.

Also, I can't recall if these were for driving a stepper driver IC (step/Dir only), or if they drove prop pins for bipolar sequencing.


I just grabbed a bunch of files and through in a zip, you would have to sort through these to make sense of it.

Post Edited (Todd Chapman) : 12/14/2009 3:24:42 PM GMT

JonnyMac
12-15-2009, 03:05 AM
I was working on a PASM driver for a stepper motor over the weekend and considered adding acceleration and deceleration modes -- is this a desirable feature?

Graham Stabler
12-15-2009, 03:20 AM
Jonny,

It all depends what you want to do but for CNC or applications where you want high performance acceleration and deceleration are very desirable. The speeds you can achieve from stand still are much lower than those you can reach after smooth acceleration. Also stopping dead from high speed might mean lost steps and heavy loads (like a router gantry) will not appreciate it mechanically.

Cheers,

Graham

photomankc
12-15-2009, 03:52 AM
Doesn't the CNC software generally take care of ramping up and down? I can see that as an issue for a stand-alone system but a PC controlled system would have accel/decel in the output already I would think.

Graham Stabler
12-15-2009, 04:26 AM
This is the issue I was trying to highlight a "stepper motor object" can mean a lot of things. I always use commercial drives, I use the propeller for stand alone pulse generation, those talking about g-code interpretation do too.

Graham