-
Posts
16 -
Joined
-
Last visited
About Vuacheslav
- Birthday 11/01/1981
Personal Information
-
Flight Simulators
DCS, Microsoft Flight Simulator
-
Location
Ukraine Kiev
-
Interests
Electronics, diving, flying, simulators, cockpit building
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Cool project. Do you have models to make? I want to make these panels
-
Vuacheslav changed their profile photo
-
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
Guys tell me how to make the backlight of the scale in the device? I can’t find the item for which the backlight is responsible (what to look for?), and which pins to connect the LEDs to? -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
-
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
I tried with these parameters, but it turns out that the arrow shows less than on the screen here is my code #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); } } 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 = { 5760, // 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(); } -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
-
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
-
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
Thanks guys for the clarification. It seems that I figured it out with the arrow. According to this program, the arrow moves evenly (up to 250 it works correctly). but since after 300, the divisions go by 100 on the device, the readings do not correspond to those on the screen. How to prescribe so that after 250 it goes to hundreds? -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
swapped the coils, now the direction is correct, but the deviation of the arrow does not correspond to the deviation on the screen -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
I tried this program, but the following problem appeared, the arrow moves in the other direction (in reverse), how to fix it? -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
it transmits real speed values 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(); } -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
how can I find out?, I can't tell what it returns -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
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. -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
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) -
Stepper motor drivers for use with Arduino and DCS Bios
Vuacheslav replied to lesthegrngo's topic in Home Cockpits
Thanks for the answer, but I would like to use the x27.168 motor, the servo is not suitable -
Guys, I ask for help in writing a sketch for a speed indicator in a Mustang P51D. I can't figure out how to write it. Photo of used equipment. Here are the parameters that the HUB offers void onAirspeedMphValueChange(unsigned int newValue) { /* your code here */ } DcsBios::IntegerBuffer airspeedMphValueBuffer(0x5098, 0xffff, 0, onAirspeedMphValueChange); what should i do with it?