Jump to content

Stepper motor drivers for use with Arduino and DCS Bios


lesthegrngo

Recommended Posts

Guys, I have ordered some X27-168 stepper motors, plus some Arduino Nanos and EasyDriver stepper motor controllers. The stepper motors have already arived as they were sent from europe, however the nanos and EasyDriver boards will take longer as they are coming from Asia.

 

However I want to get on with my instrument panels as much as possible so that I can at least ensure that it works before using the final hardware. For my CNC endraver I have an Arduino Uno that came with 3 A4988 Stepper Motor Drivers as a spare controller board, and I was thinking of using those to test with. The problem is that despite the stepper motors being cheap, I don't want to burn them out.

 

How can I find out if they are compatible?

 

Cheers

 

Les

Link to comment
Share on other sites

X27 steppers are directly connectable to an arduino by using all four Pins. So at least Hardware can be tested.

 

Look Here for an example: Arduino and Stepper Motor


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

This guy has written an Arduino Library for these motors and has several useful pages of info that you will want to go through.

 

https://guy.carpenter.id.au/gaugette/2013/01/18/analog-gauge-stepper-breakout-board-available-on-tindie/

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

****EDITED**** Partial success, scroll to bottom for edited text

 

Ok, guys, I need help!

 

I have connected up the X27-168 stepper to my Arduino Uno for testing, using the A4899 stepper motor drivers mentioned above (EasyDrivers not arrived yet)

 

I am using Craig's sketch from the mysimpit site front dash IRQ, reproduced below

 

#define DCSBIOS_IRQ_SERIAL

 

#include <AccelStepper.h>

#include "DcsBios.h"

 

struct StepperConfig {

unsigned int maxSteps;

unsigned int acceleration;

unsigned int maxSpeed;

};

 

 

class Vid29Stepper : public DcsBios::Int16Buffer {

private:

AccelStepper& stepper;

StepperConfig& stepperConfig;

unsigned int (*map_function)(unsigned int);

unsigned char initState;

public:

Vid29Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int))

: Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) {

}

 

virtual void loop() {

if (initState == 0) { // not initialized yet

stepper.setMaxSpeed(stepperConfig.maxSpeed);

stepper.setAcceleration(stepperConfig.acceleration);

stepper.moveTo(-((long)stepperConfig.maxSteps));

initState = 1;

}

if (initState == 1) { // zeroing

stepper.run();

if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) {

stepper.setCurrentPosition(0);

initState = 2;

stepper.moveTo(stepperConfig.maxSteps/2);

}

}

if (initState == 2) { // running normally

if (hasUpdatedData()) {

unsigned int newPosition = map_function(getData());

newPosition = constrain(newPosition, 0, stepperConfig.maxSteps);

stepper.moveTo(newPosition);

}

stepper.run();

}

}

};

 

/* modify below this line */

 

/* define stepper parameters

multiple Vid29Stepper instances can share the same StepperConfig object */

struct StepperConfig stepperConfig = {

3900, // maxSteps

1000, // maxSpeed

1000 // acceleration

};

 

// note cs im testing with 11 going to step (middle on easy driver) and 10 doing to direction (right on easy driver)

// cs so in the code going on the basis that the first named number is step and the second is direction

// define AccelStepper instance

AccelStepper stepper(AccelStepper::DRIVER, 11, 10);

// define Vid29Stepper class that uses the AccelStepper instance defined in the line above

// +-- arbitrary name

// | +-- Address of stepper data (from control reference)

// | | +-- name of AccelStepper instance

// v v v v-- StepperConfig struct instance

Vid29Stepper apu(0x10c0, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int {

/* this function needs to map newValue to the correct number of steps */

return map(newValue, 0, 65535, 0, stepperConfig.maxSteps);

});

 

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

 

Sorry for the funny characters, not sure how you guys paste in the sketches

 

I have wired up the components like the attached diagram

 

Pin 11 on the arduino is step, 10 is direction.

 

The sketch compiles OK, no errors, I run the CMD and once com port 3 is selected I can then start DCS and I see the info transfer. I tested with LED's for undercarriage lock position to check that it was functioning OK, and then attached the stepper and driver as described above.

 

Absolutely nothing happens when I turn on and off the APU at the stepper motor. I see the Arduino RX light flashing, so I know information is flowing, but it obviously isn't flowing to the right places.

 

Am I supposed to change some parameters? I notice some of the sketch is in blue, other bits in red.

 

Any help you guys to give me would be very much appreciated, I'm great with the hardware but this coding stuff is not something that comes easily to me

 

Cheers

 

Les

 

Edit - So I stumbled across a bit of garbled code, presumably I made a hash of copying it across. Now I have it 'working', in that when you start the APU the gauge needle moves. Unfortunately it is not in line with the required movements. As you start the APU, it will go full scale anticlockwise until it reaches the stop. It will then stay there for a few seconds, before finally moving off the stop, and turns clockwise until about 90% full scale deflection, waver there for a bit, then continue to almost but not quite full scale. When you turn off the APU, it turns clockwise until it is against the stop, and just sits there at the max clockwise stop, until you start the APU again when it repeats the cycle mentioned above. Progress, but clearly I am missing something in the setting up of the instrument to calibrate it to the expected movement.

 

On some aircraft we used to use ballast resistors for setting the EGT indication, using a Y=MX+C type formula, I suppose I have to understand the electronic equivalent of that?

 

Cheers


Edited by lesthegrngo
Link to comment
Share on other sites

Guys, I've been fiddling about with this and am pleased to report some further success, although I am still a way off saying that it is all good. Essentially, making sure the stepper motor polarity for each coil is key, that was the reason for the apparently incorrect movement.

 

I am going to break this out into a separate thread now, as it has moved on from the realms of how to wire up and is firmly into DCS BIOS sketch tweaking.

 

I'm happy to pass on any diagrams, CAD drawings and so forth to whoever wants to try this as basically it is quite simple, but the devil is in the detail - if I can help anyone with what I have made, it will make me happy, as I ill be able to give something back to the forum

 

Cheers

 

Les

Link to comment
Share on other sites

Sadly I have to come back to this thread requesting some advice. I was using A4899 stepper motors for testing while waiting for the EasyDriver boards to arrive, well yesterday they finally did and everthing has come to a crashing halt.

 

I wired up the EasyDriver board to the nano per the wiring diagram found on the net, so step connection to pin 11, direction to pin 10, gnd to gnd, then a 9v DC power supply to M+ and gnd, and finally the left side coil of the X27 stepper to the A pins, and the right to the B pins. I used the same sketch as was working with the A4899, checked the comms was good and could see the nano RX light flashing so I'm sure the data was streaming to the nano..... but absolutely nothing on the stepper. It does not move at all, not even on powering up, when using the A4899 it woul go full scale to calibrate.

 

I have tried all orientations of the motor pin connections, I reversed the direction and step pins, all for troubleshooting, but nothing. To rule out a duff board, I swapped the EasyDriver for another, same result.

 

To also double check the rest, I reinstalled the A4899 board, and it worked as before.

 

I'm sure I wired it up correctly, it is if anything simpler than the A4899 board

 

Can anyone think of anything that I could have done wrong?

 

Cheers

 

Les

Link to comment
Share on other sites

A lot of progress since discovering the power supply was duff, and things are coming along nicely. Most of the engine and APU gauges are now 'mapped' and now I am starting to get away from the experimental wiring stage for the gauges.

 

To do this, I'll be using the MAX487 chips to make the network, but rather than use wiring and ethernet sockets, I've decided to make PCB based modules that interconnect.

 

Hopefully I will be able to attach photos of the first module WIP, if not I'll have to work out how to.

 

Any suggestions or feedback welcome

 

Cheers

 

Les

20190601_114122.thumb.jpg.7bcc4a771a2f235bca8d5015a5e17498.jpg


Edited by lesthegrngo
Link to comment
Share on other sites

  • 2 years later...
26.05.2019 в 12:03, lesthegrngo сказал:

****EDITED**** Частичный успех, прокрутите вниз, чтобы найти отредактированный текст

 

Хорошо, ребята, мне нужна помощь!

 

Я подключил шаговый двигатель X27-168 к моему Arduino Uno для тестирования, используя упомянутые выше драйверы шагового двигателя A4899 (EasyDrivers еще не поступили)

 

Я использую набросок Крейга из IRQ на передней панели сайта mysimpit, воспроизведенный ниже.

 

#define DCSBIOS_IRQ_SERIAL

 

#include <AccelStepper.h>

#include "DcsBios.h"

 

структура StepperConfig {

беззнаковое целое maxSteps;

беззнаковое ускорение;

беззнаковое целое maxSpeed;

};

 

 

класс Vid29Stepper: общедоступный DcsBios::Int16Buffer {

частный:

AccelStepper и степпер;

StepperConfig& stepperConfig;

целое без знака (*map_function)(целое без знака);

беззнаковый символ initState;

публичный:

Vid29Stepper (целочисленный адрес без знака, AccelStepper и степпер, StepperConfig и stepperConfig, целочисленный без знака (* map_function) (целый без знака))

: Int16Buffer(адрес), stepper(степпер), stepperConfig(stepperConfig), map_function(map_function), initState(0) {

}

 

виртуальная недействительная петля () {

if (initState == 0) { // еще не инициализирован

stepper.setMaxSpeed(stepperConfig.maxSpeed);

stepper.setAcceleration(stepperConfig.acceleration);

stepper.moveTo(-((long)stepperConfig.maxSteps));

состояние инициализации = 1;

}

if (initState == 1) { // обнуление

stepper.run();

if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) {

stepper.setCurrentPosition (0);

состояние инициализации = 2;

stepper.moveTo(stepperConfig.maxSteps/2);

}

}

if (initState == 2) { // работает нормально

если (hasUpdatedData()) {

беззнаковый int newPosition = map_function(getData());

newPosition = ограничение (newPosition, 0, stepperConfig.maxSteps);

stepper.moveTo (новая позиция);

}

stepper.run();

}

}

};

 

/* изменить ниже этой строки */

 

/* определяем параметры шагового двигателя

несколько экземпляров Vid29Stepper могут совместно использовать один и тот же объект StepperConfig */

структура StepperConfig stepperConfig = {

3900, // максимальное количество шагов

1000, // максимальная скорость

1000 // ускорение

};

 

// обратите внимание на cs im при тестировании с 11 шагами (посередине на простом драйвере) и 10 в направлении (справа на легком драйвере)

// cs поэтому в коде, исходя из того, что первое названное число — это шаг, а второе — направление

// определить экземпляр AccelStepper

Степпер AccelStepper(AccelStepper::DRIVER, 11, 10);

// определить класс Vid29Stepper, который использует экземпляр AccelStepper, определенный в строке выше

// +-- произвольное имя

// | +-- Адрес данных шагового двигателя (из управляющей ссылки)

// | | +-- имя экземпляра AccelStepper

// vvv v-- Экземпляр структуры StepperConfig

Vid29Stepper apu(0x10c0, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int {

/* эта функция должна сопоставить newValue с правильным количеством шагов */

карта возврата (newValue, 0, 65535, 0, stepperConfig.maxSteps);

});

 

 

недействительная установка () {

DcsBios::setup();

}

 

недействительный цикл () {

DcsBios::loop();

}

 

Извините за забавных персонажей, не знаю, как вы, ребята, вставляете скетчи.

 

Я подключил компоненты, как на приложенной схеме.

 

11 пин на ардуино это шаг, 10 это направление.

 

Скетч компилируется нормально, ошибок нет, я запускаю CMD, и как только выбран COM-порт 3, я могу запустить DCS и увидеть передачу информации. Я проверил со светодиодами положение замка ходовой части, чтобы убедиться, что он работает нормально, а затем подключил шаговый двигатель и драйвер, как описано выше.

 

Абсолютно ничего не происходит, когда я включаю и выключаю ВСУ на шаговом двигателе. Я вижу, как мигает индикатор Arduino RX, поэтому я знаю, что информация течет, но явно не в нужных местах.

 

Я должен изменить некоторые параметры? Я заметил, что часть эскиза выделена синим цветом, а часть — красным.

 

Любая помощь, которую вы, ребята, можете мне оказать, будет очень признательна, я отлично разбираюсь в аппаратном обеспечении, но это кодирование не то, что мне легко дается.

 

Ваше здоровье

 

Лес

 

Редактировать. Итак, я наткнулся на немного искаженного кода, предположительно, я сделал хэш, скопировав его. Теперь у меня он «работает», когда вы запускаете ВСУ, стрелка датчика перемещается. К сожалению, это не соответствует требуемым движениям. Когда вы запускаете APU, он будет двигаться по полной шкале против часовой стрелки, пока не достигнет упора. Затем он будет оставаться там в течение нескольких секунд, прежде чем, наконец, остановится, и повернется по часовой стрелке до примерно 90% отклонения от полной шкалы, немного колеблется там, а затем продолжает почти, но не совсем полную шкалу. Когда вы выключаете APU, он вращается по часовой стрелке до упора и просто останавливается на максимальном упоре по часовой стрелке, пока вы снова не запустите APU, когда он повторит цикл, упомянутый выше. Прогресс,

 

На некоторых самолетах мы использовали балластные резисторы для настройки индикации EGT, используя формулу типа Y = MX + C, я полагаю, я должен понимать электронный эквивалент этого?

 

Ваше здоровье

 

Have a nice day, everyone. Help me figure out the sketch. I want to adapt it to the speed sensor in the P51D Mustang aircraft. This sketch does not display correctly. Please explain how to rewrite it.

Here are the parameters that DCS offers me

Screenshot_4.jpg

Link to comment
Share on other sites

Hi, what hardware are you using? 

 

you can try using this code, although the part that says 8, 544, 2400 you may hav to change to adjust the range 

 

#include <Servo.h>


#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"

void onAirspeedNeedleChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer AirspeedNeedleBuffer(0x5030, 0xffff, 0, onAirspeedNeedleChange);

DcsBios::ServoOutput AirspeedNeedle(0x5030, 8, 544, 2400);


void setup() {
  DcsBios::setup();
}

void loop() {
  DcsBios::loop();
}

Cheers

 

Les

  • Like 1
Link to comment
Share on other sites

18 hours ago, Vuacheslav said:

Have a nice day, everyone. Help me figure out the sketch. I want to adapt it to the speed sensor in the P51D Mustang aircraft. This sketch does not display correctly. Please explain how to rewrite it.

I gave up on the P-51 airspeed indicator. 
There's a bug which means the number output doesn't relate directly to the angle of the needle.
This means that if your gauge face is marked as in the game, the reading doesn't match your airspeed.

Link to comment
Share on other sites

4 часа назад, lesthegrngo сказал:

Привет, какое оборудование ты используешь? 

 

вы можете попробовать использовать этот код, хотя часть, которая говорит 8, 544, 2400, вам, возможно, придется изменить, чтобы настроить диапазон 

 





}



Ваше здоровье

 

Лес

Thanks for the answer, but I would like to use the x27.168 motor, the servo is not suitable

Link to comment
Share on other sites

4 минуты назад, lesthegrngo сказал:

Итак, хорошие новости для вас, так как этот эскиз Arduino предназначен для этого шагового двигателя.

Ваше здоровье

 

Лес

But what about connecting the electronic part then?, I use a nano + stepper motor controller + x27.168, I have 2 contacts step and dir, how then to connect them? only the signal wire is connected to the servo (and here is the step and direction)

Link to comment
Share on other sites

This sketch uses pin 11 for step and pin 10 for direction, it is more complicated as it has an extra part that makes the stepper reset its position when initialised. Credit must go to Craig for the original sketch that this is based on. Use the section stepperconfig to set step values and acceleration rates to suit

#define DCSBIOS_IRQ_SERIAL

#include <AccelStepper.h>
#include "DcsBios.h"

struct StepperConfig {
  unsigned int maxSteps;
  unsigned int acceleration;
  unsigned int maxSpeed;
};


class Vid29Stepper : public DcsBios::Int16Buffer {
  private:
    AccelStepper& stepper;
    StepperConfig& stepperConfig;
    unsigned int (*map_function)(unsigned int);
    unsigned char initState;
  public:
    Vid29Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int))
    : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) {
    }

    virtual void loop() {
      if (initState == 0) { // not initialized yet
        stepper.setMaxSpeed(stepperConfig.maxSpeed);
        stepper.setAcceleration(stepperConfig.acceleration);
        stepper.moveTo(-((long)stepperConfig.maxSteps));
        initState = 1;
      }
      if (initState == 1) { // zeroing
        stepper.run();
        if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) {
          stepper.setCurrentPosition(0);
          initState = 2;
          stepper.moveTo(stepperConfig.maxSteps/2);
        }
      }
      if (initState == 2) { // running normally
        if (hasUpdatedData()) {
          unsigned int newPosition = map_function(getData());
          newPosition = constrain(newPosition, 0, stepperConfig.maxSteps);
          stepper.moveTo(newPosition);
        }
        stepper.run();
      }
    }
};


struct StepperConfig stepperConfig = {
  500,  // maxSteps
  1000, // maxSpeed
  1000 // acceleration
  };


AccelStepper stepper(AccelStepper::DRIVER, 11, 10);

Vid29Stepper AirspeedNeedleBuffer(0x5030, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int {

  return map(newValue, 0, 65535, 0, stepperConfig.maxSteps);
}); 


void setup() {
  DcsBios::setup();
}

void loop() {
  DcsBios::loop();
}

Cheers

 

Les

Link to comment
Share on other sites

13 часов назад, lesthegrngo сказал:

Этот скетч использует контакт 11 для шага и контакт 10 для направления. Он более сложен, так как имеет дополнительную часть, которая заставляет шаговый двигатель сбрасывать свое положение при инициализации. Следует отдать должное Крейгу за оригинальный эскиз, на котором он основан. Используйте раздел stepperconfig, чтобы установить значения шагов и коэффициенты ускорения в соответствии с вашими потребностями.















Ваше здоровье

 

Лес

Thanks for the answer. I did everything as you said, but in the simulator itself the arrow does not respond to speed changes. Initialization passes (when turned on, the arrow deviates to the left and then to the right) I checked the connection, everything is correct.

IMG_0008.jpg

Link to comment
Share on other sites

7 минут назад, outbaxx сказал:

Скетч предполагает, что значения от 0 до 65535 должны быть преобразованы в шаги. Возвращает ли airspeedneedle эти значения? Или он возвращает реальную скорость, т.е. 80 узлов?

how can I find out?, I can't tell what it returns

Link to comment
Share on other sites

4 минуты назад, outbaxx сказал:


В вашем посте №9 есть скриншот DCSbios, при подключении к симу и в кабине вы должны увидеть значения справа.

it transmits real speed values

Screenshot_4.jpg

Только что, Vuacheslav сказал:

он передает реальные значения скорости

Скриншот_4.jpg

maximum speed values 700

I understand that the program should look like this?

#define DCSBIOS_IRQ_SERIAL

#include <AccelStepper.h>
#include "DcsBios.h"

struct StepperConfig {
  unsigned int maxSteps;
  unsigned int acceleration;
  unsigned int maxSpeed;
};


class Vid29Stepper : public DcsBios::Int16Buffer {
  private:
    AccelStepper& stepper;
    StepperConfig& stepperConfig;
    unsigned int (*map_function)(unsigned int);
    unsigned char initState;
  public:
    Vid29Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int))
    : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) {
    }

    virtual void loop() {
      if (initState == 0) { // not initialized yet
        stepper.setMaxSpeed(stepperConfig.maxSpeed);
        stepper.setAcceleration(stepperConfig.acceleration);
        stepper.moveTo(-((long)stepperConfig.maxSteps));
        initState = 1;
      }
      if (initState == 1) { // zeroing
        stepper.run();
        if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) {
          stepper.setCurrentPosition(0);
          initState = 2;
          stepper.moveTo(stepperConfig.maxSteps/2);
        }
      }
      if (initState == 2) { // running normally
        if (hasUpdatedData()) {
          unsigned int newPosition = map_function(getData());
          newPosition = constrain(newPosition, 0, stepperConfig.maxSteps);
          stepper.moveTo(newPosition);
        }
        stepper.run();
      }
    }
};


struct StepperConfig stepperConfig = {
  3900,  // maxSteps
  1000, // maxSpeed
  1000 // acceleration
  };


AccelStepper stepper(AccelStepper::DRIVER, 11, 10);

Vid29Stepper airspeedMphValueBuffer(0x5098, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int {

  return map(newValue, 0, 700, 0, stepperConfig.maxSteps);
}); 


void setup() {
  DcsBios::setup();
}

void loop() {
  DcsBios::loop();
}

Link to comment
Share on other sites

maximum speed values 700
I understand that the program should look like this?
#define DCSBIOS_IRQ_SERIAL
#include
#include "DcsBios.h"
struct StepperConfig {
  unsigned int maxSteps;
  unsigned int acceleration;
  unsigned int maxSpeed;
};

class Vid29Stepper : public DcsBios::Int16Buffer {
  private:
    AccelStepper& stepper;
    StepperConfig& stepperConfig;
    unsigned int (*map_function)(unsigned int);
    unsigned char initState;
  public:
    Vid29Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int))
    : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) {
    }
    virtual void loop() {
      if (initState == 0) { // not initialized yet
        stepper.setMaxSpeed(stepperConfig.maxSpeed);
        stepper.setAcceleration(stepperConfig.acceleration);
        stepper.moveTo(-((long)stepperConfig.maxSteps));
        initState = 1;
      }
      if (initState == 1) { // zeroing
        stepper.run();
        if (stepper.currentPosition()           stepper.setCurrentPosition(0);
          initState = 2;
          stepper.moveTo(stepperConfig.maxSteps/2);
        }
      }
      if (initState == 2) { // running normally
        if (hasUpdatedData()) {
          unsigned int newPosition = map_function(getData());
          newPosition = constrain(newPosition, 0, stepperConfig.maxSteps);
          stepper.moveTo(newPosition);
        }
        stepper.run();
      }
    }
};

struct StepperConfig stepperConfig = {
  3900,  // maxSteps
  1000, // maxSpeed
  1000 // acceleration
  };

AccelStepper stepper(AccelStepper::DRIVER, 11, 10);
Vid29Stepper airspeedMphValueBuffer(0x5098, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int {
  return map(newValue, 0, 700, 0, stepperConfig.maxSteps);
}); 

void setup() {
  DcsBios::setup();
}
void loop() {
  DcsBios::loop();
}

Yes I would try that :)
Link to comment
Share on other sites

I tried this program, but the following problem appeared, the arrow moves in the other direction (in reverse), how to fix it?

Oh, I had that too but I don’t remember exactly what I did, perhaps switched A & B coils, can’t say for sure it’s been a while since I did this.
Link to comment
Share on other sites

1 час назад, outbaxx сказал:


Oh, I had that too but I don’t remember exactly what I did, perhaps switched A & B coils, can’t say for sure it’s been a while since I did this.

swapped the coils, now the direction is correct, but the deviation of the arrow does not correspond to the deviation on the screen 😞

Link to comment
Share on other sites

swapped the coils, now the direction is correct, but the deviation of the arrow does not correspond to the deviation on the screen

The steps per revolution for these steppers are 720 full steps, with 1/8 micro stepping you have 5760 steps per revolution.

The stepper max travel is what? 320degrees?

320/360*5760->5120 steps?
Try to set stepperconfig.maxSteps to 5120 give or take.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...