Stepper Motor Configuration w/ Driver That is not EasyDriver
- This topic has 6 replies, 2 voices, and was last updated 9 years, 9 months ago by soundanalogous.
-
AuthorPosts
-
June 1, 2013 at 2:23 PM #891blzalewskiParticipant
First off: Thanks you for this software.
Is it possible to set up breakout’s stepper to work with something besides a easydriver?
I’m experiencing A LOT of trouble getting Pololu’s DRV8825 (high current model) to work. The stepper turns a full revolution fine (400 steps) but when I do 100 steps 4 times it misses a few steps. Also, when I turn on the acceleration/deceleration it barely works until I change T1_FREQ to the value in the ATMEL example code.
What I’ve tried that works somewhat: (1) Modifying #define T1_FREQ, (2) Modifying the delay between digital HIGH and digital LOW in the Stepper function.
Any ideas on how to properly configure the stepper for different drivers?
Note: Pololu DRV8825 Timing Information (on page 7): http://www.pololu.com/file/download/drv8825.pdf?file_id=0J590
and my stepper has 400 steps per rev
- This topic was modified 9 years, 10 months ago by blzalewski.
- This topic was modified 9 years, 10 months ago by blzalewski.
June 1, 2013 at 4:32 PM #895soundanalogousMemberI only have an EasyDriver, a SN754410NE H-bridge and a L293D H-bridge. I have not tested any other drivers. However if the Pololu uses the same step + direction interface as the EasyDriver then I find it strange that it is not working unless the Pololu driver has specific timing requirements.
Are you trying to run the stepper_easydriver.html example? If so have you updated the stepsPerRev variable on line 128 to 400?
Are you taking microsteps into account? You need to multiply the number steps by the number of microsteps.
I’ve noticed that speeds over 25 rad/sec won’t work with certain motors so start with a low speed.
If the issue is timing then the only thing that will work is to add additional configuration parameters to the Firmata stepper protocol to support various delay requirements. This will require an update to Firmata and Breakout. Pull requests are welcome if you are sure that is the cause of the issue. We can discuss the details of the protocol if you want to pursue that direction.
June 1, 2013 at 6:42 PM #896blzalewskiParticipantThanks Soundanalogous.
Well, right now I plan to test a L293 with my motor… the problem might be because the driver I’m using has a minimum power supply voltage of 8V and my motor is rated for 3V. I started another thread on the Arduino forum too: http://forum.arduino.cc/index.php?topic=169583.0
I have changed all the variables and whatnot… I’ve even looked through all the code on FirmataStepper.cpp/FirmattaStepper.h/AdvancedFirmata… and went through the sample code in the .zip link on the .h/.cpp files. I just can’t figure out why it’s wrong.
I think it’s probably a timing issue because I know for a fact that I do have to change the 1 microsecond delay used for the EasyDriver to 2 microseconds as per the the spec sheet on the Pololu 8825 driver. I attached screenshots of the timing requirements for both the pololu driver and easydriver.
After I change the delay to 2, the driver works fine at constant speed (no accel/decel). I ran it at 477.5RPM speed and went 477.5 revolutions (400 * 477.5). I found the time by attaching this bit of javascript to record the start time under the start button action for the driver:
start = Date.now();
Then I attached the following bit of code to onStepperComplete():
end = Date.now();
alert(end-start)
Based on my calculations, it took the driver 2.17 minutes to do what should have been accomplished in 1 minute. The stepper didn’t miss any steps.
To make it easier for this “debug” I have attached the timing sections for both the easy driver and the pololu driver.
http://thebestsites.com/wp-content/uploads/drv8825timing.jpg
http://thebestsites.com/wp-content/uploads/easydrivertiming.jpg
Any ideas on how to proceed? I’d like to add the additional configuration parameters but I’m not sure what a pull request is?
June 2, 2013 at 4:13 PM #898soundanalogousMemberI could increasing the delay to 2 microseconds since the easydriver requires a minimum delay of 1 microsecond and then adjust the frequency value to to to get the rpm right. Let me know if you find a configuration (step delay and frequency value) for the Pololu driver that works. I can then test if that configuration also works for the EasyDriver.
June 3, 2013 at 6:02 PM #900blzalewskiParticipantGot it. Increasing the microseconds to 2 -AND- microsteps of 4. Not planning on testing other microstep options but when I did 32 microsteps it would take on one speed during the acceleration ramp and the deceleration ramp and assume another, higher speed when it was on running speed.
June 3, 2013 at 6:10 PM #901blzalewskiParticipantMaybe we and by we I mean (BreakoutJS) can figure out the best delay we can use?
I’m thinking my 400 step 32 microstep couldn’t handle all the acceleration/deceleration ramp calculations.
June 3, 2013 at 10:12 PM #902soundanalogousMember32 microsteps is likely more than the Firmata Stepper implementation to handle. The biggest challenge in creating a Stepper implementation for Firmata was that StandardFirmata uses all of the timers of an Arduino Uno (or similar). I had to compare times in a loop in order to do the stepping, which is less than desirable. It works, but it’s not precise. There may be a work-around with the new ConfigurableFirmata in that you could free up a timer for the Stepper implementation as long as no other features are enabled that would need to make use of the same timer.
For other Arduino boards that have additional timers this should not be an issue (as long as a timer-based Stepper solution is provided). I won’t likely have time to get to something like this for a while though.
-
AuthorPosts
- The forum ‘Forum’ is closed to new topics and replies.