Encoder not clicking thru menu properly

Hello,

Help!

RepRapDiscount Rumba Basic board and Smart LCD Controller XXL.



Repetier 0.9.2 Firmware

When trying to use the encoder it just bounces back and forth between 2 menu items no matter what settings used in configuration.h.

Below is my current configuration.h.

This issue happens with multiple Smart LCD Controllers, standard and XXL.
________________________________

#ifndef SDSUPPORT  // Some boards have sd support on board. These define the values already in pins.h
#define SDSUPPORT 0
#undef SDCARDDETECT
#define SDCARDDETECT -1
#define SDCARDDETECTINVERTED 0
#define SD_EXTENDED_DIR 1 /** Show extended directory including file length. Don't use this with Pronterface! */
#define SD_RUN_ON_STOP ""
#define SD_STOP_HEATER_AND_MOTORS_ON_STOP 1
#define ARC_SUPPORT 1
#define FEATURE_MEMORY_POSITION 1
#define FEATURE_CHECKSUM_FORCED 1
#define FEATURE_FAN_CONTROL 1
#define FEATURE_FAN2_CONTROL 0
#define FEATURE_CONTROLLER 2
#define ADC_KEYPAD_PIN -1
#define LANGUAGE_EN_ACTIVE 1
#define LANGUAGE_DE_ACTIVE 0
#define LANGUAGE_NL_ACTIVE 0
#define LANGUAGE_PT_ACTIVE 0
#define LANGUAGE_IT_ACTIVE 0
#define LANGUAGE_ES_ACTIVE 0
#define LANGUAGE_FI_ACTIVE 0
#define LANGUAGE_SE_ACTIVE 0
#define LANGUAGE_FR_ACTIVE 0
#define LANGUAGE_CZ_ACTIVE 0
#define LANGUAGE_PL_ACTIVE 0
#define LANGUAGE_TR_ACTIVE 0
#define UI_PRINTER_NAME "Delta Plus"
#define UI_PRINTER_COMPANY "AnyCubic"
#define UI_PAGES_DURATION 3000
#define UI_ANIMATION 0
#define UI_SPEEDDEPENDENT_POSITIONING 0
#define UI_DISABLE_AUTO_PAGESWITCH 1
#define UI_AUTORETURN_TO_MENU_AFTER 40000
#define FEATURE_UI_KEYS 1
#define UI_ENCODER_SPEED 1
#define UI_REVERSE_ENCODER 1
#define UI_KEY_BOUNCETIME 10
#define UI_KEY_FIRST_REPEAT 500
#define UI_KEY_REDUCE_REPEAT 50
#define UI_KEY_MIN_REPEAT 50
#define FEATURE_BEEPER 0
#define CASE_LIGHTS_PIN -1
#define CASE_LIGHT_DEFAULT_ON 1
#define UI_START_SCREEN_DELAY 1000
#define UI_DYNAMIC_ENCODER_SPEED 1

Comments

  • Encoders differ in pulse generation speed, so set
    #define UI_ENCODER_SPEED 1

    with 0 or 2 instead depedning on what works better. 0 is slower whcih I think is what zou need.
  • I have tried 0, 1, and 2.  setting UI_ENCODER_SPEED (0 or 1)  both result in the behivour in the video above.

    Marlin firmware with the same board and lcd controllers works fine.

  • As some updated info might be useful. 

    Encoder is setup to use the same pins in marlin and Repetier.
    Works fine in Marlin, only cycles between 2 options in Repetier.
  • Also tried Repetier 1.0dev version, same issues.
  • Wrong speed would cycle through all, just not at wanted speed.

    If you can only toggle the A or B channel of the encoder is not connected resp. wrong pin number set. In dev version these are in DisplayList.h for the different boards set. Make sure it has same pins as marlin.

  • "Encoder is setup to use the same pins in marlin and Repetier."

    not sure what you mean by toggle the A or B channel.

  • I mean

    #define UI_ENCODER_A 33
    #define UI_ENCODER_B 31

    for your board. Only if we get alternating signals on both pins it changes to next. They build a change pattern and since you seem to get only 50% of the pattern you only toggle between 2 entries. SO I assume one pin number is wrong for your board/display combination.

  • ok,


    Here is the repetier firmware I am using.

    #elif MOTHERBOARD == 80 // Rumba has different pins as RAMPS!

    #undef BEEPER_PIN
    #define BEEPER_PIN             44
    #define UI_DISPLAY_RS_PIN      19
    #define UI_DISPLAY_RW_PIN      -1
    #define UI_DISPLAY_ENABLE_PIN  42
    #define UI_DISPLAY_D0_PIN      -1
    #define UI_DISPLAY_D1_PIN      -1
    #define UI_DISPLAY_D2_PIN      -1
    #define UI_DISPLAY_D3_PIN      -1
    #define UI_DISPLAY_D4_PIN      18
    #define UI_DISPLAY_D5_PIN      38
    #define UI_DISPLAY_D6_PIN      41
    #define UI_DISPLAY_D7_PIN      40
    #define UI_ENCODER_A           11
    #define UI_ENCODER_B           12
    #define UI_ENCODER_CLICK       43
    #define UI_RESET_PIN           46

    And here are the working marlin firmware:

    // LCD / Controller
    //
    #define SD_DETECT_PIN      49
    #define BEEPER_PIN         44
    #define LCD_PINS_RS        19
    #define LCD_PINS_ENABLE    42
    #define LCD_PINS_D4        18
    #define LCD_PINS_D5        38
    #define LCD_PINS_D6        41
    #define LCD_PINS_D7        40
    #define BTN_EN1            11
    #define BTN_EN2            12
    #define BTN_ENC            43
  • SOunds correct then 11,12 for both.

    Add in repetier
    #error Gets used

    where you set the values just to be sure it is using these values. Should cause then an error message.

    But hten I have no idea what else it could be since you say in marlin it works and I know repetier normally also works.
  • edited May 2017
    Where and what would I add into repetier?

    DO you mean like this?

    #define UI_ENCODER_A           11,12
    #define UI_ENCODER_B           11,12

    because that generates a huge error, 

    In file included from C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\Repetier.h:546:0,

                     from C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.cpp:20:

    ui.h:864: error: macro "SET_INPUT" passed 2 arguments, but takes just 1

       UI_KEYS_INIT_CLICKENCODER_LOW(UI_ENCODER_A, UI_ENCODER_B); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.

                                                               ^

    ui.h:864: error: macro "SET_INPUT" passed 2 arguments, but takes just 1

    ui.h:864: error: macro "PULLUP" passed 3 arguments, but takes just 2

    ui.h:864: error: macro "PULLUP" passed 3 arguments, but takes just 2

    ui.h:874: error: macro "READ" passed 2 arguments, but takes just 1

       UI_KEYS_CLICKENCODER_LOW_REV(UI_ENCODER_A, UI_ENCODER_B); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.

                                                              ^

    ui.h:874: error: macro "READ" passed 2 arguments, but takes just 1

    In file included from C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\Repetier.h:546:0,

                     from C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.cpp:20:

    C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.h: In function 'void uiInitKeys()':

    ui.h:333: error: 'SET_INPUT' was not declared in this scope

     #define UI_KEYS_INIT_CLICKENCODER_LOW(pinA,pinB) SET_INPUT(pinA);SET_INPUT(pinB); PULLUP(pinA,HIGH);PULLUP(pinB,HIGH);

                                                      ^

    C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.h:864:3: note: in expansion of macro 'UI_KEYS_INIT_CLICKENCODER_LOW'

       UI_KEYS_INIT_CLICKENCODER_LOW(UI_ENCODER_A, UI_ENCODER_B); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.

       ^

    ui.h:333: error: 'PULLUP' was not declared in this scope

     #define UI_KEYS_INIT_CLICKENCODER_LOW(pinA,pinB) SET_INPUT(pinA);SET_INPUT(pinB); PULLUP(pinA,HIGH);PULLUP(pinB,HIGH);

                                                                                       ^

    C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.h:864:3: note: in expansion of macro 'UI_KEYS_INIT_CLICKENCODER_LOW'

       UI_KEYS_INIT_CLICKENCODER_LOW(UI_ENCODER_A, UI_ENCODER_B); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.

       ^

    In file included from C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\Repetier.h:546:0,

                     from C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.cpp:20:

    C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.h: In function 'void uiCheckKeys(uint16_t&)':

    ui.h:339: error: 'READ' was not declared in this scope

     #define UI_KEYS_CLICKENCODER_LOW_REV(pinA,pinB)  uid.encoderLast = (uid.encoderLast << 2) & 0x0F;if (!READ(pinA)) uid.encoderLast |=2;if (!READ(pinB)) uid.encoderLast |=1; uid.encoderPos -= pgm_read_byte(&encoder_table[uid.encoderLast]);

                                                                                                           ^

    C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.h:874:3: note: in expansion of macro 'UI_KEYS_CLICKENCODER_LOW_REV'

       UI_KEYS_CLICKENCODER_LOW_REV(UI_ENCODER_A, UI_ENCODER_B); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.

       ^

    ui.h:339: error: 'READ' was not declared in this scope

     #define UI_KEYS_CLICKENCODER_LOW_REV(pinA,pinB)  uid.encoderLast = (uid.encoderLast << 2) & 0x0F;if (!READ(pinA)) uid.encoderLast |=2;if (!READ(pinB)) uid.encoderLast |=1; uid.encoderPos -= pgm_read_byte(&encoder_table[uid.encoderLast]);

                                                                                                                                                ^

    C:\Users\Nick\AppData\Local\Temp\arduino_build_714027\sketch\ui.h:874:3: note: in expansion of macro 'UI_KEYS_CLICKENCODER_LOW_REV'

       UI_KEYS_CLICKENCODER_LOW_REV(UI_ENCODER_A, UI_ENCODER_B); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.

       ^

    Using library SPI at version 1.0 in folder: d:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
    exit status 1
    macro "SET_INPUT" passed 2 arguments, but takes just 1

  • No you should include

    #error Gets used

    in DisplayList.h where you think the 
    #define UI_ENCODER_A           11
    #define UI_ENCODER_B           12

    that get used are. If you then get the error message you know it is using these pins and not from an other else it catched for some reason.
  • So add #error gets used. Right under those pins?
  • Like this:

    #elif MOTHERBOARD == 80 // Rumba has different pins as RAMPS!

    #undef BEEPER_PIN
    #define BEEPER_PIN             44
    #define UI_DISPLAY_RS_PIN      19
    #define UI_DISPLAY_RW_PIN      -1
    #define UI_DISPLAY_ENABLE_PIN  42
    #define UI_DISPLAY_D0_PIN      -1
    #define UI_DISPLAY_D1_PIN      -1
    #define UI_DISPLAY_D2_PIN      -1
    #define UI_DISPLAY_D3_PIN      -1
    #define UI_DISPLAY_D4_PIN      18
    #define UI_DISPLAY_D5_PIN      38
    #define UI_DISPLAY_D6_PIN      41
    #define UI_DISPLAY_D7_PIN      40
    #define UI_ENCODER_A           11,12
    #define UI_ENCODER_B           11,12
    #define UI_ENCODER_CLICK       43
    #define UI_RESET_PIN           46
    #error Gets used

    If so when compiling I get:

    In file included from C:\Users\Nick\AppData\Local\Temp\arduino_build_353676\sketch\Repetier.h:546:0,

                     from G:\Rumba Firmware\Repetier\Repetier.ino:151:

    ui.h:757: error: #error Gets used

     #error Gets used


  • Here is a complete list of my configuration.h

    https://pastebin.com/2RvrP3CT

    And a link to a RAR of the entire firmware:

    http://www.pdxmc.com/uploads/Anycubic/Rumba-Repetier.rar ;
  • edited June 2017

    referring your configuration.h you have double use of Pin 11 , that cannot work.

    in Feature servo #define SERVO0_PIN 11

    if you use a servo, Change the pin , if you don´t use servo

    Change from #define FEATURE_SERVO 1

    to #define FEATURE_SERVO 0


    btw:

    #define UI_ENCODER_A           11,12
    #define UI_ENCODER_B           11,12

    that´s not correct , only one pin number allowed. go back to original
  • edited June 2017
    RAyWB!!!

    You da man!

    Repetier firmware builder set that pin, and i didn't even find it!

    Now that i disabled servo pin 11 for now, the LCD WOrks!

    Yeah, that double pin setup was removed was a misunderstanding about an earlier post.

  • Thanks, somehow I forgot the double pin use be more likely:-)
  • I have a stock HE3D k200 dual extruder that is doing the same thing.  I can also only get it to stay put on a different selection that what it pops up as by carefully turning the encoder between indents.

    I have disabled the servo settings as suggested, but it did nothing.  Not sure which display controller setting to use.
  • If you are just skipping menu entries your encoder speed is simply set too fast, see this option:

    /* Normally cou want a next/previous actions with every click of your encoder.

    Unfortunately, the encoder have a different count of phase changes between clicks.

    Select an encoder speed from 0 = fastest to 2 = slowest that results in one menu move per click.

    */

    #define UI_ENCODER_SPEED 1


  • What is the error pattern. Wrong speed skipping some entries or just switching between 2 positions. In latter case one of the 2 encoder inputs is not giving signals. No contact or wrong pin configured might be a reason.
Sign In or Register to comment.