Link for last version for orionboard XYplotter


#1

On GitHub I see many version for XYplotter but wich one is real the last version
I need it to make any modification (remove response strings)


#2

I asked this very question here:

I don’t think there was a good conclusion so I just took the makeblock-official one and made my modifications on top of that. Probably not the best choice but maybe the safest.


#3

I Have found a version XYbot and I have add severall new command and also use the limit switch.
Second thin is
Some int variables must convert to long special in the Do Move

void doMove()
{
long mDelay=stepdelay_max;
long temp_delay;
long speedDiff = -SPEED_STEP;
long dA,dB,maxD;
float stepA,stepB,cntA=0,cntB=0;
int d;
dA = tarA - posA;
dB = tarB - posB;
maxD = max(abs(dA),abs(dB));
stepA = (float)abs(dA)/(float)maxD;
stepB = (float)abs(dB)/(float)maxD;

for(int i=0;(posA!=tarA)||(posB!=tarB);i++){
//Serial.printf(“step %d A:%d B;%d tar:%d %d\n”,i,posA,posB,tarA,tarB);
if ((!(digitalRead(xlimit_pin2)==0) && (dA<0)) || (!(digitalRead(xlimit_pin1)==0)&& (dA >0))){
// move A(X)
if(posA!=tarA){
cntA+=stepA;
if(cntA>=1){
d = dA>0?motorAfw:motorAbk;
posA+=(dA>0?1:-1);
stepperMoveA(d);
cntA-=1;
if (((digitalRead(xlimit_pin2)==0) && (dA>0))||((digitalRead(xlimit_pin1)==0)&& (dA <0))) {
tarX=posA/STEPS_PER_MM;
posA=tarA;
}
}
}
}
if ((!(digitalRead(ylimit_pin2)==0) && (dB<0)) || (!(digitalRead(ylimit_pin1)==0)&& (dB >0))){
// move B(Y)
if(posB!=tarB){
cntB+=stepB;
if(cntB>=1){
d = dB>0?motorBfw:motorBbk;
posB+=(dB>0?1:-1);
stepperMoveB(d);
cntB-=1;
if (((digitalRead(ylimit_pin2)==0) && (dB>0))||((digitalRead(ylimit_pin1)==0)&& (dB <0))){
tarY=posB/STEPS_PER_MM;
posB=tarB;
}
}
}
}
mDelay=constrain(mDelay+speedDiff,stepdelay_min,stepdelay_max);
temp_delay = mDelay + stepAuxDelay;
if(millis() - last_time > 400) last_time = millis();

if(temp_delay > stepdelay_max)
{
  temp_delay = stepAuxDelay;
  delay(temp_delay/1000);
  delayMicroseconds(temp_delay%1000);
}
else  delayMicroseconds(temp_delay);

if((maxD-i)<((stepdelay_max-stepdelay_min)/SPEED_STEP)){
  speedDiff=SPEED_STEP;
}  

}
posA = tarA;
posB = tarB;
}


#4