Welcome! Log In Create A New Profile

Advanced

Melzi and Panelolu2 Gremlins

Posted by thematts 
Melzi and Panelolu2 Gremlins
November 09, 2013 11:47AM
Having a really odd issue and hoping someone here can shed some light.

Purchased a couple of kits from nophead a few weeks ago for a group build and went ahead and got the Panelolu2 w/Melzi adapters as well. Printer is great, the kit and directions were top notch and I was able to get some excellent prints right off the bat. However, once I try and add the Panelolu2 into the mix either my X or Z axis quits working.

Tony over at T3P3 has been a huge help in trying to track this down, but swapping Panelolu2's, rewiring motors, and trying various Marlin versions haven't improved or changed the behavior at all. It certainly seems to be a software issue since I can plug the Panelolu2 into the Melzi and everything works, just not once I enable it in firmware. Fans, heated bed, extruder, hot end, all seem to function as they should.

Software versions:
Currently functional non-lcd Marlin. Merged nophead's settings and thermistor tables into upstream. - [github.com]
LCD enabled version of the above Marlin. X axis doesn't work with this version. - [github.com]
LCD enabled version from T3P3. Z axis doesn't work with this one. Tony also sent me a copy of firmware currently in use on their Mendels, same behavior as this copy. - [github.com]
Latest Sanguino and LiquidTWI2 libraries, using Arduino 1.0.5, no compilation issues.

During the initial build I was able to test with the other Panelolu2/adapter combo on my Melzi and had the same behavior with the mendel90_lcd firmware. Unfortunately I wasn't able to test on the other Melzi and I don't have direct access to test now.

Any thoughts or suggestions would be helpful here, beginning to think my Panelolu2 has it in for me...
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 12:10PM
If it helps, I have a Panelolu2 working on my Nophead Dibond kit.
I have uploaded the firmware which I am using to GITHUB here: [github.com]

Nophead assisted with getting the Arduino IDE set up correctly and once you have added these lines to hardware\Melzi\cores\arduino\pins_arduino.h

#define NUM_DIGITAL_PINS 32
#define NUM_ANALOG_INPUTS 8
#define analogInputToDigitalPin(p) ((p < NUM_ANALOG_INPUTS) ? (p) + NUM_DIGITAL_PINS - NUM_ANALOG_INPUTS : -1)

... the code should/will compile and upload as expected. (Only tried with Arduino 1.0.1)

The firmware enables the display of positive and negative coordinates.
The thread discussing the above is here: [forums.reprap.org]

Alan
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 12:39PM
Hey Matthew

I have uploaded your fork of marlin with the lcd enabled onto the Mendel90 we have setup with a Melzi board:

That compiles fine on arduino 0023 and when uploaded all axis move fine. I had to turn the acceleration down to make the Z move through because I use M5 not M6 like Nophead does in his kit.

I personally dont have my 0,0 point in the center of the bed but at the corner so I dont use negative numbers on the Axis positions. If you want to go for that then Alan (comment above) has made the changes necessary for having a central bed 0'0 and handle negative numbers on the Panelolu2 display.

I know that does not help much but it does confirm that your LCD version of Marlin works with a Melzi and Panelolu2

Cheers

Tony
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 02:04PM
When you say the axes don't work, what do they do? Is the motor energised when the others are? Does it attempt to spin?


[www.hydraraptor.blogspot.com]
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 02:10PM
Note also I don't use the Sanguino library as there are various versions with different I/O numbering. I created a Melzi board support package.


[www.hydraraptor.blogspot.com]
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 02:20PM
Quote
nophead
When you say the axes don't work, what do they do? Is the motor energised when the others are? Does it attempt to spin?

The motor does energize, I can't move it by hand until it either times out or I disable via gcode. It doesn't sound like it tries to move, the most I hear is a slight hum when it gets juice.

@Alzibiff: Thanks, not having any issues with compiling or uploading and it seems my fork does work just fine on other systems. I'll get the display stuff sorted once things actually work. smiling smiley

@T3P3: Good to know it does work, tried dropping acceleration/speed for the X axis (non-working since I'm on my updated fork) and no change.
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 06:09PM
@thematts,
Are you selecting "Melzi W/ ATmega 1284p 18MHz" when downloading. It could explain different results from the same firmware when different people download it if the board support package is different.


[www.hydraraptor.blogspot.com]
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 08:21PM
Quote
nophead
@thematts,
Are you selecting "Melzi W/ ATmega 1284p 18MHz" when downloading. It could explain different results from the same firmware when different people download it if the board support package is different.

Gak. I stupidly assumed the Sanguino libraries in Marlin would work for the Melzi. I went back and followed the exact instructions on the T3P3 site and was able to get things working with arduino-023. Not satisfied with having to use the older IDE, I tried using your Melzi directory along with the pins_arduino.h edit but ended up with this error:
In file included from sketchbook/hardware/Melzi/cores/arduino/WConstants.h:1:0,
                 from sketchbook/hardware/Melzi/cores/arduino/WInterrupts.c:33:
/usr/avr/include/math.h:426:15: error: expected identifier or '(' before 'double'
 extern double round (double __x) __ATTR_CONST__;
               ^
sketchbook/hardware/Melzi/cores/arduino/wiring.h:79:26: error: expected ')' before '>=' token
 #define round(x)     ((x)>=0?(long)((x)+0.5)sad smileylong)((x)-0.5))

Did some more digging and found that Fedora 19 is using a different set of avr libraries than arduino 1.0.5 expects, so I grabbed the IDE from the arduino site and was able to upload from there. Updated using that copy of the IDE and happy to say it all !*@#& works as expected. I've updated my repo with the edited Melzi directory and the patch to display negative values.

Thanks!
Re: Melzi and Panelolu2 Gremlins
November 09, 2013 08:26PM
@thematts

great to see you got it working. This is one of the reasons I have stuck with arduino 0023!

Cheers

Tony
Re: Melzi and Panelolu2 Gremlins
November 10, 2013 04:06AM
So what is the conclusion? Is it simply that Fedora 19 ships a version of the Sanguino libraries that is broken? I.e. if you use the Melzi folder I provide, or the Sanguino that Tony uses it works?


[www.hydraraptor.blogspot.com]
Re: Melzi and Panelolu2 Gremlins
November 10, 2013 10:52AM
Sorry, the core issue was Marlin's Sanguino libraries don't work with the Melzi/Panelolu2 combo. Fedora 19's avr math.h header doesn't seem to be compatible with arduino 1.0.5 and the Melzi libraries combo (source of the error I pasted earlier), so I had to grab the IDE from the arduino site in order to use the newer version.
Re: Melzi and Panelolu2 Gremlins
November 10, 2013 02:53PM
Quote
thematts
Sorry, the core issue was Marlin's Sanguino libraries don't work with the Melzi/Panelolu2 combo. Fedora 19's avr math.h header doesn't seem to be compatible with arduino 1.0.5 and the Melzi libraries combo (source of the error I pasted earlier), so I had to grab the IDE from the arduino site in order to use the newer version.

There is a problem with a duplicate definition of round in Marlin/Marlin/Melzi/cores/arduino/wiring.h and newer avr-libc which causes this error. It needs a library version guard added as has been done in Marlin/Marlin/wiring.h. It will then build correctly using fedora 19's Arduino package.
#if __AVR_LIBC_VERSION__ < 10701UL
#define round(x)     ((x)>=0?(long)((x)+0.5)sad smileylong)((x)-0.5))
#endif

Regards,
Neil Darlow

Edit: sorry for the emoticon in the code fragment. The forum is too intelligent.
Addenda: fedora 19 avr-gcc and avr-c++ have recently been updated to 4.8.2 which creates a Marlin build approximately 2kB smaller than the previous version. It also fixes a traceback in Pronterface at the start of SD Upload.

Edited 4 time(s). Last edit at 11/10/2013 04:10PM by neildarlow.


I try to write with consideration for all nationalities. Please let me know if something is unclear.
Printing with Mendel90 from fedora 25 using Cura, FreeCAD, MeshLab, OpenSCAD, Skeinforge and Slic3r tools.
Re: Melzi and Panelolu2 Gremlins
November 10, 2013 08:56PM
Thanks Neil, can confirm that works here. I've updated my git repos with the fix as well.
Sorry, only registered users may post in this forum.

Click here to login