Mechanical Engineering Senior Design Project HUGE PROBLEM / URGENT
MedDispenser
Posts: 8
Ok we made a medication dispensing system for our senior design project. We are not electrical engineers we are mechanical engineers. We are using a 7.5 degree stepper motor. When I rotate the motor using half steps 3 times then pausing it works fine. That would be the half step program I have attached. If I try to just take that program and do 3 half steps without looping it, it seems to not work at all or rarely.
Now for the even bigger problem. I need to make 3 half steps on command. I am doing this from the final program file I attached. It's not working. I have a makeshift clock to skip using a crystal. It's supposed to activate the motor after a button is pressed.
Problem 1) After the button is pressed the hours on the clock jumps to 3!! I don't see where the glitch is
Problem 2) I need to make 3 half steps of the motor
I really would appreciate any help I thought we had this figured out. I need to have this ready to present to a board of executives so soon its not even funny. If you could post here, e-mail Warren.Halbig@gmail.com or send me a message and you can call if your that willing to help. I really greatly appreciate any help. Thank you!
Warren
Now for the even bigger problem. I need to make 3 half steps on command. I am doing this from the final program file I attached. It's not working. I have a makeshift clock to skip using a crystal. It's supposed to activate the motor after a button is pressed.
Problem 1) After the button is pressed the hours on the clock jumps to 3!! I don't see where the glitch is
Problem 2) I need to make 3 half steps of the motor
I really would appreciate any help I thought we had this figured out. I need to have this ready to present to a board of executives so soon its not even funny. If you could post here, e-mail Warren.Halbig@gmail.com or send me a message and you can call if your that willing to help. I really greatly appreciate any help. Thank you!
Warren
Comments
Next -- it looks like you've lost the {$PBASIC 2.5} directive in the transition between the two programs.
And what's with those "B0" through "B8" variables?· Isn't it more usual, (and safer) to declare variables?·
As it is, it looks like B0 and B1 are being 'stepped on' by some of your other variables.
Also -- how does your stepper motor get its position initially set?· You don't set your "stpIdx" or "stpIdx2" values initially -- so I'd assume they were zero, but what if that doesn't match where your stepper is in its movement?
Post Edited (allanlane5) : 4/22/2006 9:16:51 PM GMT
Good Luck
How would I set this in the initial program? Just make them zero?
However, it would probably help if that's where the stepper motors are -- position zero.
So you may want to insure you either leave the stepper motors AT position zero when you shutdown your program, or that you have some routine to synchronize the position of the steppers with your indexes -- like rocking the steppers forward and back, or something.
I am going to take a look at the stepping problem now. Thanks so far!
The stepping doesn't seem right and some times it just twitches and doesn't really move and then others its fine
Heres the new program