Translate

Oct 10, 2017

Improved Encoder processing (SimVimCockpit)

In SimVimCockpit  Encoder processing has been totally reprogrammed. The new algorithm takes into account huge timing difference between  encoder scanning period and X-Plane frame rate, and counts precisely each encoder state change, with mininal missing steps probability.

The plugin in X-Plane can accept new data only with its frames frequency,  while ArdSimX firmware can check the encoder state about 150 times between each X-Plane frame.

In previous versions the program code couldn't send all fast state changes in one frame without missing steps while single slow changes were received by the plugin without problems.

Later (in ArdSimX) a "code crutch" was added to catch all encoder state changes and send them as multiple data packets, but this code has always been "beta" and was highly demanding to  processing time. This is why we recommended not to use encoders on the same board with steppers, for example.

In SimVimCockpit all these problems were resolved. Now the program code reads all encoder inputs between X-Plane frames, takes into account every change and sums them, then sends the number of steps and direction in one single data packet, while at the same time using the algorithm of steps multiplication depending on rotation speed.


Also, along  with direct connection to the pins, every encoder can be  connected to the inputs of a multiplexer. I.e. you can use any pair of extended inputs for an encoder.



Furthermore, the tests show that using multiplexers for encoder inputs is even more efficient than direct inputs. Mainly this is because of direct manipulations with Arduino ports which are used to control multiplexers in SimVimCockpit.

Now, there will be no missing rapid-rotation steps, it will be smooth, non-jerking parameter changes and the additional acceleration applied to fast rotation will be more consistent.

With one quick finger movement you will be able to rotate the instrument needle/card  to 360 degrees, while keeping the ability to do slow and precise rotation.

Videos to be added....

Vlad

9 comments:

  1. This is looking very good, thanks for all the hard work!

    ReplyDelete
  2. Thanks for the plans it's possible we have "how to" max 7219

    ReplyDelete
    Replies
    1. 7-Segment displays connection options (using the MAX7219, registers HC595 or drivers DM13A) will be published in next post tomorrow.
      Vlad

      Delete
    2. Thanks Vlad

      When I use the registry hc595 this one no longer works from 5 Led the DM13a is better?

      Delete
    3. This is not 595 issue, maybe some errors in the configuration file (or bug, but we haven't noticed some).

      Vlad

      Delete
  3. Great work, as always. I too am REALLY looking forward to a "how-to" on the MAX7219 LED displays. These will make my sim look really professional/ realistic! Thanks!

    ReplyDelete
  4. Vlad, great to hear. Answered my question from the encoder blog also. Looking forward to testing v2!!

    ReplyDelete
  5. Hi,

    I'm having a issues with the encoders. They're just too sensitive. I single detent counts 3 to 4 numbers making very difficult to tune or select the course I want. I'm using MAX7219 custom code and some If loops to use analog pins as LED outputs as ArdsimX does not support them.
    I love working with MAX7219. What can I do to have smooth encoder rotation?
    I need analog pins as Outputs too. Why don't you support them in the configurator?

    PS. Using seperate Arduinos for inputs and outputs is not an option for me.
    I have a radio stack using ArdsimX and Arduino and this encoder issue is not present. Each detents counts one by one flawlessly and it's using 7 MAX7219 ICs.

    Thanks ahead!

    ReplyDelete
    Replies
    1. Johny,

      Please read the recent two news in this blog - we have updated ArdSimX (v.1.30-1.31) - now all encoder types should work as you need (add needed type and acceleration factor options in the [A] section) - see config guide for encoders: http://www.simvim.com/asx_cfg.html

      How about new SimVimCockpit interface?

      We stop adding new features in the ArdSimX in favor of new interface. If you need I can add outputs to analog pins, but you could use serial output with several registers (hc595 or DM13A drivers)..

      New SimVimCokpit has much more functionality, it works directly with any type of 7-segment displays, including MAX, directly controlling them - no any libraries used, the firmware code is highly optimized and works with AVR ports directly to maximize speed, for example the output to MAX7219 for a 5-digit display takes only 0.36 ms, instead of 80-100 ms if you use one of the existed libraries.

      Also, you can use any pins (digital or analog) as for input and outputs, and extend any input/output to 16 I/O.

      Etcetera... http://www.simvim.com/svc_io.html

      Vlad

      Delete