Ok, I am to the point of my limitation and can only say what it is I am looking for I wrote my first adapted code to match what I need and it was success in loading it to the board:
// MultiStepper.pde
// -*- mode: C++ -*-
//
// Shows how to multiple simultaneous steppers
// Runs one stepper forwards and backwards, accelerating and decelerating
// at the limits. Runs other steppers at the same time
//
// Copyright (C) 2009 Mike McCauley
// $Id: MultiStepper.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $
#include <AccelStepper.h>
// Define some steppers and the pins they will use
AccelStepper stepper1(1, 3, 6); // pin 3 = step, pin 6 = direction
AccelStepper stepper2(1, 4, 7); // pin 4 = step, pin 7 = direction
AccelStepper stepper3(1, 5, 9); // pin 5 = step, pin 8 = direction
void setup()
{
Serial.begin(9600);
stepper1.setMaxSpeed(1000);
stepper1.setSpeed(1000);
stepper2.setMaxSpeed(1000);
stepper2.setSpeed(1000);
stepper3.setMaxSpeed(1000);
stepper3.setSpeed(1000);
}
void loop()
{
// Change direction at the limits
if (stepper1.distanceToGo() == 0)
stepper1.moveTo(-stepper1.currentPosition());
stepper1.run();
stepper2.run();
stepper3.run();
}
Things I need mainly working with DCS, Cliffs of Dover and FSX P3D :
I am looking for the motors to stop and reset on eject or crash.
I am not sure of gear ratio at the moment, but something that can be adjusted by position to match motor turn with 360 X Y Z full rotation.
3.Not sure about the speed yet needed
correct com3 connection information corrected
feedback based on steppes.
Again I am not sure of much in what I am trying to tackle but I am willing and very patient with this project.
Ok I am in the process of Building a full motion Cockpit using the SimTools from xsimulator. They have written sketches to run DC motors using an Arduino Uno and Sabertooth Dc motor Drivers one running a single and another running a double but for my project i need more torque so I am going with a 3 Long HST High torque Step motors.
The program links to the game I am flying and gives my X,Y,Z Axis as stated in the code above I am connected to Com3 Port Serial. I can upload the already working code for the DC Motors which I have been reading through to find anything I can use and reverse engineering the code to fit the step motor format I have which I posted above.
So right now I am at Game connected to software sending the info to the Arduino and with no CODE to run the motors. Once I get a basic link I can find out what step is 90 or 45 degrees to give me a return point and crash eject or just restart.
I think if I would have taken a basic coding class I would have been done already lol. Anyway I hope you can help.
There are plenty of people here that will help you but in this section of the forum the expectation is that you will write the code and ask for help if/when you get stuck. The AccelStepper examples are probably a good place to start.
The first thing that I would suggest is to get one motor working using the AccelStepper library. Get familiar with using it to move the motor in both directions at various speeds. Forget all about the game for now.
Which driver board do you have and how are the motors going to be powered ?
I have a ZTW tb6560 and have purchased a 6amp stepper motor driver since the one I have is only 2.5amps I got the smaller one just to test because it was cheaper to work on what you just said. Loading simple AccelStepper programs the first I was going to try was the one using various speeds and a potentiometer. from the Brian Schmalz easy stepper sight.
Just adapting the code to what I needed.
Anyway the games are already communicating to the Simtools program to run the motors except the sketch as I said is written for DC motors. Since I am new to programming I tracked down and uploaded to the Arduino.
I have since removed it and am ready with a basic program and will begin testing that, I posted the code above just to get some direct feed back if anything was out of place.
Think about what you want loop() to do, in terms of your additional requirement. List those steps, and write code to implement them. Determining if there is serial data to read is trivial. Reading one character from the input buffer, if there is one, is trivial. Determining if the character is an E is trivial. If it is, calling the appropriate methods on the AccelStepper instances is easy, IF you know what functions to call. Only you know what a "Quickstop" means.
The real problem is what loop() should do after the motors have been stopped. What should make them move again? How are you maintaining a record of how far the steppers have stepped, so that you can "reset to the starting position"?
Why do you think you need to call setMaxSpeed() over and over? Why do you think you need to call setAcceleration() over and over? Does setting the maximum speed to a random value make sense? Does setting the acceleration to a random value make sense?
Because I am driving 3 different motors X,Y and Z axis. Is their qa way to write it without calling for each motor taking in information?
See how I quoted your question, in order to provide an answer? You can SEE which question the answer is an answer to. You REALLY need to learn to do that.
If I tell you to drive to the pub, and I'll buy you a drink, how many times, along the way, do I need to tell you to press the gas pedal? Do I REALLY need to tell you to do it over and over and over and over (well, you get the point). I certainly shouldn't. I should ONLY need to tell you to drive 25 MPH ONCE when the speed limit changes to 25 and to drive 30 MPH only ONCE when the speed limit changes to 30. (Or KPH, if your country is weird 8)).
Along with quoting the questions, perhaps you can also get in the habit of answering ALL of them.