Welcome! Log In Create A New Profile

Advanced

Arduino as simplified comm/controller board

Posted by Anonymous User 
Re: Arduino as simplified comm/controller board
December 05, 2007 10:18AM
I saw the boarduino stuff! It looks rather cool, shame I live in the UK and most US companies shipping is about $30. Being a UK student it makes it hard to justify playing
Re: Arduino as simplified comm/controller board
December 12, 2007 07:20PM
I've just had a look at the Arduino again, the 6 Analog sensors can be used, as rudimentary digital sensors. This can be done though if commands, like

if(anaIn > 100) limit = 1;
if(anaIn < 100) limit = 0;

That way anything above 2v gets counted as a high and anything below 2v counts as a low. (assuming the analog input scales 0-255 and Vref = 5v).

This should then free up 6 digital i/o pins.
Anonymous User
Re: Arduino as simplified comm/controller board
December 13, 2007 04:10AM
The ATmega168 PDIP has 28 pins, 23 of those are digital in/out. All other functions like analog in, PWM, serial, reset, clock and programmer are software (or fuse) configurable. So you can use the analog in ports as digital in without messing with compares to above or below 100. Which is very slow as well, since the ADC's take at least 13 microseconds to get a reading.

--Blerik
Re: Arduino as simplified comm/controller board
December 13, 2007 08:30AM
In other words....

value = digitalRead(19); // 14 through 19 works fine from the analog pins.

same with digitalWrite per mellis in this post:
[www.arduino.cc]
Re: Arduino as simplified comm/controller board
December 16, 2007 08:55PM
yup, arvin is right... you can use digitalRead/Write on analog 0-6 pins (14-19)

i'll be using this technique to squeeze a whole reprap machine onto one arduino board in the coming weeks.

yay!

ps. i just finished both the cartesian bot and extruder firmwares tonight. look for a blog posting =)
Re: Arduino as simplified comm/controller board
December 17, 2007 09:34AM
Quote

ps. i just finished both the cartesian bot and extruder firmwares tonight. look for a blog posting =)

I was hoping you were having success. I never got your libraries to compile.

Congratulations!

What's the link to the blog?
Re: Arduino as simplified comm/controller board
December 17, 2007 01:30PM
i havent made the blog posting yet. i have a few small changes to make to the firmware, and i think i'll make a v1.0 release of the firmwares on tuesday or wednesday.
Re: Arduino as simplified comm/controller board
December 20, 2007 05:11AM
Hurro guys

I had missed this thread.

At the risk of opening some old issues.

To synchronise moves on a per axis controler board it is enough to have a wired "or" line between all the boards (works in a ring too, of course).

Basicaly any board in the process of a move asserts the wired or to true.

Any or all of the other boards can also assert the line to true simultaneously.

When a board has completed it's move it clears it's assertion and by checking the state of the line can tell when all the others have completed.

If you really wanted to be a control freak you could have a second line for Start move.

Your serial ring (most economical method of interconnecting a bunch of microcontrolers) is used to queue up the moves.

Start commences the moves and no board commences the next until the wired "or" becomes deasserted.

An example of an implementation of a wired "or" is a line pulled low with a pull-down (0v or gnd) resistor on the controller board and a transistor switching the line high ( 5v, Vcc, Vdd etc) on each axis board.

Monitoring the Start and Wired "OR" line state is one digital io pin of your microcontroler each and both can actually be ignored once the move has started so polling the lines when doing nothing else is doable.

Note:-

1. a move can be as small as one step.
2. moves can be prequeued and the queues topped up as they run down but each move remains synchronised via start and the Wired "or" finished or move in progress.
3. The serial or buss protocol is irrelevant you can use what ever you want (RS232, 422, CAN, USB, Spacewire, DS, ieee1394)
4. Wether your axis controller is Classically Stepper or Classically Servo Motor is also irrelevant and will work.
5. non single step synchronization is useful to move a tool head rapidly around a tool space when it is not actually working. ie a clear seek to the corner of a board to clean the tip on a brush for example.


The wired protocol outlined is two extra lines in the ring.

Whilst a wired "or" and Start line don't need to be connected ring style, it will make no difference and also give some redundancy of connectivity to a pair of lines that are arguably important.

Thoughts for what they are worth (Although I am sure that someone has already had them somewhere)

aka47


Necessity hopefully becomes the absentee parent of successfully invented children.
VDX
Re: Arduino as simplified comm/controller board
December 20, 2007 05:18AM
... i only can make real syncing with a controler when driving the CLOCK-signal synchrone to all motors.

Look in the Bresenham-algorhythmus for 2D- or 3D-interpolating of linear moving - this works ideally for stepper-motors, when every 'step' in the line is outputted as CLOCK for the corresponding motor ...

Viktor
Re: Arduino as simplified comm/controller board
December 20, 2007 05:51AM
Viktor

I think we are agreeing.

Where each move is single step the start line is synchronous on a step by step basis and therefore in reality equivalent to a clock.

You don't therefore need all axis controllers resident on one board, although you can make it so if you like.

You can also have as many axis controllers as you want. Try 5 for example and make articulated arm.

Where you are planning a move or moves that don't need synchronization you can let the axis controllers get on with it at their individual fastest and all will know when the end point has been reached for all axes, whatever speed/technology.

As I understand it you could also have a mixed system, it wouldn't matter.

Heresy or what... smoking smiley

aka47


Necessity hopefully becomes the absentee parent of successfully invented children.
Re: Arduino as simplified comm/controller board
December 20, 2007 02:13PM
Personally, I'd go with simplicity over cost. No exclusively but I think it's far better to simply have DIR and CLOCK seperate for each motor, with 3 motors thats only 6 pins, 6 pins for an entire cartesian movement system. Okay, then add 6 pins for the limit sensors, 2 for each axis. So we've used 12 of the Arduino's 14 digital pins, and we want to leave pin0 and pin1 open for USB/Serial communications.

That is all the digital pins used up. But wait, what is this, according to the above posts the Analog pins (0-6) can also be used as digital pins, addressable as 14-19. 6 analog in/digital pins should be enough for an material depositor ( I can only see the need for 3, heater(dout), thermistor(ain) and extruder(dout)). Therefore the Arduino is perfectly suited to a Darwin RepRap. And I shall be using this.

My only reservations are the amaount of code space on an ATMega168, However I'm sure they'll release a more updated version of the ATMega168 soon, as the 168 was preceeded by 88 and 8, the new one may be a ATMega328 (won't that be fun?).
Re: Arduino as simplified comm/controller board
December 20, 2007 04:43PM
hey guys,

i'm not entirely sure what you're discussing here, but what you're describing is how the generation 1 electronics are setup: you have separate microcontrollers for each stepper driver board, and you need an extra link between each board to transmit the sync signal.

however, with the arduino boards, the control of the motors is syncronized and it knows exactly when to send the step signal for each motor. therefore you dont need a sync line, and can just send the signals directly

as for if the arduino is capable of controlling a full reprap directly, the answer is yes it can!! like i said, i finished the firmware and am going to test it tonight as well as finish documenting it over holiday break. the un-optimized program fits on the arduino nicely (12900 bytes / 14600 bytes) also, you're correct: the ATMega328 is due to be released in jan/feb of 2009 and will boast a massive 32k of flash memory... more than enough to hold a large reprap firmware.

cheers!
Anonymous User
Re: Arduino as simplified comm/controller board
December 21, 2007 05:11AM
It is possible to use only one pin for both limit switches. Since the firmware knows what direction it was going, it also knows what limit switch it hit. And for the extruder motor you need either two pins (forward and backward), or 1 pwm pin. The extruder motor needs to run in reverse sometimes to reduce drips at the end of a line (or to remove a bit of polymer that got messed up).

And Zach, Great news! I cannot wait to see the firmware you wrote. Using the Arduino really simplifies the whole RepRap (to a level where you can use a standard CNC machine for a RepStrap even). Great work!

--Blerik
Re: Arduino as simplified comm/controller board
December 21, 2007 04:12PM
Re: Arduino as simplified comm/controller board
December 21, 2007 05:09PM
Well...That was to the point =)

Thanks Zach!


--TJ
(Hey my first post!)
Re: Arduino as simplified comm/controller board
December 23, 2007 09:17PM
Has anyone (beside Zach) been able to compile Single_Arduino_Snap.pde - seems like I might be missing some files or something.

details here in this new thread
[forums.reprap.org]

Probably a mistake on my part, but looking to see if anyone has downloaded the files and compiled them.
Re: Arduino as simplified comm/controller board
December 23, 2007 09:57PM
Hi Sparrow,

Yep, had no problems with Single_Arduino_Snap.pde. You do need to make sure that the included Library files are copied to the ../Arduino/Hardware/Library directory where you installed Arduino. That should do the trick.

TJ
Anonymous User
Re: Arduino as simplified comm/controller board
December 24, 2007 05:59AM
Nice work! Very clean design with everything in libraries.

At first glance, why is extruder thermistor configured as pin0? Shouldn't that be analog0-5 or pin6 or pin7?

--Blerik
Re: Arduino as simplified comm/controller board
December 24, 2007 07:54AM
Quote

At first glance, why is extruder thermistor configured as pin0? Shouldn't that be analog0-5 or pin6 or pin7?
blerik,
I think that will mean analog0. pin0 and pin1 are serial rx or tx.
I haven't read/understood the code yet but he probably is using analogRead(0) to get the thermistor value.

Zach. I got it all to compile! Just had to copy all the library files to my Arduino>hardware>libraries folder and click on the confirm button. First try!

Congratulations!

Now I'll try the read/understand routine in my head to see if I can just switch to your code instead of mine. Also means I'll have to get the reprap software to run on my system. ouch. I hate java.
Anonymous User
Re: Arduino as simplified comm/controller board
December 24, 2007 08:54AM
Arvin,

You're right. Analog0 is Pin14, and Zach isn't using that. Might be good to document this in the sketches.

--Blerik
Re: Arduino as simplified comm/controller board
December 24, 2007 12:26PM
I got the latest SVN to compile... but at least revisions 1210 and 1217 have a typo where "ThermoPlast" has the "P" capitalized on an include filename and you have to correct this (at least for most file systems on Linux)

Also found you need to delete the .o files in library tree to get them to actually recompile.

Edited 1 time(s). Last edit at 12/24/2007 12:31PM by RoundSparrow.
Re: Arduino as simplified comm/controller board
December 24, 2007 02:49PM
Merry X mas everyone.

I have managed to avoid my daughter painting everyone's finger nails now so can go back downstairs now.

>grinning smiley<


Necessity hopefully becomes the absentee parent of successfully invented children.
Re: Arduino as simplified comm/controller board
December 24, 2007 03:29PM
I tested the software, reading pin #0 does indeed return the correct temperature (confimed by heating up the thermistor). Reading pin #14 returns 85c constantly. So Zach must have it right.

Only problem I seem to notice with the firmware is that between close/open of the programs it doesn't seem to return all the boards to a known state. I have to basically power down the boards to get everything to come out consistent every time. For example, the stepper motors show reverse direction (red LED) on some starts even when following the same software startup procedure. A reset of the hardware _before_ starting any software always returns things to predictable state.

Great work Zach!
Re: Arduino as simplified comm/controller board
December 27, 2007 12:22PM
hey guys!

this is awesome! i'm glad you guys are compiling and enjoying my code. this was a v1.0 release so its a bit rough around the edges.

yes, the thermistor pin is analog0, i'll update the code to make that more apparent.

secondly, i've been working on the code over winter break and i'll be making a v1.1 release here when i get back and am able to test it. basically there is one major improvement:

ince Arduino is a modern microprocessor, it has onboard analog to digital converters. therefore, we can do an analogRead and get a value! that gets converted internally to celsius. unfortunately, the host software talks temperature as PIC timer readings do to the old way of measuring temperature. however, the host software contains functions to go from PIC timer -> celsius and vice versa. i ported them to the arduino and they seem to work just fine.

what this means is that with the v1.1 release, the arduino will be 100% compatible with the current host software. i just gotta test it in a real machine and then i'll make a new release.
Re: Arduino as simplified comm/controller board
December 08, 2008 03:58PM
For people who think CANopen is a good way , and not for insulting people that thinks it's not , why not working on CANopen on the builder wiki ? and coordinate our efforts there ?

CANopen software considerations :
[objects.reprap.org]
CAN hardware :
[objects.reprap.org]

People who don't believe in RS485/USB/pigeon over ethernet , custom communications protocols and centralized architecture are welcome.
Re: Arduino as simplified comm/controller board
December 08, 2008 04:36PM
Great idea! smileys with beer
check this out
[vimeo.com]
it's from the creator of reprap i think, using the arduino for the complete control of a reprap.
it looks like a rather simple setup, and as someone that is new to electronics and wanting to build my first 3d printer, it looks like it may be a really good option.
VDX
Re: Arduino as simplified comm/controller board
July 04, 2011 03:11AM
... check the dates of the last posts winking smiley


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: Arduino as simplified comm/controller board
August 11, 2011 12:47AM
i am panning to have a single Arduino and a stack of stepper motor s.Which are places one atop another? I hope that would work as i could hook the stepper drivers up to a single nice big heatsink, keeping everything aligned nicely. Please give me your suggestions . I

I really need your help.

With Regards
John paul
Led lighting
Sorry, only registered users may post in this forum.

Click here to login