Hi Bob
First thanks for this thread. Ok so I got all the parts put everything together the lcd display works, keypad works able to scroll and enter degrees etc and direction but nothing happening on the step output it flashes moving for a split second put scope on direction it changes state but no step pulses.
Ive tried 2 Arduino boards still nothing also reloaded program several times. Any ideas
Figured it out wont work if you put 400 steps per rotation for some reason
I'm not really familiar with this software or your hardware but most stepper motors are 200 steps per rev. If you set the software up to be 400 steps, that could be double the speed which might be more than the stepper can handle (most of them peak out at about 400-450 rpm). After this point, they do nothing (except maybe make some high frequency noise)
Installed the sketch that tjwal modified and everything works perfectly I have a 90 to 1 table so the calculations would not work with original sketch set to 400 steps. Im an old guy learning new things. Thank you
Did 400 steps work with my version?
Cheers
John
ToMove=(bob/360) * Multiplier + 0.5 - cumSteps;
ToMove=(long) ((bob/360.0) * (float) Multiplier + 0.5 - cumSteps);
I had a look at the code. there are a number of undefined type conversion which could catch you out. eg as one example
Code:ToMove=(bob/360) * Multiplier + 0.5 - cumSteps;
Should be more like
Code:ToMove=(long) ((bob/360.0) * (float) Multiplier + 0.5 - cumSteps);
If the compiler sees 360 it will probably think its a long or int but if its 360.0, it knows its a float as it has a decimal point. Also you are doing float maths but assigning the result to a long at the end plus Multiplier is a long used in a float formula. You must program defensively. I've been caught so many times with odd results due to incorrect type conversions.
Probably Multiplier should be defined as a float as thats how it is used.
In some languages, type conversion is automatic but in C it isn't. Don't depend on the compiler to do it for you. It might not get it right every time. Treat every compiler warning as if its a bug and eliminate it.
Just want to thank you for an awesome write-up. I've been wanting to learn more about stepper motors, and I am also interested in building an indexer, so your post hit every target.
I'm not using pololu drivers, I'm using the stepper driver based on the Toshiba TB6560 chip.
The data sheet says voltages above 24 volt isn't recommended.
The ATX would give me 24 volts across the +12 and -12 volt rails, unless I can't do that with an ATX power supply.
Enter your email address to join: