#3229
theremino
Amministratore del forum

Questo programmino di automation dovrebbe aiutarti, produce movimenti random in XYZ molto simili al tuo esempio.
Se hai bisogno di modificarlo per aggiungere la posizione del comparatore chiamami e ti aiuterò.
L’idea sarebbe di riuscire a ottenere l’errore anche senza Theremino CNC e quindi eliminare una grossa parte di possibilità dalle ricerche.


v1 = 0 		' Random Minimum
v2 = 10		' Random Excursion

v5 = 1		' Counter start
v6 = 50		' Counter end

Label MainLoop
	Gosub WaitAllMotOrs
	Slot(1) = v1 + v2 * Rnd
	Slot(3) = v1 + v2 * Rnd
	Slot(5) = v1 + v2 * Rnd
	v5 = v5 + 1
	Print v5 & " of " & v6
	If v5 >= v6
		Goto End
	EndIf
Goto MainLoop

Label End
	Slot(1) = 0
	Slot(3) = 0
	Slot(5) = 0
End

Label WaitAllMotors
	Wait Seconds 0.1 ' ---- ensure motors really started
	Label WaitAllMotors2
		If Abs(Slot(2)) + Abs(Slot(4)) + Abs(Slot(6)) < 0.01
			Return
		EndIf
	Goto WaitAllMotors2
' End of WaitAllMotors