May 1, 200521 yr Hello again.Now i try to build compas for my 737 cockpit.i have big problem now with "360 - 0 point" at compas.When the controller sees change of value with 360 on 0, it starts to rotate the engine counter-clockwise, instead of that what to make 1 step clockwise and to borrow zero position. When the engine comes back in zero position, having made a full turn, it begins rotating clockwise.How to solve this with FSBUS?Thanks.Alexander.
May 2, 200521 yr I don't know how the programming goes in FSBUS, but I'm currently fiddling with a compass run out of the serial port of my PC on a stepper motor, and determining the direction and number of steps is done this way...Variables are:compass - the heading you want to display, from FSUIPCposition - the heading currently being displayeddirection - clockwise (1) or counterclockwise (0)pulses - the number of stepper pulses needed to make position match compassfactor - the number of pulses per degreepseudocode:IF heading - position <> 0 THENIF heading - position < 0 AND ABS(heading - position) < 180 THENdirection = 1pulses = INT(ABS(heading - position)) * factor)MSComm.PortOpen = TrueMSComm.Output = directionMSComm.Output = pulsesMSComm.PortOpen = FalseELSEdirection = 0pulses = INT(ABS(heading - position)) * factor)MSComm.PortOpen = TrueMSComm.Output = directionMSComm.Output = pulsesMSComm.PortOpen = FalseEND IFEND IFThis way, the code first checks to see if the compass is already pointing the right way. If it is, nothing happens. Second, it looks to see if the current position of the card is less than what it should be. If it is, AND it's less than 180' less, then it's a clockwise move. If the current postion is MORE than what it should be, OR if it's more than 180' less, then it's a counterclockwise move.Richard
Create an account or sign in to comment