Welcome! Log In Create A New Profile


Mega2560 - Advice?

Posted by TheRevva 
Mega2560 - Advice?
May 05, 2013 01:03AM
Hi all,

Most of this post is just my 'background info'. The only 'advice' I'm unsure about is whether an R3 mega (with the Mega16 co-processor) is a huge improvement on a pre-R3 mega (with the Mega8 co-processor). If anyone here has more details, I'd truly appreciate hearing it.


I'm intending using RAMPS1.4 and this dictates that I'll be throwing a Mega2560 underneath it.
There's all sorts of Mega2560 boards available (and not surprisingly, they're at all sorts of price points).
Of course, I _could_ take the 'safe route' and get a genuine, 'Made in Italy' R3, but that's just not my style.

The 'options' I am looking at are:
1: Funduino Mega 2560 (dirt cheap!)
2: Freetronics Mega 2560 ethernet.

While I've heard that there are Funduino Mega 2560 R3 boards out there, the version I am looking at is NOT an R3 (and therefore doesn't have the extra SDA, SCL, IOREF etc pins).
The Freetronics is also NOT an R3 (although these apparently DO exist), but...
It's got a micro-SD card reader (which will be somewhat useless as it will be 'hidden' under the RAMPS board).
It also has built in ethernet and an on-board SMPS allowing it to accept up to +28VDC supply.
These latter two 'features' appeal to me... A LOT!!!

As far as I can tell, the RAMPS1.4 board is not reliant on the additional pins from an R3 Mega, so I don't envisage that as being a problem (but please, let me know if I am wrong!)

The ethernet on the Freetronics board is SPI based using the MISO, MOSI etc pins. It also appears to use D10 as the SPI 'chip select' pin. This 'clashes' with a heater/fan driver on the RAMPS1.4 board.
Secondly, the SD card looks to be using D4 as its SPI chip select which is a clash with the SER4 servo on the RAMPS.

Here's what I believe are my options
D4 - SDCard SPI chip select
I'll not be able to USE the SD card anyway as it will be 'hidden' underneath the RAMPS board. Therefore, it seems logical to simply disable the routing of D4 to the SD card and this can be achieved simply by removing a resistor array (RN6 to be precise) on the Freetronics board.
D10 - Ethernet SPI chip select
I'd really prefer to retain the ethernet functionality, so my approach here is slightly different.
1: I can 'bodge wire' the Mega itself to place the ethernet chip select onto some _other_ unused pin, but this would mean having to use 'custom firmware' on the Mega to interact with the ethernet chip.
2: I can 'bodge wire' the RAMPS board to transfer heater/fan driver onto some _other_ unused pin and, like above, this would mean I'd need to 'edit' the RepRap firmware to produce output on a different pin. (From what I can see the D7 pin is currently unassigned?)

I'm still deliberating whether to go the el-cheapo route with Funduino, or taking the leap towards a Mega with built in ethernet. I'm leaning more towards the latter despite it being several times the price...

The Freetronics boards are sold at Jaycar for NZ$149 (ugh!)
The Funduino boards are sold at Makershop for NZ$49.95 or Mindkits for NZ$39.99
(At the moment, it appears the Funduino suppliers are 'out-of-stock')
Re: Mega2560 - Advice?
May 05, 2013 07:09AM
Some comments, in no particular order....

co processor? no not really, its simply implments serial over USB.

There is no ethernet support in standard reprap firmware. You would have to write something to support it.

the R3 serial implmentation is better that earilers attempts, from what I read, and some pre R3 boards wont reboot correctly when requested to in software (the latter is fixable with new frimware for the serial over USB micro.)

Re the SMPS, for this I use a Taurino Power [reprap.org] 12-35volts on ebay.com, its R3 also.

Edited 1 time(s). Last edit at 05/05/2013 07:25AM by Dust.
Re: Mega2560 - Advice?
May 05, 2013 09:53PM
Thanx for the response Dust...

Sorry if I used an 'incorrect' term (co-processor) for the Mega8/Mega16 CPU on the board. From what I can see, it's mostly acting as a USB<->Serial convertor, but, unlike an FT232 type device, it's a real CPU and thus I chose to use the 'co-processor' term. (I guess it's more-or-less just semantics anyway)

As for the lack of Ethernet capabilities in the standard firmware, I'm not hugely concerned. I'm already well prepared to hack, modify, tweak and (hopefully?) make 'improvements' that I can share back with the community. (I'm already in the I.T. profession, and have been a hobbyist in electronics for more decades than I care to freely admit. While most of my microcontroller background has been with MicroChip PIC devices, the basic principles remain the same - Harvard style systems are not THAT hard to comprehend... LOL).

I've not yet begun to look through the firmware source. (I've already stated that I am a noobie to RepRap?).

I've noticed that the RAMPS (1.4) boards 'lock in' the microstepping rate by way of header jumpers which surprised me a little. I was expecting they'd be directly controlled by the CPU. I guess I need to take a closer look through the A4988 / DRV8824 datasheets. I guess it's all dependent upon the maximum permissible 'stepping rate' that the stepper driver can accept. I _do_ understand that you cannot instantly accelerate /decelerate a stepper motor from X to Y RPM due to inertial constraints. It's just that I'd expected more 'dynamic' switching of the microstep size once the motor had reached a given angular velocity. For example, if I was using a 40kHz max step rate with a 1.8 degree motor and 1/16 microstep, I'm instantly 'limiting' myself to 12.5 revolutions per second, but if I was also able to dynamically alter the microstep rate, I could increase that effective rate of travel by a factor of 16 to 156 rev/S. Keep in mind that I haven't (YET) read details of how many steps per mm of travel on ANY of the motors. The learning is half the fun!

From what I've read, it seems apparent that _some_ RepRappers have experienced stepper motor heat issues. Specifically, heat being transmitted along the extruder stepper motor shaft causing localised heating of the filament such that it was slipping. (The issue was 'addressed' by forced air cooling of the extruder motor).

Since I _know_ I have a STEEP learning curve ahead of me, I'm going to start by building a 'traditional' device. Only when THAT is doing what it should will I start my 'tweaking' (from both a software _AND_ hardware perspective).

Anyway, keep up the good work!
Re: Mega2560 - Advice?
May 06, 2013 03:12AM
Some boards to have software controlled microstepping settings, and even software controlled current limiting . This of course uses more IO pins.

The idea of adjusting stepping settings on the fly is not new... but no slicer does this. (yet)
Also from what I read it doesnt give you much, other than variable noise levels! tongue sticking out smiley

re your 40Khz, this is why people have started using much faster ARM based controllers so you can potentualy have much faster stepping , Eg the 4pi and the smoothieboard. The latter also has etherent (at least in hardware)

Some boards also use virtual UART's so the baud rates are effetivly ignored. So your always communicating at full USB speed. Also means the end user can't get the baud rate wrong!

If you really want to hack the latest and greatest I would take good look at the 4pi and Smoothieboard and just skip the aging badly atmega.
Re: Mega2560 - Advice?
May 06, 2013 04:51AM
I may well be looking into several aspects you've mentioned in due course, but I put that work into the future.
While I still intend to _muse_ over some possibilities (and I have NO doubt that MANY others have considered the exact same topics LONG before I became interested), a more 'immediate' hurdle remains before me.
Namely, I have to 'learn' to crawl before I enter the sprint race. And logically, that means I should be building something more ummm 'traditional' utilising fairly 'standard' components and concepts.
It's highly likely that precious little of my initial creation / abomination will 'survive' through to the nth generation, but I firmly believe that 'investing' a grand or two in that 'self learning' exercise is trivial when viewed as part of the big picture.

BTW, in 'reading between the lines' of your response, I thought I should point out that my 'interest' in the ethernet interface is NOT to overcome the (relatively speaking) s-l-o-w communication of a USB<->Serial path. Instead, it's for the standalone internet connectivity that would become available. Imagine being able to remotely 'wake up' the printer to print some part(s) and have them already completed by the time you get back to the printer? Admittedly, it's gimmicky, but it's still kinda cool.
(And I just noticed that the RAMPS-1.4 board already has a PS-ON connection to power up a PC PSU... As I stated above, I'm not reinventing any wheels at the moment. I'm merely coming to what appears to be the same conclusions that designers have envisioned LONG before I was ever remotely involved with RepRap).

BTW, you mentioned how some board have software controlled microstepping and current limiting (both of which seem reasonable at least at face value). I'm also assuming such boards have individual thermistor inputs for each motor to enable 'closing the feedback loop'. After all, steppers can become notoriously unreliable when they get too hot...

Anyway, I'll close this post with a serious question for you since you seem to have a decent knowledge of all things reprap...
From what I've seen most repraps are built using 200step/rev steppers (1.8 degree). Assuming all else is equal (eg: torque output), and price is not an issue why shouldn't I use 400steps/rev (0.9 degree) steppers. From what I've read thus far, most people seem to use the finest microstep rate (1:16 with A4988s), and I'd be able to achieve that same resolution on 1:8 microstepping (supposedly with spare torque to burn too). And with 1:16 microstepping on 400 step motors, I'd surely have a 'tighter' available print resolution if all else was equal?
I'm looking at buying 10 motors. I'll probably only use 5 of them to begin with (dual on Z axis), but it pays to have 'spares'... LOL
Re: Mega2560 - Advice?
May 06, 2013 05:36AM
Good to see another eager and curious mind on this wonderful world of molten plastic. . I too have been looking into the difference 1.8 vs .9 deg,

Have a read on this topic:


Hope it helps. .
Re: Mega2560 - Advice?
May 06, 2013 06:09AM
No, there is no feedback from the steppers. Software controlled current is for manual setting of power via software vs a variable resistor. not automated. though a feedback thermistors is a good idea.

People are using r-pi's as print servers with web gui's etc I'm not sure any have the power on feature, but im sure it can be done.

Yes we do use tend to use 200 step/rev

Main reason we use 1/16 isn’t increased accuracy, that’s actually a stepper motor myth, its for reduced noise.
After about 1/8 stepping you cant really micro step any smaller (I've had this explained in depth... there is info if you google it, short version - insufficient power to move, takes multiple steps to get enough power to actually physically move)

So re 400 step/rev with 1/8 micro stepping. yes it will work. But will be louder. How much louder? I can't say, I remember 1/2 stepping, that was loud and horrid! Going to 1/16th will quieten it, but you then need twice as many steps, so you get half your max revolution/min

Accuracy... (the 200/rev eg is what i'm actually using)
normally 200/rev say a 2mm pitch belt with 20 teeth pulleys at 1/16 micro stepping that's 12.5micron resolution (in theory)
using a 400/rev and everything else the same that's 6.25micron resolution. (also in theory)

That sounds good but.. Taking an average 0.35mm nozzle that's 350 microns, you going to be hard pressed to see 6 micron difference.
Re: Mega2560 - Advice?
May 06, 2013 04:50PM
Thanx HEAPS for posting that link!!! While it's painfully obvious that there's some disagreement between some as to the answers, the post has helped me a LOT with understanding the intricacies!
It's also (indirectly) given me my first insight into the inner workings of the various slicer programs out there.
It appears that there is a LOT more 'brain' in the slicer program than there is in the printer firmware which was a surprise to me.
As far as I can tell, the firmware only interprets linear movement in the X, Y and Z axes. (i.e. Any given command can only move the extruder nozzle from it's current position to some arbitrarily defined new position in a STRAIGHT LINE). Therefore, whenever some form of arc needs to be traced, it must be split up into a large number of small-but-straight movements prior to being sent to the printer (and I'm assuming this is ONE of the myriad tasks performed by the slicer).

Assuming the printer firmware and it's corresponding CPU were 'up to the task' (which would be rather unlikely for a 16MHz Mega), it would be become possible to create some 'exciting' new printer commands. (And, like almost every other concept I've imagined thus far, this too has been considered by others WELL before me...)

Perhaps in the long distant future, we might have repraps that directly accept stl files as input?
Im not sure if that would be a good thing (tm) or a bad thing (tm)... LOL
Re: Mega2560 - Advice?
May 06, 2013 08:27PM
Directly accepting STL file is one things im hoping the Arm board will be able to do, one day.
Re: Mega2560 - Advice?
May 06, 2013 10:31PM
Something to think about with the Arduino variant with ethernet on board is what will the ethernet (RJ45) connector short out to on the back of the RAMPS board?
I usually remove the DC power jack from my boards so that the RAMPS sits down properly on the Arduino. The RAMPS is designed to keep clear of the USB socket so there's nothing to short out on it's metal shell. I don't know if the RJ45 connector is the same size, height, position or not.

Makershop - Reprap parts, adding new stock almost daily.
Re: Mega2560 - Advice?
May 07, 2013 01:36AM
EXCELLENT point there Mikep...
Looking at the Eagle .brd files of both, the ethernet RJ45 socket is sited directly below the incoming 12V high current connection. Given that the RJ45 socket is metal shrouded, it's ummm 'less than ideal'...

It might pay for me to add an additional few mm of 'clearance' between the pair of boards...

BTW, I'm guessing it will not be too long before I come to see you with an order Mike...
Especially once Dust gets another I3 vitamins et al kit up for grabs

Edited 1 time(s). Last edit at 05/07/2013 01:42AM by TheRevva.
Sorry, only registered users may post in this forum.

Click here to login