@jay_s_uk You are totally right, I was questioning my sanity but I tried the same with a different driver and it worked now. I guess that my driver was broken. There were also some software issues.Thanks everyone for your help!

Best posts made by Kruix
-
RE: Connection issues to external Closed Loop Stepper Driver
Latest posts made by Kruix
-
RE: New Kinematics 3RRR Scara
@dc42
I implemented a forward kinematic for the Scara, but I don't know how to configure the motor axis,
for example with
M584 X0.0 Y0.1 Z0.2 U0.3for the kinematic 3 motors are needed to position the endeffector, Is there an example how to map one of the drivers on the U-axis in the Firmware?
bool CartesianToMotorSteps(const float machinePos[], const float stepsPerMm[], size_t numVisibleAxes, size_t numTotalAxes, int32_t motorPos[], bool isCoordinated) const noexcept = 0; { bool ok = true; float x= machinePos[0]; float y= machinePos[1]; double pi=3.14159265358979; vector<double> phi= {7*pi/6, 11*pi/6, pi/2}; vector<double> my= {pi/6, 5*pi/6, 3*pi/2}; vector<double> E= {0, 0, 0}; vector<double> F= {0, 0, 0}; vector<double> G= {0, 0, 0}; vector<double> K= {0, 0, 0}; vector<double> theta= {0, 0, 0}; for(int i=0; i<3;i++){ E[i] = -2*l1*(y+r*sin(rot+phi[i])+R*sin(my[i])); F[i] = -2*l1*(x+r*cos(rot+phi[i])+R*cos(my[i])); G[i] = pow(x+r*cos(rot+phi[i])+R*cos(my[i]),2.0)+ pow(y+r*sin(rot+phi[i])+R*sin(my[i]),2.0)+pow(l1,2.0)-pow(l2,2.0); K[i] = sqrt(pow(E[i],2.0)+pow(F[i],2.0)-pow(G[i],2.0)); theta[i] = 2*atan2((-E[i]-K[i]),(G[i]-F[i])); } vector<double> theta_temp =cart2threeRRR(0,0,rot,l1,l2,R,r); theta[0]=theta[0]-theta_temp[0]; theta[1]=theta[1]-theta_temp[1]; if(theta[2]>3){theta[2]=theta[2]-2*pi;} theta[2]=theta[2]-theta_temp[2]; motorPos[0]=stepsPerMm*theta[0]*180/pi; motorPos[1]=stepsPerMm*theta[1]*180/pi; motorPos[2]=stepsPerMm*theta[2]*180/pi; if (std::isnan(motorPos[0]) || std::isinf(motorPos[0])){ok=false;} if (std::isnan(motorPos[1]) || std::isinf(motorPos[1])){ok=false;} if (std::isnan(motorPos[2]) || std::isinf(motorPos[2])){ok=false;} return ok;
virtual void MotorStepsToCartesian(const int32_t motorPos[], const float stepsPerMm[], size_t numVisibleAxes, size_t numTotalAxes, float machinePos[]) const noexcept = 0; { //vector<double>theta, double R,double r,double l0, double l1 vector<double> theta={motorPos[0] * DegreesToRadians/stepsPerMm,motorPos[1] * DegreesToRadians/stepsPerMm,motorPos[2] * DegreesToRadians/stepsPerMm} double x,y,x0,x1,y0,y1,l1; l1=proximalArmLength; double a0=3/sqrt(3)*R; double h0=sqrt(3)/2*a0; vector<double> P1={-a0/2,-h0/2}; vector<double> P2={a0/2,-h0/2}; vector<double> P3={0,h0/2}; double a1=3/sqrt(3)*r; double h1=sqrt(3)/2*a1; vector<double> T1={-a1/2,-h1/2}; vector<double> T2={a1/2,-h1/2}; vector<double> T3={0,h1/2}; vector<double> Pjoint1={P1[0]+cos(theta[0])*l1, P1[1]+sin(theta[0])*l1}; vector<double> Pjoint2={P2[0]+cos(theta[1])*l1, P2[1]+sin(theta[1])*l1}; vector<double> Pjoint3={P3[0]+cos(theta[2])*l1, P3[1]+sin(theta[2])*l1}; vector<double> Pjoint1_virt={Pjoint1[0]-T1[0],Pjoint1[1]-T1[1]}; vector<double> Pjoint2_virt={Pjoint2[0]-T2[0],Pjoint2[1]-T2[1]}; vector<double> Pjoint3_virt={Pjoint3[0]-T3[0],Pjoint3[1]-T3[1]}; x0=Pjoint1_virt[0]; y0=Pjoint1_virt[1]; x1=Pjoint2_virt[0]; y1=Pjoint2_virt[1]; //positions of x and y axis machinePos[0]=(x0*x0 - x1*x1 + y0*y0 + 2*r*y0 - y1*y1 - 2*r*y1)/(2*(x0 - x1)) - ((y0 - y1)*(r + y0/2 + y1/2 - (x0*sqrt(-(- 4*l1*l1 + x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)/(x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)))/2 + (x1*sqrt(-(- 4*l1*l1 + x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)/(x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)))/2))/(x0 - x1); machinePos[1]=r + y0/2 + y1/2 - (x0*sqrt(-(- 4*l1*l1 + x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)/(x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)))/2 + (x1*sqrt(-(- 4*l1*l1 + x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)/(x0*x0 - 2*x0*x1 + x1*x1 + y0*y0 - 2*y0*y1 + y1*y1)))/2; }
-
RE: New Kinematics 3RRR Scara
@dc42
The MotorStepsToCartisian is a forward kinematic, is that function necessary to implement for testing? -
New Kinematics 3RRR Scara
Hello, I would like to implement the firmware for a 3RRR Scara,
which uses 3 Arms/Motors to set the XY position.
is there an easy way to test the kinematic from a function that outputs the coresponding angles from the backward transformation? ie.
The function outputs the angles for the motors from (0,0) after Homing.vector<double> CalculateAngles(double x, double y, double rot, double l1, double l2, double R, double r) { double pi=3.14159265358979; vector<double> phi= {7*pi/6, 11*pi/6, pi/2}; vector<double> my= {pi/6, 5*pi/6, 3*pi/2}; vector<double> E= {0, 0, 0}; vector<double> F= {0, 0, 0}; vector<double> G= {0, 0, 0}; vector<double> K= {0, 0, 0}; vector<double> theta= {0, 0, 0}; for(int i=0; i<3;i++){ E[i] = -2*l1*(y+r*sin(rot+phi[i])+R*sin(my[i])); F[i] = -2*l1*(x+r*cos(rot+phi[i])+R*cos(my[i])); G[i] = pow(x+r*cos(rot+phi[i])+R*cos(my[i]),2.0)+ pow(y+r*sin(rot+phi[i])+R*sin(my[i]),2.0)+pow(l1,2.0)-pow(l2,2.0); K[i] = sqrt(pow(E[i],2.0)+pow(F[i],2.0)-pow(G[i],2.0)); theta[i] = 2*atan2((-E[i]+K[i]),(G[i]-F[i])); } vector<double> theta_temp =cart2threeRRR(0,0,rot,l1,l2,R,r); theta[0]=theta[0]-theta_temp[0]; theta[1]=theta[1]-theta_temp[1]; if(theta[2]>3){theta[2]=theta[2]-2*Pi;} theta[2]=theta[2]-theta_temp[2]; return theta;
-
RE: Connection issues to external Closed Loop Stepper Driver
@jay_s_uk You are totally right, I was questioning my sanity but I tried the same with a different driver and it worked now. I guess that my driver was broken. There were also some software issues.Thanks everyone for your help!
-
RE: Connection issues to external Closed Loop Stepper Driver
@jay_s_uk
The question was because of the article in https://docs.duet3d.com/User_manual/Overview/Getting_started_Duet_3_MB6XD
that states at the bottom that
"The Step, Dir and Enable outputs from the 6XD are either low (when "on") or floating/high impedence when "off". "
thats why I assumed the R command would only refer to the Polarity of the Enable Pin -
RE: Connection issues to external Closed Loop Stepper Driver
@T3P3Tony
Is it possible to set the STEP/DIR Signal itself active High instead of pulling it to ground? -
RE: Connection issues to external Closed Loop Stepper Driver
@T3P3Tony
Firstly thanks for the support!
changing the Polarity didn't work. But one more question, if there is no error signal of a motor, nothing needs to be connected there, right?
What Polarity does the jumper change? Is the standard active high or low? -
RE: Connection issues to external Closed Loop Stepper Driver
https://docs.duet3d.com/User_manual/Connecting_hardware/Motors_connecting_external
Yes it didn't make sense to me too at least
-
RE: Connection issues to external Closed Loop Stepper Driver
@dc42 It didnt work with 1k or 500ohms pullup resistors
-
RE: Connection issues to external Closed Loop Stepper Driver
@dc42
I will try that out, thank you.
Is the wiring correct with?
EN -EN
STEP - STEP
DIR -DIR
GROUND -GROUND
or should it be connected like the polulu in the image above?