![]() I don't know why it appears not to be working as stated in the documentation. So it's not coordinating arrival time with the other two.ĭo you mean that the time taken for 8000 steps is the same as it was for 100 steps, or do you mean that the 8000 steps take 80 times as long as the 100 steps? It arrives at its destination at a predetermined speed (not my intent). The stepper controlled by position was unaffected. ![]() ![]() I increased and decreased the values of position and position to see how it responded. tCurrentPosition(0) //Sets position of stepper to zero. Positions = 16000 //As rope wraps around bundle this is the target before it jumps back to starting point ![]() = // MOTORS ARRIVE AT THE SAME TIME // = Gstepper.moveTo(100) //Location of Gstepper before wrapping begins. Int length = 1800 //STEPS PER REVOLUTIONįor (i = 0 i<2 i++) // SET 'i'TO NUMBER OF CYCLES Here is the code in its current state /* Example sketch to control a stepper motor with TB6560 stepper motor driver, AccelStepper library and Arduino: acceleration and deceleration. Problem- position is completing its steps before position and position. This looks like bloatware but that's ok.I know there are better way's to write this but it's outside of my comprehension.Īny help on the two topics would be much appreciated. nSpeedToPosition() // Blocks until all are in position Positions = -100 //As rope wraps around bundle this is the target before it jumps back to starting point Long positions // Array of desired stepper positions Rstepper.moveTo(30) //Ends pointing forward. Lstepper.moveTo(-30) //Ends pointing forward. Set the maximum speed and acceleration:įor (i = 0 i<2 i++) //SET TO NUMBER OF FIGURE EIGHTS Create a new instance of the AccelStepper class:ĪccelStepper Gstepper = AccelStepper(motorInterfaceType, GuideStep, GuideDir, GuideEna) ĪccelStepper Lstepper = AccelStepper(motorInterfaceType, LStep, LDir, LEna) ĪccelStepper Rstepper = AccelStepper(motorInterfaceType, RStep, RDir, REna) Motor interface type must be set to 1 when using a driver: Define stepper motor connections and motor interface type. See the whole code below /* Example sketch to control a stepper motor with TB6560 stepper motor driver, AccelStepper library and Arduino: acceleration and deceleration. GuideEna in that first spot keeps the motors from turning but they still make sound. Regarding releasing the steppers, I can get the motors to NOT move when placed in the first location here.Įxample AccelStepper Gstepper = AccelStepper(motorInterfaceType, GuideEna, GuideStep, GuideDir) I've been trying a few different things but just have not found anything that works. Nothing is being held so free-wheeling is a good thing. The second thing I need help with is in releasing power to the steppers so they aren't using any power. I know why it does that but I haven't found an alternative to 'positions'.so I'd like help with an alternative, or code that will set the three stepper positions to zero. If I hit 'enter' on my keyboard a second time Lstepper and Rstepper have to reverse 8,000 to get back to position zero. When I hit 'D' the motors run their routine. I am using the Serial Monitor to start the code that runs three stepper motors. Most of the code was cobbled together to get the Nema 23 steppers working the way I want.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |