Welcome! Log In Create A New Profile

Advanced

Sanguino as Extruder Controller

Posted by eustace 
Sanguino as Extruder Controller
April 10, 2011 02:10PM
I would like to use a Sanguino that I already have instead of an Extruder Controller board that I would have to buy. To get the code to compile, I have to rem out these lines:

//#ifndef __AVR_ATmega168__
//#error Oops! Make sure you have 'Arduino Diecimila' selected from the boards menu.
//#endif

...then it will compile. But I wonder if I'm going to have trouble with the timer changes the code is making. The code here is beyond my simple C ability, so while I'm breadboarding my circuit, can anyone tell me if this will work or if I'm in trouble?
Re: Sanguino as Extruder Controller
April 11, 2011 11:34AM
Hi eustace

I may be mistaken, but I don't really see anything the extruder controller is doing as timing specific.

The extruder motor step and direction signals are coming from the motherboard via the SDA & SDL lines so I think the extruder controller is really only being used to monitor and turn heaters on and off (extruder and heated bed) and the fan. Of course the motor driver sits on the extruder controller board (talking Makerbot G3 design here) but that should be supplanted by an external stepper driver controller such as a Pololu...

I do not know what else the extruder controller may be doing.

I am sure the pro's may have something to contribute here so don't take my word as gospel.

You will not be able to use your sanguino directly as the output from the pins that turn on the heaters and fan will need to go through MOSFETs to ramp up the voltage. Don't ask me how as my knowledge there is dangerous smiling smiley

Cheers
Re: Sanguino as Extruder Controller
April 11, 2011 03:23PM
I think the extruder controller uses the same microprocessor as the motherboard so the speed should be the same assuming that the clock frequencies are the same. I think the difference between the microcontrollers is mainly in the amount of memory and io lines. The extruder controller has to respond to the SDA and SCL lines at every loop in order to drive the stepper motors. So, timing is critical. I didn't follow the firmware beyond that since I'm not using it as a stepper controller anymore after switching to a pololu. The temperature control is done at every 5000 loops by default.

Are you going to use this in combination to a Gen 3 MB?
Re: Sanguino as Extruder Controller
April 11, 2011 04:02PM
I'm planning on using the Sanguino with a bit of proto board to hold the extra components and to allow me to mount it normally.
I'll drive the heater thru a mosfet and use a pololu board to drive the stepper (with all the io pins a Sanguino has, I can wire up the pololu board to allow microstepping, even if I don't use it at first).
I guess my motherboard is Gen3; it's a reprap version 1.2 board. I'll give this a try tonight, but I'm keeping my expectations low; I'm having the same problems with the motherboard code compilation that other people are having here - recognize the thread, brnrd?
Re: Sanguino as Extruder Controller
April 11, 2011 04:16PM
You don't need to connect the pololu to the extruder controller that you're building. Just connect it directly to the MB. Just use your extruder controller for the heater, fan and temperature.

Yes, firmware issues can be very frustrating. It took me over 3 months of trying to make the five-D firmware work with the reprap host or repsnapper on the Mac. I'm now using Windows XP and so far it's working well with a Dec 2011 release.
Re: Sanguino as Extruder Controller
April 11, 2011 11:39PM
But if I run the step and dir wires from the mobo to my pololu carrier board, and then attach the microstepping control pins (ms1 thru ms3) to gpio pins on my extruder control sanguino, I might be making a ground loop or something - I'm not an electrical engineer, and that kind of wiring makes me nervous. And we were just discussing firmware issues; wouldn't I have to make firmware changes for the extruder controller to ignore missing motor signals? Of course, you might think "Why is he being shy about firmware changes when he's planning to do microstepping?" but I'm not going to be doing any microstepping soon - I just want to get the machine working (it's soooooo close!). The only reason I'm planning to wire the microstepping control pins is that I don't want to have to rework the board later. To "ignore" them now, I would have to wire them all to ground (full steps). Why not tie them to pins for later? I can add a few pin lows to setup(), that much change I can do from arduino experience. But all the cryptic #ifndefs in the firmware, and all those .h files, are scaring me.

Edited 1 time(s). Last edit at 04/11/2011 11:42PM by eustace.
Re: Sanguino as Extruder Controller
April 11, 2011 11:52PM
The microstepping select pins aren't controlled by the microcontroller. They are manually pulled high using either jumpers or switches to set the step size. Check out the wiki and thingiverse on electronics that use the pololu. There are only two lines in the Gen 3 MB that are used to control the stepper: dir and step. It would be nice if there's an enable line but I don't know if there are any pins left for it. For that, we would need a slight mod on the firmware. Not that hard though. It's common practice to replace the extruder controller with a stepper controller to run the extruder motor. It's actully better than using the extruder controller which was not really designed for driving a stepper motor.
Re: Sanguino as Extruder Controller
April 23, 2011 08:36PM
When you say that there are step and dir signals available on the motherboard, which pins are used? The only places in the motherboard firmware where those pins are referenced (that I can find, anyway) refer to the i2c pins 16 & 17 (SCL & SDA). But I can't just wire those to the pololu step and dir pins; they have 3.6K of resistance between them for i2c.

I found this page where a pololu stepper driver is being wired up just the way I said couldn't be done. When I try sending steps to my pololu via that pin (17, SDA) nothing gets through, at least nothing my scope can see. I thought it was because of the pullup resistors, R11 & R12. I don't understand this at all.

Please ignore the above. Wiring to those pins works fine, if you do it correctly. The pulses show up just fine, if you set up your scope properly. And the driver board is driving merrily along, now.

Edited 2 time(s). Last edit at 04/23/2011 10:46PM by eustace.
Sorry, only registered users may post in this forum.

Click here to login