Welcome! Log In Create A New Profile

Advanced

UI click encoder problem

Posted by leadinglights 
UI click encoder problem
December 13, 2013 08:35AM
When I connected up my LCD and encoder/clickswitch to my Ramps board the display was cycling through a number of menu entries, speeding up rapidly to a blur. Turning the encoder slowed it down perceptibly, but did not stop it.
My initial suspicion was that it was a hardware issue as one of the pins for the encoder was 0v while the other encoder line and clickswitch line were high. However, on checking the three pins on the RAMPS board for short circuits and open circuits they were clean. Checking the pins on the Arduino board without the Ramps connected, they were all high, but removing the three pins connecting the Arduino to the Ramps and reinstalling the Ramps on the Arduino, again one of the encoder pins was low. It now seem likely that the problem is either software or that software is involved somewhere.

Details,
Repetier Firmware development release
- using pins as on this release 4 for clickswitch, 5 & 6 for encoder
- using #define UI_HAS_KEYS 1
Ramps 1.4
Arduino mega2560
- Pins on connector PWML
-- pin 7 PH3 to Ramps D6
-- pin 6 PE3 to Ramps D5 ----This is the one that is low
-- pin 5 PG5 to Ramps D4

Thanks for any help in this perplexing problem

Mike
Re: UI click encoder problem
December 13, 2013 11:42AM
It looks to have more of a hardware dimension as it sort of works without the Ramps card - with jumper wires from each LCD and encoder/clickswitch pin to the appropriate port on the Arduino card. It is however, very twitchy. If I start or reset the firmware in some encoder positions it runs away, cycling through menues faster until it is a blur. In other posisions (every second position) it starts with the screen showing :
X: 0.00mm
Y: 0.00mm
Z: 0.00mm
Idle.
It is quite sensitive even from this position though. Pushing the clickswitch will give a menu with Back, Quick Settings, Position & Extruder, but the selector ( > ) either jumps up and down or runs away down the screen.
I have tried setting
UI_ENCODER_SPEED 2
and
UI_KEY_BOUNCETIME 20
both of which helped marginally. but did not solve it completely.

Is there anything else I can try - beside buying another Ramps of course.

Mike

Edited 1 time(s). Last edit at 12/13/2013 11:44AM by leadinglights.
Re: UI click encoder problem
December 14, 2013 04:24AM
The key thing is I think, that you said without RAMPS the pins are set correctly. That rules out any firmware setting and must be the ramps board. So unless you find where the change comes from the only other solution is to use different pins without the problem.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: UI click encoder problem
December 14, 2013 05:03AM
I have just rechecked to make sure that I am not doing anything silly, but I still get the same result: It is not directly the pin as I have physically removed the pins from the underside of the Ramps board and put wires in. With the Ramps board in I get 4 high, 5 low, 6 high, but with the Ramps board removed I get all three high. High is about 4.85V and low is about 0.8mV, a very low figure even for a short circuit - multimeter shows >10MOhm. on 5 to ground.

The waters are somewhat muddied by the encoder also being rubbish, one phase works O.K., but the other misses some transitions. I have just been using wire jumpers since.

The software problem, probably a dumb setting on my part, is shown still though as starting or resetting with either of the encoder lines held low the strange jumping about still occurs. If both are open circuit then start or reset will brine up the X, Y & Z display and operating the click switch will move onto the back, quick settings etc. menu.

I have ordered up a replacement Ramps board and a couple of different encoders and will do a full gremlin search on the existing Ramps board when my brain has more mojo.

Mike

Edited 1 time(s). Last edit at 12/14/2013 05:04AM by leadinglights.
Re: UI click encoder problem
December 15, 2013 11:21AM
How do I change the pin (or pins) for the encoder?

Is it as simple as changing the two lines in uiconfig.h which refer to pin 5

// in   void ui_init_keys()

  UI_KEYS_INIT_BUTTON_LOW(5);

// and in void ui_check_keys(int &action)

 UI_KEYS_BUTTON_LOW(5,UI_ACTION_NEXT);

or are there other things which will need changing? Also, what pins would be suitable/unsuitable?

Thanks,

Mike
Re: UI click encoder problem
December 15, 2013 11:47AM
Yes, it is as easy as changing the pins. Each pin is used twice - in initialization and during test. Make sure to set FEATURE_CONTROLLER 1 or it won't get used.

It does not matter which pin you use as long as it is not used for an other function.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: UI click encoder problem
December 18, 2013 07:21AM
Just a note of thanks. With a new Ramps board and encoder and the encoder pins set to different pins, it now all works splendidly, even the SD which seemed a bit flake is now solid.

An additional observation, although it doesn't now affect me: pin 5, even if set only to the encoeder, is resolutely configured as an output and set low. This is the UI encoder pins configures as received on the latest development release.

Thanks again,

Mike
Sorry, only registered users may post in this forum.

Click here to login