Re: Project: FiveD on Arduino
February 15, 2011 09:22PM
Hello!

I'm trying to load the FiveD on Arduino.

I've been following the instructions on the rep rap wiki and think I have copied all the correct files over to my Arduino folder, and correctly copied the header. Every time I try to compile the program it gives me errors, though. I took a screenshot.

[i211.photobucket.com]

I'm using the master from git. I've tried the release candidate, also, and got a different set of compile errors. Should I be trying to use a different branch?

Thanks!
Re: Project: FiveD on Arduino
February 15, 2011 09:44PM
Andrew Diehl Wrote:
-------------------------------------------------------
> Hello!
>
> I'm trying to load the FiveD on Arduino.
>
> I've been following the instructions on the rep
> rap wiki and think I have copied all the correct
> files over to my Arduino folder, and correctly
> copied the header. Every time I try to compile the
> program it gives me errors, though. I took a
> screenshot.
>
> [i211.photobucket.com]
> ArduinoFiveDcompileFailure.png
>
> I'm using the master from git. I've tried the
> release candidate, also, and got a different set
> of compile errors. Should I be trying to use a
> different branch?
>
> Thanks!

The screen shot looks like the arduino IDE. I don't believe either of these branches will compile in the arduino IDE. Try the developer installation instructions on the wiki. I managed it, so it can't be that hard.

One thing that caught me up is explained in this post. See item 6.
Re: Project: FiveD on Arduino
February 15, 2011 10:07PM
Architect Wrote:
-------------------------------------------------------

>
> here are the M codes I send to initialize my PID
> before a print. they work very well for what I
> have set up.
>
> M111 s1
> M130 s8
> M131 s0.5
> M132 s24
> M133 s0.375
>

I misunderstood the scale factor and had I_limit way off. The oscillation I was seeing was likely from integral wind up. Works fairly well when you set it properly. Not bad for defaults. I will still need to tune though because I think the overshoot is a bit much (15 deg.) and it never quite reaches the set point (1-2 deg down).

> I had to make this simple change in my Heater.c
> file to get it to behave.
> unless all of the D values are negative not just
> when cooling then the math didn't jive.
>
> was :
> int32_t pid_output_intermed = (
> (
> (((int32_t) heater_p) * p_factor) +
> (((int32_t) heater_i) * i_factor) +
> (((int32_t) heater_d) * d_factor)
> ) / PID_SCALE
>
> Now:
> int32_t pid_output_intermed = (
> (
> (((int32_t) heater_p) * p_factor) +
> (((int32_t) heater_i) * i_factor) -
> (((int32_t) heater_d) * d_factor)
> ) / PID_SCALE

Is entering the d_factor as a negative the same as this? I am trying not to modify the source downstream in an attempt to give feedback from the user perspective.
Re: Project: FiveD on Arduino
February 15, 2011 10:25PM
Oh, ok then.

What branch will compile with the arduino IDE? I'm assuming one of them must, since the easiest to understand instructions clearly say to use it :/

I looked at the previous post you referenced. Honestly, If I have to go through anywhere near the number of issues mentioned there, I'm done for. I've got next to zero programming/debugging knowledge. I was really hoping the files could pretty much be loaded into the arduino IDE with only setting adjustments in the config.h and make files.

I'll still try going the developer installation route, but what exactly is meant by the following?

make
make program
./sender.sh

Thanks. Sorry I'm such a N00b :p
Re: Project: FiveD on Arduino
February 15, 2011 11:44PM
This firmware is still under heavy development and I think arduino IDE compatibility is on hold until things settle down some. It has been quite a while since I have been able to compile in the IDE (I haven't tried lately either though). I might be able to narrow it down to a few commits but so much has changed/improved since then it might not be worth it.

You will need to be running linux to do the developers install, I don't think there's much of a solution for windows other than the IDE. An Ubuntu live CD might work if you don't already have a linux box.

I was referring to item 6 only in the post I linked but after rereading, item 3 applies too. Everything else was either a non issue for me or has changed since then.

make - Compiles the source code. Run it from the root directory of the firmware source code
make program - Will compile if necessary then program the arduino (This is were I had trouble with items 3 and 6)
sender.sh - Is a host side script for talking to the firmware. This never worked for me but there are other methods to talk to the firmware once it is running on the arduino.

The stuff further down on the wiki page about git will probably help too. I started without using git. I would just download the source from github manually but that got old quick.
Re: Project: FiveD on Arduino
February 16, 2011 12:35AM
I shall return at a later date then, when a few more bugs are worked out..

My root desire was to have something easy and mainstream-able (Windows) that fit on a cheap 168/328 Arduino. I work for an electronics contract manufacturer and we often find ourselves not having any work a few days a month. We decided we may as well be making something (anything) if we could just cover materials/overhead. I've already got our own version of an Arduino Uno copy in the works, and I really wanted something to easily build off that and make a line of dirt cheap reprap electronics.

When you eventually get a version that works, and compiles on the Arduino IDE, you should set it aside so when you start making more improvements us mere users can still play winking smiley

Thanks for the help! You guys are awesome.
Re: Project: FiveD on Arduino
February 16, 2011 01:32AM
Andrew Diehl Wrote:
-------------------------------------------------------

> When you eventually get a version that works, and
> compiles on the Arduino IDE, you should set it
> aside so when you start making more improvements
> us mere users can still play winking smiley

Trust me, I am definitely on the same side of the user/developer line as you but I've managed to tag along well enough. Once you're running linux it really isn't that hard and linux has become as easy as windows (especially ubuntu). I encourage you to get a linux live cd and give it a shot.

In any event, you should check back over the next few days at least. As I said I am not a developer and someone may have more/better information for you.
Re: Project: FiveD on Arduino
February 16, 2011 01:54AM
Quote

I don't believe either of these branches will compile in the arduino IDE.

release-candidate (RC) is tested to work with the Arduino IDE. With Arduino0018 that is, so it might help to use an older version.

Quote

When you eventually get a version that works, and compiles on the Arduino IDE, you should set it aside so when you start making more improvements us mere users can still play

The intention of this RC was to do exactly this. Unfortunately I never got around to make a full release and now it's merged back into master. Worse, I have a bunch of bug fixing patches on my own platter and I don't know wether and/or where to apply them.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Project: FiveD on Arduino
February 16, 2011 02:06AM
Arduino IDE compatibility isn't on hold, it's just that I don't use it and I receive very few patches related to supporting it. If you can tell me the difference between what we have and what we should have, I can patch things up.

The errors you show in your screenshot are from some greycode stuff that isn't enabled by default, so no idea why the IDE would even be including it let alone spitting errors about it... Try commenting or removing greycode.c and see how you go


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Project: FiveD on Arduino
February 16, 2011 07:28AM
Andrew Diehl Wrote:
-------------------------------------------------------
> Hello!
>
> I'm trying to load the FiveD on Arduino.
>
> I've been following the instructions on the rep
> rap wiki and think I have copied all the correct
> files over to my Arduino folder, and correctly
> copied the header. Every time I try to compile the
> program it gives me errors, though. I took a
> screenshot.
>
> [i211.photobucket.com]
> ArduinoFiveDcompileFailure.png
>
> I'm using the master from git. I've tried the
> release candidate, also, and got a different set
> of compile errors. Should I be trying to use a
> different branch?
The greycode stuff doesn't compile currently in the arduino IDE (haven't looked at the issue in detail). Just comment out the {X,Y,Z}_GREYCODE defines in the beginning of graycode.c. The rest should compile fine.
I'm also working on windows, and was able to compile/upload the firmware to GEN3 electronics. I'm a big linux fan myself, but until Solidworks runs in wine I will be using windows (no flame war please, I just want to explain why I use windows personally for reprap stuff)

Edited 1 time(s). Last edit at 02/16/2011 07:36AM by Markus Amsler.
Re: Project: FiveD on Arduino
February 16, 2011 12:47PM
Triffid_Hunter Wrote:
-------------------------------------------------------
> Attached patch is ugly, but will get you sorted
> until we figure out an elegant way to do this that
> actually works in all cases

Which patch do you mean?
Re: Project: FiveD on Arduino
February 16, 2011 03:54PM
Triffid_Hunter Wrote:
-------------------------------------------------------
> Arduino IDE compatibility isn't on hold, it's just
> that I don't use it and I receive very few patches
> related to supporting it.

Sorry, "on hold" was a poor choice of words. I just meant that I haven't seen much development on Arduino IDE compatibility lately.

I hope I haven't scared of Mr. Diehl for good. Maybe someone should PM him if he doesn't respond in the next couple of days. I would volunteer but I'm afraid I'll just do more damage.
Re: Project: FiveD on Arduino
February 16, 2011 05:02PM
Jacky2k Wrote:
-------------------------------------------------------
> Which patch do you mean?

The file linked at the bottom of that post, open/download

spaztik Wrote:
-------------------------------------------------------
>I hope I haven't scared of Mr. Diehl for good. Maybe someone
> should PM him if he doesn't respond in the next couple of days.
> I would volunteer but I'm afraid I'll just do more damage.

I think if he's interested in this despite it not working once in one program he'll be back, and if not then we're still not very interesting even with supplied patches, considering active development with occasional breakage winking smiley

PM him when we have a stable branch


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Project: FiveD on Arduino
February 16, 2011 05:54PM
Haha, I only meant I wasn't going to bug you all with questions until the kinks were worked out. I Don't completely give up that easily (though I admit I was super frustrated yesterday)

I just got it to compile after commenting out the greycode stuff. Victory!

Now to start trying to make stuff move...
Re: Project: FiveD on Arduino
February 17, 2011 08:27AM
Andrew, if you're considering manufacturing some boards, you can probably get away with burning just the bootloader. Most people will have to configure, compile, and load the firmware themselves. With the bootloader in place, this can be done with nothing more than the usb cable that's used for controlling the reprap anyway.


--
I'm building it with Baling Wire
Re: Project: FiveD on Arduino
February 17, 2011 01:16PM
One simple question: How is the eeprom hex file called after "make"?
I am unable to find it and the firmware is not working because of the missing eeprom file...
Re: Project: FiveD on Arduino
February 17, 2011 01:40PM
OK I think there are missing some lines in the makefile.
%.eep: %.elf
	@echo "  OBJCOPY   [email protected]"
	@$(OBJCOPY) -O ihex -j .eeprom --change-section-lma .eeprom=0 $< [email protected]

And the line 116 needs to be changed from
all: config.h $(PROGRAM).hex $(PROGRAM).lst $(PROGRAM).sym size
to
all: config.h $(PROGRAM).eep $(PROGRAM).hex $(PROGRAM).lst $(PROGRAM).sym size

Triffid, may you fix that? I have no idea of git winking smiley
Re: Project: FiveD on Arduino
February 17, 2011 05:32PM
I don't use the eeprom file myself, just burn appropriate values in with M130-M134 (see gcode_process.c)

You can always
make mendel.eep
to get it, then plug that into avrdude if you prefer smiling smiley

Remember you only need to program the eeprom once to get heater values in, so if I made the makefile do this every time it would constantly overwrite your settings sad smiley


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Project: FiveD on Arduino
February 18, 2011 04:16PM
That should be written in the readme, someone who has no idea of atmega might need days to figure out hat he has to burn the eeprom or use the M130-M134 commands.
Re: Project: FiveD on Arduino
February 18, 2011 05:50PM
I would prefer for people to tell me what values are pulled from the eeprom so the blank eeprom detection can kick in.. It was checking for zeroes, added -1s recently


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Project: FiveD on Arduino
February 19, 2011 02:58AM
I've noticed a few instances when X & Y motion has ceased, and yet the extruder continues to run. Is this something I should be able to achieve with a simple (G1 X Y Z E F) command?

Is there perhaps some limit I need to up?

Vik :v)
Re: Project: FiveD on Arduino
February 19, 2011 04:36AM
Hmm, that's either geometric errors in the axis synchroniser, or a G1En command, or M101/M103 not running fast enough I'd expect, see if you can isolate a test case for us


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Project: FiveD on Arduino
February 19, 2011 01:06PM
Don't know if this was a oversight or set this way for a reason,
but using BANG_BANG I had to change the following to get it right.
org:
#else
if (current_temp >= target_temp)
pid_output = BANG_BANG_ON;
else
pid_output = BANG_BANG_OFF;
#endif

chng:
#else
if (current_temp >= target_temp)
pid_output = BANG_BANG_OFF;
else
pid_output = BANG_BANG_ON;
#endif
Re: Project: FiveD on Arduino
February 19, 2011 10:13PM
thanks architect, posted as commit 65a1846.

All,
I've added G161/G162 commands with associated stuff in home.[ch], please post patches to make them work correctly!

I'm considering merging input-float branch as it doesn't seem to use much more code space, perhaps via an ifdef or something. Please post objections here!


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Project: FiveD on Arduino
February 20, 2011 12:28AM
Maybe the EEPROM values need a checksum?

Vik :v)
Re: Project: FiveD on Arduino
February 20, 2011 12:36AM
that's a great idea, thanks vik, implementing right now smiling smiley


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Project: FiveD on Arduino
February 20, 2011 01:43PM
Could someone add the commented out programming baudrate of 115200 for atmega2560, and a switch to use stk500v2 versus stk500v1, as that is what Arduino Mega 2560 default bootloader requires. So, I got the gcode parser loop working inside that particular board, improved the wikipage docs about that.

To the people discovering how to program the firmware, please add you findings as clarifications to the wikipage. Or should they be added to the official README?
Re: Project: FiveD on Arduino
February 20, 2011 03:48PM
I Note there are plans for a second heater. Are there any plans for a second extruder? I've found enough pins and bolted one on, so I'm game for experimenting smiling smiley

Vik :v)
Re: Project: FiveD on Arduino
February 20, 2011 05:55PM
There is a wiki on this? :-)
Re: Project: FiveD on Arduino
February 20, 2011 06:28PM
Silly question. what is:

#define PS_ON_PIN

in config.h?

Also, where are the pin definitions for the extruder heater, thermocouple, and anything else not a stepper motor? I've been looking around in the code all day but wasn't able to find it. It's probably right in front of my nose...

Thanks!
Sorry, only registered users may post in this forum.

Click here to login