Welcome! Log In Create A New Profile

Advanced

modifica firmware per duet

Posted by zaius 
modifica firmware per duet
March 15, 2014 09:21AM
Ciao,
chiedo umilmente un aiuto.
Mi sono progettato una 3d ed ho acquistato una scheda duet piu espansione, [blog.think3dprint3d.com]
Durante colloqui con uno dei progettisti avevo chiesto l possibilità di utilizzare l'espansione per duplicare i segnali di controllo stepper per gli assi x,y, e z poichè ho installato 2 motori per asse. Mi avevano confermato che si poteva.
Ho scritto nuovamente oggi chiedendo come e mi dicono che mi devo modificare il firmware da solo.
Io non sono softwarista per cui ho dei problemi.
Chiedo aiuto a voi esperti.
Grazie in anticipo pe ril vostro supporto.
Andrea.
Re: modifica firmware per duet
March 15, 2014 04:12PM
Ciao, presumo che tu debba rimappare i pin corretti nel file pin.h.
Purtroppo non ho mai avuto modo di provare quella scheda.


Ivan Bortolin
Stampa 3D e prototipazione rapida Friuli, Italia
MendelMax, Ramps 1.4, Marlin V1
Re: modifica firmware per duet
March 15, 2014 05:07PM
Ciao, premetto che non conosco la scheda ma....
Ho dato una sbirciata al sito che produce la duet e ho trovato questo:


Quote
http://blog.think3dprint3d.com/
Panoramica del software

Il Duet usa un RepRap Firmware nuovo in C + + compilato da Adrian Bowyer.
Il firmware può essere compilato con l' Arduino IDE (testato con 1.5.4) o Eclipse e caricato come gli altri firmware, ma l'obiettivo è per gran parte delle informazioni specifiche stampante da impostare da Gcode che viene letto all'avvio della macchina dalla scheda SD .

RepRap Firmware


forse è quello che cercavi?
Re: modifica firmware per duet
March 17, 2014 02:41PM
Ciao Alex,
grazie x l'interesse!
Stasera verifico!
Andrea.
Re: modifica firmware per duet
March 19, 2014 12:48PM
Ciao,
dopo aver letto 10 forum non ne vengo fuori.
Ho caricato un file.bin scaricato da github e la scheda funziona.
Il file .ino è vuoto. Non so se ci sono altri siti dove posso trovarlo.
Mi sembra di aver capito che devo caricare eclipse, arduino plug-in, librerie varie.
Ho provato ma è un casino!
Come avrai capito non sono un softwarista e riesco a lavorare solo su arduino IDE.
Conosci un metodo per avere un file .ino e quindi aprire il firmware su arduino IDE?
Grazie mille.
Andrea.
Re: modifica firmware per duet
March 19, 2014 12:59PM
Prova a guardare questi file.... c'è anche un pdf....

[github.com]

Scusa se non riesco ad aiutarti meglio, ma proprio non conosco la scheda..... ci provo... vedrai che ne veniamo a capo cool smiley
Re: modifica firmware per duet
March 19, 2014 01:56PM
Grazie mille. Ho guardato ma purtroppo ci sono solo schemi. Se sapevo che era così complessa non l'avrei mai acquistata. Mi ha attirato il fatto dei 32 bit e degli 8 stepper driver
Re: modifica firmware per duet
March 19, 2014 04:51PM
Bhe, io non mi arrendo.... continuo a cercare.... non deve mica vincere lei...
Re: modifica firmware per duet
March 20, 2014 02:57AM
Ieri ho scritto al progettista ( Tony Lock, con il quale sono in contatto ancora prima di acquistarla) che è molto cortese e mi risponde sempre.
Alla mia nuova richiesta di supporto ha detto che forse riuscirà ad aiutarmi. Secondo me la duet è la migliore board per 3d (forse anche esagerata per movimenti cartesiani), 32 bit e driver a sufficienza per fare quello che vuoi. Tra parentesi costa un botto ma voglio che il mio progetto parta da un buon livello (ho speso parecchio anche per la meccanica).
E' da un pò di tempo che "gioco" con arduino e, dopo mesi di studio (non sono un softwarista) sono riuscto a fare cose per me ininmmaginabili.
Devo riuscire a venirne fuori. Nel frattempo ho comunque acquistato una ramps ed inizio con questa, ma è solo per testare la meccanica.
Speriamo...
Andrea.
Re: modifica firmware per duet
April 07, 2014 07:01PM
Hi Zaius, all

Going to have to respond in English here, sorry for the delay but I missed this post.

I hope the blog post about how to work with the firmware is a place to start:
Setting up Eclipse for Duet

That shows how to get in a position to modify the firmware but does not help with the changes to make. To do that have a look within "platform.h" for the function :

inline void Platform:: Step(byte drive)

In this you see it will step whatever drive is is requested to be stepped. There is some extra complexity there because the Duet uses more pins than the Ardunio Due, so it first checks to see which drive is being stepped and then either uses the standard Due pin:
digitalWrite(stepPins[drive], 0);

, or the library for the non Due pins
digitalWriteNonDue(stepPins[drive], 0);


The "drive" referred to is simply one of these values:
#define X_AXIS 0  // The index of the X axis
#define Y_AXIS 1  // The index of the Y axis
#define Z_AXIS 2  // The index of the Z axis
#define E0_DRIVE 3 //the index of the first Extruder drive
#define E1_DRIVE 4 //the index of the second Extruder drive
#define E2_DRIVE 5 //the index of the third Extruder drive
#define E3_DRIVE 6 //the index of the fourth Extruder drive
#define E4_DRIVE 7 //the index of the fifth Extruder drive


This is from the multi extruder version of the firmware So supposing you decided to have the following configuration:

X_AXIS and E2_DRIVE = your X Motors
Y_AXIS and E3_DRIVE = your Y Motors
Z_AXIS and E4_DRIVE = your Z Motors

You would need to make some changes to the "inline void Platform:: Step(byte drive)" function so that every time the firmware called for a specific axis, you also captured the second axis and stepped that as well. The code bwlow is one way to do it which is quick and dirty. There is probably a more elegant way but this will probably work.

//modified to duplicate drives
//X_AXIS and E2_DRIVE = X Motors
//Y_AXIS and E3_DRIVE = Y Motors
//Z_AXIS and E4_DRIVE = Z Motors
inline void Platform:: Step(byte drive)
{
	if(stepPins[drive] < 0 || drive > 4) //exclude E2, E3, E4 as they are second motors for X, Y, Z
		return;
	byte driveDuplicate = -1;
	if(drive == X_AXIS)
		driveDuplicate = E2_DRIVE;
	else if(drive == Y_AXIS)
		driveDuplicate = E3_DRIVE;
	else if(drive == Z_AXIS)
		driveDuplicate = E4_DRIVE;

	if(!driveEnabled[drive] && enablePins[drive] >= 0)
	{
		if(drive == Z_AXIS || drive==E0_DRIVE) //ENABLE_PINS {29, 27, X1, X0, 37, X8, 50, 47}
			digitalWriteNonDue(enablePins[drive], ENABLE);
		else
			digitalWrite(enablePins[drive], ENABLE);
		driveEnabled[drive] = true;
	}
	//enable the duplicate drive if required
	if(driveDuplicate >=0 && !driveEnabled[driveDuplicate])
	{
		if(driveDuplicate ==E2_DRIVE)
			digitalWriteNonDue(enablePins[driveDuplicate], ENABLE);
		else
			digitalWrite(enablePins[driveDuplicate], ENABLE);
		driveEnabled[driveDuplicate] = true;
	}
	if(drive == E0_DRIVE) //STEP_PINS {14, 25, 5, X2, 41, 39, X4, 49}
	{
		digitalWriteNonDue(stepPins[drive], 0);
		digitalWriteNonDue(stepPins[drive], 1);
	} else
	{
		digitalWrite(stepPins[drive], 0);
		if(driveDuplicate == E3_DRIVE) //STEP_PINS {14, 25, 5, X2, 41, 39, X4, 49}
		{
			digitalWriteNonDue(stepPins[driveDuplicate], 0);
		} else
		{
			digitalWrite(stepPins[driveDuplicate], 0);
		}
		digitalWrite(stepPins[drive], 1);
		if(driveDuplicate == E3_DRIVE) //STEP_PINS {14, 25, 5, X2, 41, 39, X4, 49}
		{
			digitalWriteNonDue(stepPins[driveDuplicate], 1);
		} else
		{
			digitalWrite(stepPins[driveDuplicate], 1);
		}
	}
}


You will need to follow some of the logic to other areas of the firmware to confirm that still works as expected (for example the homing I have not checked).

Let me know how you get on!

Cheers

Tony


DuetWifi.: advanced 3d printing electronics
Sorry, only registered users may post in this forum.

Click here to login