StepperDriveErz
idbruce
Posts: 6,197
Hello Everyone
Considering that a few people have recently shown an interest in one of my stepper drivers, I finally decided to alter some of them, provide much better documentation for all of them, and add them all to one file. I believe with a little studying, these drivers should be easy to understand, and will give the reader a nice overview of single ended NCO/PWM counters.
This is the most complete, concise, and comprehensive release of my work pertaining to stepper drivers. If you find any errors with these drivers, please let me know.
I hope they find a good home
Bruce
EDIT: Please refer to post #20
Considering that a few people have recently shown an interest in one of my stepper drivers, I finally decided to alter some of them, provide much better documentation for all of them, and add them all to one file. I believe with a little studying, these drivers should be easy to understand, and will give the reader a nice overview of single ended NCO/PWM counters.
This is the most complete, concise, and comprehensive release of my work pertaining to stepper drivers. If you find any errors with these drivers, please let me know.
I hope they find a good home
Bruce
EDIT: Please refer to post #20
Comments
I have decided to attempt to make this file pretty consistent with the Gold Standard Specification. I cannot say that I personally agree with the entire specification, so it will not meet the exact requirements, but it will be pretty darn close, and therefore I intend to submit it when it is finished.
So needless to say that there will be a new release, and the new release will contain:
- An MIT license
- A StepperDriveErz object
- A demonstration program utilizing the StepperDriveErz object
- More versatility
- Methods that utilize default settings
- Methods that can be sent customized parameters
- And better documentation
BruceLOL I have a wierd sense of humor, but to me that is funny. Old habits die hard and I have never been a person that conforms well to something that I do not fully accept.
I must say this file is now transforming into something completely different. With the exception of breaking a few rules of the specification, I am doing my very best to make these drivers easy to use and understand. In the past, it was not necessarilly beneficial for me to create an object file for my drivers, but now that I am creating an object file, I can foresee it becoming useful to myself and many others. Without getting into details, I can say that after setting certain default values, the object should be very easy to use without understanding a whole lot of detail.
I look forward to getting it done, because it is eating up a lot more time than I anticipated, however it should be a good thing to share with other Prop heads that use stepper motors.
Bruce
In it's current state, yes it is from stop to stop, however, perhaps it is possible to achieve, just as long as you never exceed max speed. In the file that I am preparing for the OBEX, there are now six stepper drivers instead of three. Three of the methods (functions) will use several default parameters, whereas the other three drivers will have the ability to send custom parameters.
Of course these drivers will have new names for the OBEX, but for the sake of discussion and to provide understanding, please refer to the RunDaStepperMotor function in the file above. Within this function, there are three REPEAT loops. By varying the CycleOffset parameter within the middle loop, you could effectively change speed. So let's say that when supplying the CycleOffset parameter to the method, you copy it into a global varible which can be altered, but this copied variable should be used in all three loops. Additionally, by altering the CycleOffset in the middle loop, you must also alter the RampingSteps for the final loop.
Bruce
After thinking about it a while longer, there are probably several solutions to this problem.
You could also use WAITCNT(Counter += CycleOffset -= RampIncDec) to increase speed and WAITCNT(Counter += CycleOffset += RampIncDec) to decrease speed.
Bruce
I would use the latter suggestion, because it would allow ramping to the desired speed
Bruce
EDIT: I am sure it could be done quite easily with the information provided.
Give me a little while and I might throw something together for you.
The attention to detail on the comments are much appreciated!
Great work!
Jim
Thanks Jim
You should see the file I am working on now. Definitely quite a bit more information. Each method contains a description of the parameters for the method, and I additionally went the extra mile to explain the purpose of each local variable.
Bruce
I have been bouncing the idea of a variable speed stepper driver around in my head for several hours now, and I believe I have a pretty clear vision of how to accomplish the task. Since I have a clear vision of the task and since I think it may be useful to a few people, I have decided to write one and include it with the other methods in the future StepperDriveErz object. It won't be long and I should have a solution for you. Instead of making it complicated for myself, I have decided to make speed changes according to pulses (steps) per second, as compared to something like RPM or RPS.
Bruce
I just discovered that I cannot find my future object file anywhere on my PC. It appears that I must have altered the original to make the variable stepper driver.
OOOOOPPPSS What a bummer.
Thanks so much for all of this work! I'm going to play with this tomorrow to see how it improves my current motor control. It looks like some nice enhancements have been made! Sorry for the late response - I thought I had notifications enabled in the previous thread, but clearly I did not!
You're welcome. It has always been my hope that this code would be useful to someone else besides myself. As for the enhancements, it is truly a shame that I altered my original file without saving it to another name, because THAT file was really looking good. Perhaps someday in the near future, I might reach deep within myself to redo all the work that I lost.
Bruce
How well do you think this would work with an automotive stepper motor solenoid?
I never heard of a stepper motor solenoid. However to give you a brief overview, this software driver should drive any normal stepper electronic driver that requires a pulse going to the "step" pin. This software driver is incapable of controlling the individual coils of a stepper motor.
Providing you have an electronic driver that requires a pulse to a step pin, you might be able to use it with some alterations and tailoring.
Bruce
But should not be to hard to add direct drive of dual h-bridges?
doing half-stepping is simple, and quarter or even micro stepping should be pretty easy to add too.
Look at my spin demo code.
http://forums.parallax.com/showthread.php?138695-Now-Available-QuadStepper-board-for-QuickStart&p=1083078&viewfull=1#post1083078
I just found my original file. YIPPEE.
I have attached it below for safe keeping, however I am unsure where I stopped on this file and I don't have time to review it now. This file contains quite a bit more information, because I was attempting to make it "Mostly Golden".
Considering it is not finished, it may take some exploration to determine what is going on and where I stopped.
Bruce
EDIT: Please refer to post #20
I will need to go back over this file with a fine tooth comb to resolve all the uncertainty and errors.
Anyhow, I just found out how bad of shape this file was in, after copying some code for another driver. I cannot say how fast this file will be repaired, but I will repair and finish this. This file is no where near the state I last left it and it was definitely in much better shape the last time I worked on it.
My sincerest apologies to anyone who downloaded this file and wasted time on it.