Welcome! Log In Create A New Profile

Advanced

Arduino vs Sanguino Software

Posted by Adam.m.Nelson 
Arduino vs Sanguino Software
December 16, 2009 07:53PM
I am having firmware issues, so here's my question. Is the Sanguino and Arduino firmware the same, or different. I downloaded the firmware for the Darwin (that seems to be the last time arduino software was used), is this the proper firmware?

The new Mendel design seems to only allow for the RepRap mother board, and other RepRap boards; there shouldn't be a difference between the the two is there (other then the thermocouple)?

Thanks in advance.
Re: Arduino vs Sanguino Software
December 16, 2009 08:35PM
arduino is too small to hold all the latest developments. the sanguino is a much larger chip with more flash, more I/O and more features.

If you can find a way to connect everything to an arduino and fit all the necessary processing on it, by all means use it.
Re: Arduino vs Sanguino Software
December 16, 2009 08:37PM
crapppp, so new mother board here I come!
Re: Arduino vs Sanguino Software
December 16, 2009 08:46PM
Thanks!
Re: Arduino vs Sanguino Software
December 16, 2009 09:32PM
The new arduino boards come with the ATMEGA328P which doubled the amount of memory available and is a direct replacement for the older 168P chip. You can upgrade an old board by purchasing a new chip. Adafruit has the chip with bootloader installed for $6.00 here: [www.adafruit.com]
Re: Arduino vs Sanguino Software
December 16, 2009 09:40PM
"ATMEGA328P" is the P what is different in the ID? The chip I have is a ATMEGA328 no P
Re: Arduino vs Sanguino Software
December 16, 2009 09:51PM
What features will be lost if we stick with the chip we have (the one with lesser memory). Is it the stepper reversing and such that will be lost?
Re: Arduino vs Sanguino Software
December 16, 2009 10:24PM
I have a fully functional reprap using much less than 16kb.
The loss is that you can't use accelerated 5D Gcodes with the firmware
straight out of the box. (as it were).

regards

Stephen.

P.s. Happy to share my modified firmware if you are intersted. Its the offical version with a few bugs removed.

P.s. Gen 4 electronics is due out next Feb I believe.Might be an idea to wait before buying Gen 3 electronics.
Re: Arduino vs Sanguino Software
December 16, 2009 11:25PM
My RepRap is pretty much finished, and I would LOVE your firmware if it works on the original chip. We don't need the acceleration at all for now (i may upgrade in the future)

We did the electronics last (we're both Electronic Engineering Technologists, so we weren't worried about the electronics not working winking smiley )
Re: Arduino vs Sanguino Software
December 17, 2009 12:11AM
Dang a six dollar chip on a board with replaceable chip, verse hours to try and shoehorn code growth into a tight area, seems to be a win/win solution if you can double the flash and ram.

If you are international and can't order from Adafruit. Since you have this board and that you can bitbang the appropiate bootstrap into it.

[www.ladyada.net]

[www.geocities.jp]
Re: Arduino vs Sanguino Software
December 17, 2009 08:07AM
The old Arduinos used the ATMega168P. I think, I know the number was 168, but I'm not sure if the P was there.

Judging by the list of chips on the Atmel site I believe there is only one ATMega328, and it is P.



Darwin clone, Gen 2 electronics, Arduino Duemilanove w/ AtMega328, 5D Firmware, Pinchwheel extruder
[www.codeerrors.com]
Re: Arduino vs Sanguino Software
December 17, 2009 09:06PM
Hi Fred

> Dang a six dollar chip on a board with replaceable chip, verse hours to try and shoehorn code growth into a tight area, seems to be a win/win solution if you can double the flash and ram.

I suppose it depends if you are one of the billion people on earth who earn less than $2 USD per day or someone from a first world country.
$6USD would represent 3 days work.

The firmware in question has a lot of redundant code (for example drilling and
valve code) which can be removed with #ifdef commands and parameters.

e.g.

//#define I_HAVE_A_DRILL

#ifdef I_HAVE_A_DRILL
Large lump of code.
#endif

This is what I have done in my version. Which I will upload tonight when I get home for anyone who want's it.

regards

Stephen
Re: Arduino vs Sanguino Software
December 17, 2009 09:09PM
I would like it. Thanks Stephen (it saves me the two weeks it takes to get anything shipped out of the states winking smiley
Re: Arduino vs Sanguino Software
December 18, 2009 04:06AM
As promised here is my latest code.

I have got it set to switch off the stepper motors when not in use and the temperature of the extruder is defaulted to 200c so it is ready to use when my PC has booted.

You probably want to go through the parameters.h to enable or disable any code.

Good luck

Stephen

P.s. All disclaimers. Code given as is with no warranty.

Edited 1 time(s). Last edit at 12/18/2009 04:10AM by stephen george.
Attachments:
open | download - GCode_Interpreter_v17.zip (25.7 KB)
Re: Arduino vs Sanguino Software
December 18, 2009 04:15AM
p.s You probably want to comment out #define DEBUG_M101_why_have_you_stopped

I was using it to debug why the extruder kept stopping on every layer.
Turns out it was a code fault in the original firmware.

You also will need to switch global.FiveD=false in the reprap host software

Give us a shout if you have any problems.

regards

Stephen

Edited 1 time(s). Last edit at 12/18/2009 04:17AM by stephen george.
Re: Arduino vs Sanguino Software
December 20, 2009 08:39PM
Hi Adam.m.Nelson

How did it go?

Stephen
Re: Arduino vs Sanguino Software
December 20, 2009 08:45PM
Hey,

Things have been busy and I haven't gotten to it yet. Where do I download your firmware?
Re: Arduino vs Sanguino Software
December 21, 2009 12:33AM
Look at

Attachments: GCode_Interpreter_v17.zip (25.7 Kcool smiley

On reply Date: December 18, 2009 01:06AM

regards

Stephen
Re: Arduino vs Sanguino Software
January 15, 2010 03:36PM
Hey Stephen,

I got your code configured and loaded, but i am having issues. I can't seem to get anything to report back from the Arduino. If I leave the Arduino board on USB 5V and common ground the boards i still get nothing. If I run the Arduino off on the 5 V from my power supply (with common grounds) weirdness breaks out.

RepRap will report 0 degrees C but the Z MAX LED comes on. it only goes off if i unplug the arduino breakout board all together, or unplug the USB Cable.

Ugh. If i touch the gnd on the usb to the gnd on the board three lights come up, and when i plug the cable back in two opto switches blink (opposite of each other. one is the ZMAX).

This has got to be a ground loop issue.

Any ideas? (Maybe i should make a new thread for this)
First relax.
The first time I uploaded the offical bios my reprap tried to kill itself by shaking it self apart.

We need to start from the begining.

1) attach the arduino to the computer and upload the bios/firmware without any changes to the parameters. i.e. How I sent it to you. This should be in a working state as it would have been taken from my working system

2) Go into the serial comunicator on the arduino IDE. Its the button that next to the upload button. We need to comunicate directly with the arduino.

3) Now select a speed of 19200 bps. This is the speed the arduino comunicates at.

You should get a "start" thrown back at you due to the following code in the the Gcode_interpreter.pde

Serial.begin(19200);
Serial.println("start");

Notice : at this stage we don't need to have anything attached to the pins of the arduino. It's just the arduino and computer talking. If you can't get to this point your arduino / USB cable / computer has a problem.

4) The serial comunicator does not send new lines. (Probably due to the C code standards). This is a real pain as the offical bios/firmware uses newlines as an end of line terminator.

Anyway to test the reprap we need to send some G codes to it

So either download some serial code /terminal emulator program such as minicom or reload the bios/firmware with

//#define PROCESS_STRING_serial_monitor_debug

un remmed i.e.

#define PROCESS_STRING_serial_monitor_debug

ie no //

This will modify the bios/firmware to accept ; as well as a newline (/n) and as a result to get the inbuilt serial comunicator to work. (which is very convient)

If you have done this you should get

WARNING. Serial monitor debug ON terminate commnds with ;
e.g. M105; or G01 X500. F100;

Due to the code below being activated

#ifdef PROCESS_STRING_serial_monitor_debug
Serial.println("WARNING. Serial monitor debug ON terminate commnds with ;");
Serial.println("e.g. M105; or G01 X500. F100;");
#endif

5) Now send M105; to the bios and see what you get and tell me how you go.

regards

Stephen
Re: Arduino vs Sanguino Software
February 11, 2010 11:45PM
Hi Stephen,

I'm using your firmware above with a stepper driven pinch wheel extruder that I milled out of Aluminum.

The extruder barrel will heat up to the temperature pre-set on the firmware (i.e 200c) and stay there, then when I send a M101 command it will start extruding however I've noticed that the heater will stop heating the barrel (I can see the LED turn off on the PWM output) and will never turn on again even if I send M104 S200; to set the temperature again.

I suspect it's probably something wrong on the firmware? Can you help?

I assume is the firmware because I used the same version above (but obviously different configuration) when I had my DC Motor extruder and it worked well. Only reason I switched to the stepper extruder is because the DC Motor Extruder was having trouble grabbing the plastic rod and will not extrude uniform thickness.

Hopefully you can help me.


Regards....

Luis Freeman.
Re: Arduino vs Sanguino Software
February 14, 2010 06:10PM
Hi Luis

I will have a look into it and see what I can do.

Have you made any other changes to the firmware?

Stephen
Re: Arduino vs Sanguino Software
February 14, 2010 07:29PM
Thanks Stephen !!!

I haven't done any changes other than the configuration (parameters.h, pins.h). Let me know if you want me to send you those files.

Regards...

Luis Freeman
Re: Arduino vs Sanguino Software
February 15, 2010 01:25AM
If you could upload all the files that would be great.
That way I have the whole story.

Thanks

Stephen
Re: Arduino vs Sanguino Software
February 15, 2010 01:53AM
You said
The extruder barrel will heat up to the temperature pre-set on the firmware (i.e 200c) and stay there, then when I send a M101 command it will start extruding however I've noticed that the heater will stop heating the barrel (I can see the LED turn off on the PWM output) and will never turn on again even if I send M104 S200; to set the temperature again.

My reply
Does the extruder keep going even though the temperature light is off ?
Does it stop eventually of just keep going untill the plastic does not melt?



regards

Stephen
Re: Arduino vs Sanguino Software
February 15, 2010 09:23PM
Hi Stephen,

Here are the answers....

Does the extruder keep going even though the temperature light is off ?
** The extruder stepper will keep going even though the heater light goes off.

Note that I am able to continue to send serial messages (i.e M101, M102, M103, M105). However, it comes to a point where if I send a M101 the serial won't print OK and i won't be able to send any more commands. I think this is normal behavior because the firmware waits for the extruder to reach temperature before executing M101 (moving the stepper forward), but because the heater is no longer heating it never reaches temperature staying on an infinite loop.

I'm attaching the output of the serial for your reference. I'm also attaching a copy of my firmware.


Does it stop eventually of just keep going until the plastic does not melt?
** The extruder stepper keeps going even after the plastic does not melt. Plastic won't extrude obviously but the stepper keeps trying. I can issue a M103 after that and it will stop. However, if I issue M101 again thou it will loop as described on previous answer.
Attachments:
open | download - GCode_Interpreter.zip (170.1 KB)
open | download - Serial.txt (510 bytes)
Re: Arduino vs Sanguino Software
February 15, 2010 10:22PM
Hi

Please could you update the serial.txt with what is going on.

e.g.

M105;
T:200
ok
M101;
ok
// Temperature light has gone off
// motor is running forward
Press reset
// Temperature light on

etc

So I can step through the code and work out what is going wrong.

The interesting thing is that the light should never go off.

i.e

Code extract from extruder.pde
heater_low = 64;
heater_high = 255;
end Code extract from extruder.pde

Heater on - set to 255 ie bright led
Heater off - set to 64 i.e. not a bright led but still on.

Is the led out ie set to 0 ie off or 64?

Do you feel up to changing the parm
heater_low = 64;
to
heater_low = 200;

?? to see if the led is set to 0 or heater_low.

Note Dont keep this value for heater_low as it means the heater can't be turned off. Just do it temporarily for testing purposes and chnage it back.
before you forget and report back.

Note. Be carefull out there. All disclaimers

If you feel this is too much for you I will have to hook a stepper up
myself and see what is going on. However this may take time.

Only proceed if you are confident in what you are doing.

Stephen
Re: Arduino vs Sanguino Software
February 15, 2010 11:12PM
You said
Note that I am able to continue to send serial messages (i.e M101, M102, M103, M105). However, it comes to a point where if I send a M101 the serial won't print OK and i won't be able to send any more commands. I think this is normal behavior because the firmware waits for the extruder to reach temperature before executing M101 (moving the stepper forward), but because the heater is no longer heating it never reaches temperature staying on an infinite loop.


My reply
Yes you are quite right the system will stop if the extruder gets to cool.

Please enable
//#define DEBUG_M101_why_have_you_stopped

i.e
#define DEBUG_M101_why_have_you_stopped

And recompile and upload

This will enable the code in extruder.pde as follows

#ifdef DEBUG_M101_why_have_you_stopped
oldT = get_temperature();
Serial.print("STOPPED - extruder is too cold = ");
Serial.print(oldT);
Serial.print(" - Target temp = ");
Serial.println(target_celsius - HALF_DEAD_ZONE);
#endif

If this fires we can add more serial prints to see what is going on with the
other variables.

varaibles of interest would be

heater_low
heater_high
newheat

again if you are not up to this I should be able to add an extruder in the not to distant future and see what is going on.

regards

Stephen



ie
Re: Arduino vs Sanguino Software
February 15, 2010 11:31PM
Hi Stephen,

I changed heater_low to 200, uploaded and tested. Same results... waited for heater to reach temperature, entered M101; and the heater light went completely off.

I'm now wondering If I may have a short to another pin on the arduino that gets shorted to ground (logic zero) when the extruder stepper is activated. Or perhaps a code of line on the firmware is treating the heater output as digital vs analog (PWM), where a value of 1 would pretty much show as almost a zero if shown as PWM.

It's close to midnight here now and it's time to go to bed. I'll try tomorrrow rewiring the heater to a different pin on the arduino and to a different channel on the PWM driver and see if that fixes the problem. That should help us discard potential hardware problems. Thanks for all your help.

I'll also try Debug_M101_why_have_you_stopped tomorrow as well and let you know my findings.

I'm attaching the serial file with the comments you asked.
Attachments:
open | download - Serial.txt (882 bytes)
Re: Arduino vs Sanguino Software
February 16, 2010 01:47AM
I think I have got it.

Grin.

Your pin outs are as follows

//#define EXTRUDER_1_TEMPERATURE_PIN (byte)0 // Analogue input

.....

// if you don't have a stepper motor for the extruder ensure #define EXTRUDER_dc_motor is uncommented in parameters.h
// if you do have a stepper motor for the extruder ensure #define EXTRUDER_stepper_motor is uncommented in parameters.h
#define EXTRUDER_0_STEP_ENABLE_PIN (byte)14 // 5 - NB conflicts with the fan; set -ve if no stepper

hmmm where is digital pin 14?

We have digital 1-13 on the arduino and analog 0-5 which can be
converted to digital pins.

So Analog pin 0 is also digital pin 14.

So your extruder and temperature pin as far as the reprap firmware are concerned are the same pin.

Perhaps you should change this?

regards

Stephen
Sorry, only registered users may post in this forum.

Click here to login