Jump to content

Mr Jos

Eurobricks Knights
  • Posts

    515
  • Joined

  • Last visited

Everything posted by Mr Jos

  1. Haha, same here. Was very fun reading and watching everything about the transformation matrices. Didn't know Denavit either 1 week ago, and calculating manually with matrices was already 10years ago I did it last time at school. I was glad once I had the forward kinematics working. Now just little bit more on the inverse kinematics, hope I have some time this week to read more about the transformation I need to use. I'm glad it works for you! Happy to help others, maybe sometimes it won't be the best solution possible, as I only started using Python like 2months ago for first time ever I think. (I work as mechanical service tech for industrial machines, that's why I'm fascinated with all kinds of robotics/automatisation) but the programming is just for fun and learning for me.
  2. You need to put a small wait after sending the BT command. By the time the movement command reaches the slave, and slave sends the message I'm busy, the master already reaches the checkbox and reads an old 'TurnDone' and thinks it's OK. Been there done that :) def move_all_motors(axis1, axis2, axis3, axis4, axis5, axis6, sp1, sp2, sp3, sp4, sp5, sp6): yaw_base_bt_sp.send(int(sp1)) yaw_base_bt_num.send(int(axis1 / 12 * 140)) pitch_base.run_target(sp2, int(axis2 * 10), wait=False) pitch_arm.run_target(sp3, int(axis3 * 12.5), wait=False) roll_arm.run_target(sp4, int(axis4 * 5), wait=False) yaw_arm.run_target(sp5, int((axis5 * 10) + (axis4 / 5 * 10)), wait=False) roll_head_bt_sp.send(int(sp6)) roll_head_bt_num.send(int((axis6 * 7) - (axis4 * 1) + (axis5 * 4 / 7))) wait(150) while pitch_base.control.done() != True or pitch_arm.control.done() != True or roll_arm.control.done() != True or yaw_arm.control.done() != True or commands_bt_text.read() != "No movement": continue The wait 150ms gives the slave some time to return something else then "No movement". if yaw_base.control.done() == True and roll_head.control.done() == True: commands_bt_text.send("No movement") wait(100) else: commands_bt_text.send("Moving") wait(100) Running on the slave in a While True: Loop that starts once all initiating is finished. The wait 100 was added for not slowing down rest of the program.
  3. Hey, Days in row I've been breaking my head over formulas. I managed to get the forward kinematics working (finding current X/Y/Z coördinates for the endpiece on the 6DoF arm. [This tiny bit of manual multiplying matrix's] Resulting in the code [This photo has some - and + switched up, but solved now]; Then I started on the inverse kinematics; I managed to get formulas for 1st, 2nd and 3rd rotation joint and finding wrist X/Y/Z position by giving in only: End position for endpiece in X/Y/Z and it's roll/pitch/yaw. But I'm stuck now. No mather how many videos I look at to understand, I just don't get it how I can solve it to find angles for joint 4/5/6. I need to use some rotation matrix I think, but whatever I try I don't find the correct answer. Then even started just making some spreadsheet to see if I can find some "easy" formula, but nope. So any got an idea what last bit I need to get my last angles calculated?
  4. Are the connection points for the batteries corroded from old batteries leaking? If there is a bad contact point it's possible to have low power from the motors.
  5. I put in the calculations for X/Y/Z position of the fork position based on the angles from the motors. X and Y work perfect (shows distance in mm from center of base.) Z axis has somewhere a + and - (or more then 1) misplaced I think doesn't work as intended yet. The program still works fine, but had to slow down bluetooth refresh rates a bit because the continuous calculations asked to much of the EV3. Somewhere in here is a - misplaced, do you see it?
  6. After manyyy.... hours of writing, forward kinematics are calculated manually finally. Took some long reading, understanding and checking diagrams. But it does seem to work to find X/Y/Z position for any degrees of the joints. Now trying to find out how I can get the inverse kinematics done..
  7. I quickly made one with one of my program variables, you will need to change them to yours, and try to understand how it works. You can "def"ine some routines, and just call them in your program once, or as in the example make a thread that you can start, it then will start it and continue with the rest of the program. #add to beginning of your program from threading import Thread #after your variable defining make a sub program like this def motor_drive_operating(): while True: if color_fork.color() != Color.GREEN: continue else: motor_drive.run(50) while True: if color_fork.color() == Color.RED or ultra_base.distance() < 20: motor_drive.stop() break else: continue #make a variable from the sub program motor_drive_loop = Thread(target=motor_drive_operating) #start the sub program motor_drive_loop.start() #The rest of program can continue here.
  8. Great that you managed to do what you wanted! Have fun experimenting for more/different movements. What set/motors did you end up using? Here are some examples for bringing motion in regular LEGO that use some more complex 'moves' that I saw and liked very much.
  9. Any other extension would be good for me aswell.. it's for these matrix's.
  10. Can't you just add , wait=False like with the EV3 to start all motors in row? In python for EV3 it's like; motor_a.run(600, wait=False) motor_b.run(600, wait=False) motor_c.run(600, wait=False) motor_d.run(600, wait=False) If running for some angle; MotorA.run_angle(600, 90, wait=False) and then last motor , wait=True for the program to wait untill it's finished.
  11. Hey, I've been trying to understand how the inverse kinematic works and found out I need to use a Matrix (many). So I won't be able to just use loads of lists with pybricks. After some more reading I found that I need 'numpy' extension. I don't seem to find it in the 'Visual Studio Code' "extensions" tab. So; Is it possible, and if so, how can I use numpy [or matrix] when running the program on the EV3 bricks alone.
  12. Initiating all 6 axis, including the 3 infinite axis. Then performing some basic movements with point to point (calculating speed for each axis to arrive at same time). Better movements [linear along the field] will be programmed in the rest of my quarantine.
  13. Nice what you've done so far for a first bigger project! For the robot I like what you did with the gripper, using tires! Some movements seem very limited, is it not possible to make them bigger by moving some of the stopping points? I'm just in the stage where all 6 axis get calibrated correctly. Will make some programmed movements tomorrow and maybe make a video showing how I made it possible to keep some axis 360°+.
  14. I managed to initiate a homing for all 6 axis whilst still having the 360° unlimited rotation on all 3 those axis. Just needs some fine tuning on the 6th one tomorrow and then can the real programming start. A video can be found on Facebook, as it's easy to upload my not-so-good-unfinished-project-videos. And keeping finished ones on YouTube.
  15. Hey, EDIT: Last video will be shown here, rest is orignal post in order of progress. V3 XL 6DoF robotic arm. Homing all 6 joints + demo linear movements + roll/pitch/yaw control. V2 with more power and PS4 control for teaching new waypoints. Straight lines are calculated whilst moving from 1 waypoint to another, no saved coördinate lists except each waypoint is saved as (X, Y, Z, Roll, Pitch, Yaw) for the end effector position at that waypoint. It does not mather how you moved with the controller between these points. Available at Rebrickable now: https://rebrickable.com/mocs/MOC-76666/Mr_Jos/6-degrees-of-freedom-6dof-fully-automatic-robotic-arm-with-inverse-kinematics-programmed/#details V1 6DoF X/Y/Z Positioning with fully adjustable Roll+Pitch+Yaw possible. Angles are calculated on the brick with Inverse Kinematics and Forward Kinematics to check real current position, there are no lists being used with preset angles, only for calibrating all 6 joints. End of EDIT___________________________________________________________________________________________________ I wanted to try to build and program a 6 DOF arm. Upper arm is based on photo's from akiyuki, lower part and base MOC. Now I want to try to write the program for it myselve completely with micropython. If that all works out well, I'll be looking into putting a pneumatic hand or something on it. All 360° functions can rotate infinite. Need to do something whilst sitting out 7days quarantaine..
  16. I don't have dongles, and no space to put them in my bricks as they are in tight spaces. The one on the crane would hit racks with dongle, and other ones don't have access to USB port.
  17. I used to finish one brick's program and using # infront of stuff that doesn't need to work yet like BT connecting. When near the end debugging I just change quickly programs with the recent tab if needed. I did the master first as it controls it's own motors. Then program the slaves one by one. And if needed you can run the master program by starting it on the brick. And just connect all bricks with USB's to the computer.
  18. I use Bluetooth for my warehouse with 3x EV3 (1master and 1 slave on micropython, 3rd brick also as slave still on EV3-G) so far it works very fast. As I'm on a business trip I don't have my Lego with me so can't show a picture, but this is what you'll need. On each program at beginning: from pybricks.messaging import BluetoothMailboxServer, BluetoothMailboxClient, LogicMailbox, NumericMailbox, TextMailbox On the master brick: server = BluetoothMailboxServer() test_variable = NumericMailbox('speed for motor a', server) test_variable2 = TextMailbox ('motor state', server) server.wait_for_connection(1) This will wait for 1(or if more needed) Bluetooth connections made to the master brick. This is why the master programs need to be started first, Always! And reach this wait line before the slave reaches the connecting code. And you can make as many as you need of these variables either text,logic or numeric just as in EV3-G. The name between ' ' is same as the name in EV3-G this is how you can mix bricks with micropython and EV3-G to work together. On the slaves you will need to add this: client = BluetoothMailboxClient() test_variable = NumericMailbox('speed for motor a', client) test_variable2 = TextMailbox ('motor state', client) client.connect('name_of_brick_you_want_to_connect_to') This is all preparing and connecting. Then you can start sending messages like: test_variable2.send('Waiting') #in client test_variable.wait_new() #in client test_variable.read() #use this to read the 50% value the server will send and put it in you motor line. test_variable2.send('I started and moved 1000 degrees') #in client test_variable.send(50) #in server test_variable2.wait_new() #in server if test_variable2.read() == 'error': Blablabla elif test_variable2.read() == 'I started and... You get it ?
  19. And where exactly are these non Lego parts? I don't seem to find any. @designer-han Wonderfull MOC, many gears/ techniques involved in a not so usual model. However, was the wormgear/clutchgear really needed for the lifting? It seemingly makes it very slow and the LA's already have clutches inside them to make them extend all 4 to the same length when maxed out.
  20. Very nice build! For a goodcompact compressor I like the design from this video; Power distribution is done nicely making a constant flow of air coming out, and very sturdy design with the 5x7 panels.
  21. Thanks, I tried making it as small dual forks for Europallets. But this fork was the smallest I could make (8x16 Tile plate as top) as motor+sensor+guidings+chains all need to be in it to work, and being able to extend 125% outside of the crane base. In real life these big plate-forks are usually 2 small forks connected together with a top plate. Used for moving from chain conveyor to chain conveyor or rack in the length. For those who haven't seen these kind of 'Technic'. The installation is based on a project I did on a little bigger scale then LEGO. If you watch good you can see me walking around. The rack got a little longer and few stickers applied.
  22. For me trying to make it work from 0 to final product is the most fun. Once it works most fun is over. I'ld imagine just finding some code where you need to give in center-center joint-lengths and maximum angle movements would make any #DoF move, once a complete library is made. Personally I'ld have fun in the time searching all math behind it especially with the higher amount of axis like this one. I would give a try at this one, but I have no model to test code with (yet!).
  23. Just made a quick drawing to calculate 2 Dimensions X/Z You should start with measuring all center to center distances for all possible joints. Then you can make some lists/Arrays with possible angles alfa, beta, etc. Then try to write a code to just give in X/Y/Z coordinate and let it run the lists to find matching angles. Probably not the easiest way, but fun to find the math behind it.
  24. 2weeks of learning Python, from 0 to ... It's not perfect the HMI, few bugs with information updating to late on screen. But overall works well. Next will be the HMI on second screen for 'online' parameter adjustment.
  25. I put it here as it is about the working/movement of the technic machine. For the programming part I already went to the mindstorms section (because I just started 2weeks ago for the first time ever programming Python), but I think that section is more about the programming languages and coding. But if needed it may be moved. And here is one more render to see what only is needed to make the storage locations bigger; This adds place for 6 more boxes [16x48]. Exactly 3 of these can be build on a 48x48 baseplate.
×
×
  • Create New...