glowytheglowbug Posted August 30, 2023 Posted August 30, 2023 uses spike for programming and there are 2 versions using small and medium linear actuators, the code isnt perfect though and the small one skips easily, getting carbon axles for better accuracy when retracting and expanding the actuators so i dont get a big explosion of actuators and twisted axles again one medium actuator suffered :( planning to get some metal uni joints for turning this into some crawler beast Quote
Mr Jos Posted August 30, 2023 Posted August 30, 2023 Looks like a fun project for doing math. but you do need to get the speed constantly correct in all 4 motors to prevent these kind of damages, realistically you should change the speed for all motors every millisecond, but I don't know what Spike's reaction time is to motor commands. EV3 used to be around 50ms I think. I do think the small one either has the math wrong, or just to slow motor commands, that makes it engage the clutch in the actuators. And there does seem to be something wrong with your post, (no punctuation), one picture and then a biiig empty white space. But I clicked the photo to go see your flickr page to see the rest, would be better if you could fix the link anyway. Quote
gyenesvi Posted August 30, 2023 Posted August 30, 2023 Hmm, interesting exercise, but what's the purpose of this? Is it just for the building challenge? Other than that, using 4 electric motors to drive a single axle in a convoluted way does not sound very effective. Maybe that's why nobody did this before..? I don't think metal joints and carbon axles are the solution here, but sorting out the math and programming first. Quote
glowytheglowbug Posted August 30, 2023 Author Posted August 30, 2023 3 hours ago, Mr Jos said: Looks like a fun project for doing math. but you do need to get the speed constantly correct in all 4 motors to prevent these kind of damages, realistically you should change the speed for all motors every millisecond, but I don't know what Spike's reaction time is to motor commands. EV3 used to be around 50ms I think. I do think the small one either has the math wrong, or just to slow motor commands, that makes it engage the clutch in the actuators. And there does seem to be something wrong with your post, (no punctuation), one picture and then a biiig empty white space. But I clicked the photo to go see your flickr page to see the rest, would be better if you could fix the link anyway. yep im going to make a graphing calculator in scratch in order to get exact motor speeds since the large one has diff radius and speeds etc... 3 hours ago, gyenesvi said: Hmm, interesting exercise, but what's the purpose of this? Is it just for the building challenge? Other than that, using 4 electric motors to drive a single axle in a convoluted way does not sound very effective. Maybe that's why nobody did this before..? I don't think metal joints and carbon axles are the solution here, but sorting out the math and programming first. yeah its mainly for fun, just an overcomplicated torque multiplier im not too sure how to do the programming perfectly unless i use a scotch yoke mechanism fo reach drive and use sin in order to program i only can control the acceleration of the motors as the linear actuator has a clutch and thus would not result in accurate readings if you would want to help tysm theres a motor that isnt driven at the end its used to read the angle btw i could share the programs i have if anyone wants :) Quote
Davidz90 Posted August 30, 2023 Posted August 30, 2023 Pretty interesting idea, however impractical it may be. Getting speeds perfect is definitely a huge challenge. Using soft attachment points for actuators (springs, rubber connectors etc.) might allow for some margin of error? Quote
glowytheglowbug Posted August 30, 2023 Author Posted August 30, 2023 1 hour ago, Davidz90 said: Pretty interesting idea, however impractical it may be. Getting speeds perfect is definitely a huge challenge. Using soft attachment points for actuators (springs, rubber connectors etc.) might allow for some margin of error? yes but over time the error would build up :( Quote
Davidz90 Posted August 30, 2023 Posted August 30, 2023 45 minutes ago, glowytheglowbug said: yes but over time the error would build up :( Oh right. So I think that this kills this idea - no matter how precise the program may be, errors will accumulate anyway... unless one adds slip clutches in actuator inputs? Then, the program can always input, say, 105% of necessary rotation and the actuator will move as far as it can? Quote
glowytheglowbug Posted August 30, 2023 Author Posted August 30, 2023 2 minutes ago, Davidz90 said: Oh right. So I think that this kills this idea - no matter how precise the program may be, errors will accumulate anyway... unless one adds slip clutches in actuator inputs? Then, the program can always input, say, 105% of necessary rotation and the actuator will move as far as it can? btw im not using the full length of the actuator only 1 stud left and the motor seems to stall instead of slipping the clutches Quote
Mr Jos Posted August 30, 2023 Posted August 30, 2023 If you only rely on motor acceleration/deceleration, and no continuous SIN/COS calculations it will never work reliable. You would need 2 calculations for each position, as 2 motors are always 180° offset, the opposite motor will be the same speed, but in reverse. the 90° motors will be faster/slower. As you already use a motor at the end, you can just use this angle to calculate the needed speed. Without using this motor (encoder), you would have 1 master motor, and other 3 would be calculated dpending on this one. But you will have to use SIN/COS. Quote
glowytheglowbug Posted August 30, 2023 Author Posted August 30, 2023 (edited) 6 minutes ago, Mr Jos said: If you only rely on motor acceleration/deceleration, and no continuous SIN/COS calculations it will never work reliable. You would need 2 calculations for each position, as 2 motors are always 180° offset, the opposite motor will be the same speed, but in reverse. the 90° motors will be faster/slower. As you already use a motor at the end, you can just use this angle to calculate the needed speed. Without using this motor (encoder), you would have 1 master motor, and other 3 would be calculated dpending on this one. But you will have to use SIN/COS. https://pasteboard.co/yRg9RGvsXATf.png heres my code i set the motor speed to 100 btw im still not very sure how to code the whole thing though Edited August 30, 2023 by glowytheglowbug Quote
Seasider Posted August 30, 2023 Posted August 30, 2023 An interesting read. I followed your link and watched some videos. I think you’re always going to have issues with this as you’re constantly applying forces via all 4 “pistons” so you have pull and push forces constantly acting on the same crankshaft and as others have said it’s never going to be synchronised motion for all 4 and so you’ll always have some “fighting against each other” which will result in forces and friction you just don’t want. So I think you’ll continue to have failures I’m afraid. Remember in an I4 engine only 1 piston is technically applying a force at any one time, the piston in the ignition cycle, the others can be classed as negligible forces in comparison. Quote
glowytheglowbug Posted August 30, 2023 Author Posted August 30, 2023 3 hours ago, Seasider said: An interesting read. I followed your link and watched some videos. I think you’re always going to have issues with this as you’re constantly applying forces via all 4 “pistons” so you have pull and push forces constantly acting on the same crankshaft and as others have said it’s never going to be synchronised motion for all 4 and so you’ll always have some “fighting against each other” which will result in forces and friction you just don’t want. So I think you’ll continue to have failures I’m afraid. Remember in an I4 engine only 1 piston is technically applying a force at any one time, the piston in the ignition cycle, the others can be classed as negligible forces in comparison. mhm thanks! i have thought of a odd little way of delaying the angle sensed and using some odd math but not sure yet Quote
glowytheglowbug Posted August 31, 2023 Author Posted August 31, 2023 (edited) 12 hours ago, Davidz90 said: Oh right. So I think that this kills this idea - no matter how precise the program may be, errors will accumulate anyway... unless one adds slip clutches in actuator inputs? Then, the program can always input, say, 105% of necessary rotation and the actuator will move as far as it can? im not 100% sure if its possible but i could make each actuator have its position encoded by the motor at the end and once i get how many degrees the total angle is from 0 to max i might be able to make the engine run off degrees instead of rotations, im not super sure though and am going to have to check a ton of stuff if anyone wants to help with the program thanks! import math from pybricks.hubs import PrimeHub from pybricks.pupdevices import MediumLinearActuator from pybricks.parameters import Port from pybricks.tools import wait # Initialize the hub and motors hub = PrimeHub() actuator_b = MediumLinearActuator(Port.B) actuator_c = MediumLinearActuator(Port.C) actuator_d = MediumLinearActuator(Port.D) actuator_e = MediumLinearActuator(Port.E) # Constants for sinusoidal motion AMPLITUDE = 45 # Degrees FREQUENCY = 0.1 # Adjust as needed OFFSET = 45 # Offset for initial position while True: # Get the current angle from Motor A (assumed to be connected to the output shaft) current_angle = hub.motor.angle() # Calculate the desired position for each actuator based on a sinusoidal pattern position_b = OFFSET + AMPLITUDE * math.sin(math.radians(current_angle * FREQUENCY)) position_c = OFFSET + AMPLITUDE * math.sin(math.radians((current_angle + 90) * FREQUENCY)) position_d = OFFSET + AMPLITUDE * math.sin(math.radians((current_angle + 180) * FREQUENCY)) position_e = OFFSET + AMPLITUDE * math.sin(math.radians((current_angle + 270) * FREQUENCY)) # Set the target positions for the linear actuators actuator_b.go_to(position_b) actuator_c.go_to(position_c) actuator_d.go_to(position_d) actuator_e.go_to(position_e) # Wait for a short time before updating positions again wait(10) # Adjust the time interval as needed here is a pybricks code i used chatgpt for im still not very sure on how to get all this to work though Edited August 31, 2023 by glowytheglowbug more code Quote
Davidz90 Posted August 31, 2023 Posted August 31, 2023 4 hours ago, glowytheglowbug said: here is a pybricks code i used chatgpt for I'd advise against using chatgpt, especially for pretty nonstandard tasks like this. One thing is certain - the linear actuator positions are not a single sin() function unless scotch yoke is used. With standard crankshaft, actuators are moving both vertically and horizontally, and that horizontal motion adds another sin() or cos() factor. Quote
Davidz90 Posted August 31, 2023 Posted August 31, 2023 Here's the math: actuator by David_Z1, on Flickr Quote
glowytheglowbug Posted August 31, 2023 Author Posted August 31, 2023 44 minutes ago, Davidz90 said: I'd advise against using chatgpt, especially for pretty nonstandard tasks like this. One thing is certain - the linear actuator positions are not a single sin() function unless scotch yoke is used. With standard crankshaft, actuators are moving both vertically and horizontally, and that horizontal motion adds another sin() or cos() factor. yeah i was thinking of using a scotch yoke of every single actuator but then didnt know if it would have the precision being backdriven Quote
Zerobricks Posted August 31, 2023 Posted August 31, 2023 Or.... You can use differentials to compensate between the different stroke lengths. Quote
glowytheglowbug Posted September 3, 2023 Author Posted September 3, 2023 On 8/31/2023 at 6:34 PM, Zerobricks said: Or.... You can use differentials to compensate between the different stroke lengths. wdym? Quote
glowytheglowbug Posted September 14, 2023 Author Posted September 14, 2023 (edited) On 8/31/2023 at 2:38 PM, Davidz90 said: Here's the math: actuator by David_Z1, on Flickr how would i keep getting the actuator to the L position though? do i get the position of linear actuator from the encoding wheel and then keep making the stuff move to the exact position? still kinda confused on the whole thing (update i did create a gearbox for it lmfao) i got it :D tysm! im going to use this to set relative angle for motors at the start and then will try getting it moving :P Edited September 14, 2023 by glowytheglowbug Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.