VASH321
Eurobricks Vassals-
Posts
20 -
Joined
-
Last visited
About VASH321

Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
I use http://pycam.sourceforge.net/ to create G-code which I than process on the nxt. I tried out bluetooth and wifi for sending the data, but this was to unreliable and slow. I simply upload the G-code as a .txt, read it line by line and interpret the commands it looks like this: G0 Z5.0 X-39 Y-70 G1 Z-497.3 X-3 G0 Z5.0 X-39 G1 Z-497.3 X-3 G0 Z5.0 G0 is for fast movements G1 for slow movements and there are only values for the changing axis... I can make much better resolution, just look at the picutes in my blog, but the problem is that with better resolution the G-code file gets to big for the nxt (only 100 kb free space), so I have to split the G-code files in 2 files and run it one by one, which I was to lazy to do in this video ;) The Step size of the trajectory si only about 0.05 mm while my layer width in the g-code was 1.5 mm that's the reason for the bad quality.
-
If you look at my motor controller above, I am using a PD-Controller which is very fast in reducing error but does this by using huge acceleration and suddenly stop when reaching the desired angle or overshoots. like this: so you get an very rash start than overshoot and move back to the desired angle so I am using this function: void trajectory(float x, float y, float z){ float length = sqrt((x-oldx)*(x-oldx) + (y-oldy)*(y-oldy) + (z-oldz)*(z-oldz)); float incx = (x-oldx) / length/speed; float incy = (y-oldy) / length/speed; float incz = (z-oldz) / length/speed; for(int i = 1; i < length*speed; i++){ move(oldx+incx*i,oldy+incy*i,oldz+incz*i); wait1Msec(Ta*2); } wait1Msec(Ta); oldx = x; oldy = y; oldz = z; } basically this code creates a lot of small point on a straight line between A and B. I calculate the length from my current position to the desired one. divide the error between the two points by the length and a variable speed (to change the speed) than I use a for loop over the full length of the path between point A and B, where I add the increments and give my motor controller new target in the move function. this happens every 20 ms, so the controller only has to correct very small changes before he gets the next value, this way all motors stop at the same time and you get a constant velocity over the movement. Since I already wrote so much about it, I will try to get my tutorials with working RobotC examples uploaded this weekend :)
-
this is the code for my PD-controller, I run 3 tasks on the NXT for each motor. it's only works with small movements because I use another function to give the motor a new target every 10ms. int Ta = 10; //sampling time int aTarget = 0; //current motor Target bool aWaiting = false; //we arrived at the Target task maController() { int pos = 0; //current position int e = 0; //current error int ealt = 0; //old error float Kp = 2.2; //proportional gain float Kd = 0.5; //differential gain float y = 0; //computed motor power int MotorNumber = 0; bFloatDuringInactiveMotorPWM = false; //brake motors nSyncedMotors = synchNone; //disable any sync nMotorPIDSpeedCtrl[MotorNumber] = mtrNoReg; //disable PID nMotorEncoder[MotorNumber] = 0; //set encode to 0 while(true) { wait1Msec(Ta); //wait for the sampling time aWaiting = false; //we are moving pos = nMotorEncoder[MotorNumber]; //reading the current position e = -aTarget - pos; //calculating the error to the target int d = e-ealt; //calculate difference between old error y = Kp * e + Kd * (d)/Ta; //calculate the motor power ealt = e; //set the current error as old error if(abs(e) < 2) aWaiting = true; //if we are less then 2 degree from the target we are finished motor[MotorNumber] = y; //set the motor power } } @Ramacco: what was the problem with you're software?
-
Hello everyone, after spending years with my nxts I finally made something I want to share with others :) as the Title states, it's a cnc mill based on a linear delta robot. The programming is finished and was done with RobotC, but I still have to do some remodelling of the robot itselfs. For more info visit my also unfinished blog :) http://www.industrialmindstorms.org Feel free to ask questions if you have one!
-
Mecanum Wheels
VASH321 replied to Zerobricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
@DLuders: thanks for all the trouble I already build wheel 2 and 3 ;) @Zblj: so the Sidewinder uses another wheel with 10 rather than 12 rollers? are there detailed pictures? does it perform better than your 12 roller design? -
Mecanum Wheels
VASH321 replied to Zerobricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
when you look at this at 0:27you see that the kinda look like the third design from ZBLJ but smaller? -
Mecanum Wheels
VASH321 replied to Zerobricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
there is a youtube video of the mecanum wheels in action are there any instructions for the smaller wheels seen on the NXT vehicle??