Programming from scratch to drive two stepper motors

Hey team, So I have very little coding experience (only a little bit of matlab) and am wanting to make a small robot and program it. I am using two stepper motors to drive the wheels which are run through a bigEasy driver each and then onto an Arduino UNO board. Everything is wired up and I can get both steppers rotating at the same time. But unfortunately that is the extent of it. Here is what i want to achieve and need help to do so... 1) Drive forward a certain distance 2) Turn 90 degrees to the right 3) Reverse a certain distance 4) Turn 90 degrees to the left 5) Drive forward a certain distance 6) Stop

I have read heaps of stuff on C++ programming and scoured the forums etc but cant understand all the coding lingo. If someone could help me out with some code for what i want to achieve that would be awesome! Please be helpful and not a dick about it like some of the people on here. Thanks :)

Talking about not being a dick, did you read the 'sticky' at the top of this forum which explains that you need to post your code before we can help you? Sorry, but my crystal ball has crashed (it runs on XP!). All I get on it is the 'Blue Screen Of Death', so I can't see your code.

Stomper90: and not a dick about it like some of the people on here.

I find it useful to ask myself whether the dicks actually know more than I do :)


So far, not a very helpful thread…
I just got started with this stuff around June (2014) and so I consider myself a big “newbie”. I have been on the same quest for some time now - going in circles it seems to get my inverted pendulum robot (long way of saying “two wheeled robot” to smoothly move using 2 stepper motors.
Thought I had made a breakthrough when I ran across the “accelStepper.h” library. while it has many nice functions to accellerate and run the motors, I have yet to be able to code (or find code) that will allow me to change the speed while the motors are still moving. this is a big drawback, but one that I’m hoping someone will chime in with sometime over the next few months. i have my Accelerometer & Gyro working in harmony, just need a way to control the Steppers smoothly. If not, i’ll move on to DC motors that can be controlled with PWM.
anyway - you may have better luck than i with the accelStepper.h library. look around this site - lots of good documentation on the functions:

Russ from Coral Springs, Fl

rholt: So far, not a very helpful thread...

I find it a good general policy NOT to ask my questions in unhelpful Threads. I suggest you ask the moderator (click report to in my Post, not yours) to move your question to a new Thread with a title that reflects your robot balancing project.

I am not very familiar with AccelStepper but it seems to be designed to move a motor X number of steps ramping up and down the speed on the way. I can imagine that changing the speed in the middle of that will throw off all the acceleration calculations. For example what happens if you ask it to change speed just before it was due to start decelerating? I don't think there is any way to know which phase it is in.

It is pretty easy to write code to drive a stepper motor and, hence, it should be easy enough to build in acceleration.

I wonder if your application needs to accelerate up (or down) to a speed and then hold the speed indefinitely until another change-speed command comes along.

Have you seen this Segway Thread