Welcome! Log In Create A New Profile

Advanced

lcd temperature readout

Posted by P4LIL 
lcd temperature readout
February 18, 2012 05:47PM
DO NOT USE - messes up prints!


i've been playing with your firmware, and have added a basic LCD temperature readout to my gen7 board, it is surely written badly, but it seems to work for me!

Paul



Edited 2 time(s). Last edit at 02/19/2012 08:59AM by P4LIL.
Attachments:
open | download - pins.h (15.7 KB)
open | download - Configuration.h (29.8 KB)
open | download - Repetier.pde (64.3 KB)
open | download - Commands.cpp (21.2 KB)
Re: lcd temperature readout
February 19, 2012 04:15AM
I've been thinking about the optimal way to add a lcd display for some time. So it's nice to see it done. But unfortunately your files are incomplete. The Commands.cpp is unchanged and I'm missing the part, where you write the temperatures. Would be nice for everyone who wants to test it. It's also the most critical part, as the output can consume some time to finish. Being too slow means blobs, but with the read ahead function of the firmware this should be no real problem if you don't call it too often.

For the final version I want to go a different way, though. Not because your way is wrong, but not flexible enough. The firmware needs to address the following:

1. Different LCD controller

2 and 4 rows displays are common.
They are connected over 4 datapins, 8 datapins, I2C or serial.
So a universal way to address different types is needed. I'm thinking about some MACROS which are used for writing to the display. So we only need to change the definition of the macros to use the matching functions.

2. What to show

Temperature is an important information, so it's natural to show it.
Other information during print: Coordinates, state of print job.
If we want to add buttons to create a menu, we need to show that, too.

My best solution so far are user defined pages. Each page is a lcd full of information. Every second the panel is switched to the next page and gets updated. Each page can be defined by the user. Example:

#define LCD_NUM_PAGES 2
#define LCD_PAGE1 {"Extruder: #T/#t","Bed: #B/#b"}
#define LCD_PAGE2 {"X: #X Y: #Y","Z: #Z"}
#define LCD_JOB_PAGE -1 // Skip this page if no job is running

Users with 4 row panels would need to define 4 strings per page.
The # character shows a dynamic parameter to show. This way everybody can define the output as he likes.
I think about these placeholder:
#T : Extruder temperature
#t : Extruder target temperature
#O : Extruder output
#B : Heated bed temperature
#b : Heated bed target temperature
#o : Bed heater state (on/off)
#X : X position
#Y : Y position
#Z : Z position
#P : Job progress
#J : Job name

Have I forgotten anything?

If wanted, I could implement it this way. If someone has improvements to this, tell them. I could test the I2C LCD driver. For the other one I need external tester with the right hardware (P4LIL?).


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: lcd temperature readout
February 19, 2012 04:47AM
Sorry, I've updated commands.cpp in the first post.( it was late ) I know you can do this a lot more elegantly than I can, I'm only just getting my head around this arduino stuff, spent ages just to get it to compile, couldn't find much information on using external libraries in other tabs etc. but I was just pleased I managed to get it to display something!
I have just tagged my code onto your get temperatures routine, so it only updates and mirrors what the host shows.
Your system looks very good, and I will willingly help test it when you do it, I think I've got a 4 line display somewhere as well. It would be nice to show the firmware version number as well maybe on startup.

Thanks
Paul Waterfield

'A little knowledge is a dangerous thing' - Alexander Pope
Re: lcd temperature readout
February 19, 2012 05:11AM
Just checked your code. For the purpose you've written it, it's perfect.

The idea with the firmware at the start is good. It also shows if you did a reset or not, as the display changes for some seconds to the start display.

On my Gen6 I have only a free I2C header if I remove my sd card. But thats fine, because I have also an I2C 4 row LCD display lying around. Together with your parallel interface we could already test the major hardware used. I'll skip the serial option for the beginning.

I'll start with the implementation when I have published the Mac host, which will be in the next days :-)


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: lcd temperature readout
February 19, 2012 09:01AM
Just tried a print, doing strange things, I think it is missing commands while updating the LCD. I will wait for the expert to write the correct code.


Paul

Mendel prusa, homemade Gen7 on stripboard

'A little knowledge is a dangerous thing' - Alexander Pope
Re: lcd temperature readout
February 19, 2012 09:09AM
Well, looks like I have to look at the LCD library. If it uses/changes resources needed for the printer or disables interrupts strange things can indeed happen. But we will see.


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: lcd temperature readout
February 20, 2012 04:28AM
Great to hear that there is some work on this!! I'm really looking forward using a lcd display with repetier!!!
Re: lcd temperature readout
February 21, 2012 02:29PM
I have a 20x4 LCD + Keypad combo configured to run with SJFW and Marlin. So if you need a hand testing, i can volunteer.
hd
Re: lcd temperature readout
February 22, 2012 07:26AM
me too, but ramps, 16x2 + 4x4 keypad

Edited 1 time(s). Last edit at 02/22/2012 07:38AM by hd.
Re: lcd temperature readout
February 22, 2012 07:53AM
Sounds like quite some people want to have lcd support. So the work is not wasted:-)

In a first step I will add lcd status only.

In a second step I will add a menu, so we can use the printer completely hostles with sd card. For that I have to make a controller board first. With my gen6 I have no more pins left for keys:-(

But it would be good to see what types of keyboards are in use. Are your keys connected seperately or do they have a combination of digital signals? I have even seen resistor based key pads, where I have to measure the voltage on an analog input.

What I think would work best is a rotational encoder for fast scrolling through menus and some important buttons, like emergency stop, set temp exit menu, Menu up. The encoder can be changed against next/previuous/select keys.

Which functions else do you think need a shortcut if wanted by the user?


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!
VDX
Re: lcd temperature readout
February 22, 2012 08:26AM
... I have two USB-LCD's (PIC-controller-board with LCD, USB/serial, some TWI-ports and a 6x4-keyboardmatrix-socket) - would be a good idea to make the interface so modular, that the firmware can make use of the additional ports and capabilities too ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: lcd temperature readout
February 22, 2012 08:39AM
Modular is exactly what I plan.

For the LCD you'll need a driver. In your config you select the display size and driver type. The driver is just a LCD class with a fixed set of functions. So adding new displays is just implementing a new version of that class.

The keyboard is more complicated. Different input types, different number of keys.
Here I will define a number of actions like
ACTION_LEFT
ACTION_RIGHT
ACTION_SELECT

The menu will work with a minimum of three actions. For each key you will need to define a key detect -> Action method. I will provide some macros for the detect methods, so everyone can hack it's own keyboard with some macros. That should help everyone to get his favourite keyboard layout.


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: lcd temperature readout
February 22, 2012 10:21AM
I am planning to wire up a click encoder too when it comes in the mail. So will be able to test that too :-) I am all for hostless printing. So much more convenient.
hd
Re: lcd temperature readout
February 22, 2012 12:08PM
great!
my cheap china keypad
[www.ebay.de]
cheap china 16x2 lcd
[www.ebay.de]
new orderd poland 20x4 lcd
[www.ebay.de]
Re: lcd temperature readout
February 22, 2012 02:22PM
might as well jump in.

Its good to see an effort to standardize the LCD/size/interface, i think repetier is on the right track here to get full firmware support for LCDs and input buttons.

I have been prototyping an LCD with 7 touch buttons both on i2c. So far its just bits and pieces working but not together and testing in stand alone. The LCD can be any of the popular sizes and uses the modified Arduino LCD library. Its still a few weeks of getting a solid prototype.

If you can come up with a simple menu it would be a winner. Menus Ive made are elaborate and code heavy. Menus are a pain to do.

How about a calibration menu, that would be nice.
Re: lcd temperature readout
February 23, 2012 04:33AM
I'm using a rotary click encoder on my GEN7. It's cheap , its small and you only need 3 pins on your ic.
Sorry, only registered users may post in this forum.

Click here to login