Jump to content

Adrian_gc

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Adrian_gc

  1. Hey guys, I've finally changed the line velocity step by step and yet is still awaited from the needle simulator engine I upload a video of what happens. See if you can lend a hand to me. The code setting is the ogirinal. With the rate in 2000, 1500, 3000 ... etc does exactly the same and the needle is balsa wood, very light and glued. https://www.youtube.com/watch?v=y97ISWnap1Q
  2. Ok i am going to try to change the speed to max....wich value is the max for the VID60-02 ? Now is set on 1000.
  3. Hi guys, the motor is the VID60-02, and the shaft that i am using is the inner shaft, no plastic. I can confirm that if i descend the a-10c with 15-25 degress it go perfectly from 30.000 to 0 ft...but if i put the plane 90 degrees down,,,the pointer begin to be in a total desynchronization. I don´t know if i can change the speed of the stepper motor to more fast !!! but i feel that is not enought fast to 90 dregress descent. After do this descend and fly stable,,,,the pointer needle continuous desynchronization until i reset the Arduino.
  4. Hey guys, I'm Adrian, I need help with my altimeter, I connected the VID60-02 engine and the IR emitter as you can see in the pictures, the truth is that it works, but only if it descends or ascends at a moderate speed, the problemIt comes when I make a descent from 30,000 feet almost sharply, altimeter needle keeps spinning at full speed but starts getting to have desynchronize 1 turn unless the simulator or so. the code I am using is the one that happened to me Warhog, and connections I have done as you can see in the photographs. Can you tell me why that desynchronization? Thank you very much. Code: // include AccelStepper library #include <AccelStepper.h> // include DcsBios library #include <DcsBios.h> #include <Servo.h> // DcsBios-related declarations DcsBios::ProtocolParser parser; #define STEPS_PER_REVOLUTION 240 #define ZERO_OFFSET 0 AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 int currentStepperPosition = 0; // current stepper position (in steps, from 0 to STEPS_PER_REVOLUTION-1) signed long lastAccelStepperPosition; void setup() { Serial.begin(250000); pinMode (12,INPUT); // LOW when in zero position, HIGH otherwise // set up stepper motor for zeroing stepper.setMaxSpeed(1000); stepper.setSpeed(500); // run clockwise until we detect the zero position while (digitalRead (12)==1) { stepper.runSpeed(); } // add zero offset stepper.runToNewPosition(stepper.currentPosition() + ZERO_OFFSET); // tell the AccelStepper library that we are at position zero stepper.setCurrentPosition(0); lastAccelStepperPosition = 0; // set stepper acceleration in steps per second per second // (default is zero) stepper.setAcceleration(1000); } void loop() { // handle DcsBios communication while (Serial.available()) { parser.processChar(Serial.read()); } DcsBios::PollingInput::pollInputs(); // move stepper motor stepper.run(); } void onDcsBiosWrite(unsigned int address, unsigned int value) { if (address == 0x107e) { digitalWrite (13,1); unsigned int alt100ftValue = (value & 0xffff) >> 0; // convert data from DCS to a target position expressed as a number of steps int targetPosition = map(alt100ftValue, 0, 65535, 0, STEPS_PER_REVOLUTION-1); // adjust currentStepperPosition to include the distance our stepper motor // was moved since we last updated it int movementSinceLastUpdate = stepper.currentPosition() - lastAccelStepperPosition; currentStepperPosition += movementSinceLastUpdate; lastAccelStepperPosition = stepper.currentPosition(); if (currentStepperPosition < 0) currentStepperPosition += STEPS_PER_REVOLUTION; if (currentStepperPosition > STEPS_PER_REVOLUTION) currentStepperPosition -= STEPS_PER_REVOLUTION; int delta = targetPosition - currentStepperPosition; // if we would move more than 180 degree counterclockwise, move clockwise instead if (delta < -(STEPS_PER_REVOLUTION/2)) delta += STEPS_PER_REVOLUTION; // if we would move more than 180 degree clockwise, move counterclockwise instead if (delta > (STEPS_PER_REVOLUTION/2)) delta -= STEPS_PER_REVOLUTION; // tell AccelStepper to move relative to the current position stepper.move(delta); } } Pictures:
  5. Thank You Warhog !!! I start with it to work right now, as soon as it will put the results in a new post !!!!! Let's do it !!!!!
  6. Thank you very much Warhog , very interesting, I had no idea how it was done for the stepper motor start from zero. The construction of the altimeter will be in this post or in another?
  7. Hey guys, thank you very much for the answers,i will be eager to see your post in the coming days Warhog, becouse resolve the issue of 360 degrees will help me a lot in many things. Thank you very much for the link engine with zero position, Could you recomended to me a IR emitter for the VID60? ( i understand that this IR emitter will have to be placed in the pointer). The link was not working properly for me, would these? http://es.aliexpress.com/item/Weili-Clock-stepper-motor-VID60-02-100-new-stock-offet/837031970.html?isOrig=true#extend I will be posting all the progress that go by on the way to help and be helped !!!! Thank you !!!!
  8. Hey guys, some time ago I started using the DCS-BIOS to build my cabin A-10c, so far have had no problems with LED and buttons and gear servos with engine instruments. The problem I have with the altimeter needle, I have no idea how to do that is constantly moving over 360 degrees, with a servo 180 is impossible, with 360 either, I've seen your stepper motors, but arduino Uno R3 serves for that type of engine? what would be the lua code to move the "100 ft Pointer", if someone could lend a hand would appreciate, thank you very much.
  9. Hi guys, finally found the solution tinkering with a friend late in the morning lol. In case anyone has the same problem or need someone here it is: #include <DcsBios.h> #include <Servo.h> #include <LiquidCrystal.h> LiquidCrystal lcd(12,11,5,4,3,2); /**** Make your changes after this line ****/ void onDcsBiosWrite(unsigned int address, unsigned int value) { if (address == 0x10ce) { unsigned int fuelQty10000Value = (value & 0xffff) >> 0; lcd.setCursor(0, 0); lcd.print(fuelQty10000Value/6553); } if (address == 0x10d0) { unsigned int fuelQty1000Value = (value & 0xffff) >> 0; lcd.setCursor(1, 0); lcd.print(fuelQty1000Value/6553); } if (address == 0x10d2) { unsigned int fuelQty100Value = (value & 0xffff) >> 0; lcd.setCursor(2, 0); lcd.print(fuelQty100Value/6553); } } DcsBios:: ProtocolParser parser; void setup() { Serial.begin(500000); lcd.begin(16,2); lcd.clear(); lcd.setCursor(3, 0); lcd.print("00"); } Thanks !!!!
  10. Hi guys, today I have been tinkering with the fuel gauge panel and I am trying to make my lcd display total amount of fuel and the truth is I can not. I listed the three numbers you can see in the picture, the lua code I'm using Arduino is as follows: #include <DcsBios.h> #include <Servo.h> #include <LiquidCrystal.h> LiquidCrystal lcd(12,11,5,4,3,2); /**** Make your changes after this line ****/ void onDcsBiosWrite(unsigned int address, unsigned int value) { if (address == 0x10ce) { unsigned int fuelQty10000Value = (value & 0xffff) >> 0; lcd.setCursor(0, 0); lcd.print(fuelQty10000Value); } if (address == 0x10d0) { unsigned int fuelQty1000Value = (value & 0xffff) >> 0; lcd.setCursor(5, 0); lcd.print(fuelQty1000Value); } if (address == 0x10d2) { unsigned int fuelQty100Value = (value & 0xffff) >> 0; lcd.setCursor(11, 0); lcd.print(fuelQty100Value); } } /**** In most cases, you do not have to change anything below this line ****/ /* Instantiate a ProtocolParser object to parse the DCS-BIOS export stream */ DcsBios:: ProtocolParser parser; void setup() { Serial.begin(500000); lcd.begin(16,2); lcd.clear(); } Could you help me again? sorry for not be so skilled. I use the Arduino Uno R3 is and have verified the correct connection of the LCD, it works correctly. Thank you very much for your time.
  11. Hi, Thanks very much GOOdnight, you helped to me, thank you a lot!!! it works !!! I have change "Lcd2" for "Lcd" and it works !!!
  12. Help with FM/AM radios display Hi, i am Adrian, i need help with the AM/FM radios, I have a dude, i am trying to get on a lcd the AM/FM status frequency,,,but i have feel that i only have in the bios.documentation for both radios the code lua for the 1º and 4º frequency selector: void onVhfamFreq1Change(char* newValue) { /* your code here */ } DcsBios::StringBuffer<2> vhfamFreq1StrBuffer(0x1190, onVhfamFreq1Change); void onVhfamFreq4Change(char* newValue) { /* your code here */ } DcsBios::StringBuffer<2> vhfamFreq4StrBuffer(0x1192, onVhfamFreq4Change); My question is the next, where are the lua code for the 2º and 3º frequency selectors? Thanks for your time!!!
×
×
  • Create New...