Jonas

Eurobricks Citizen
  • Content Count

    262
  • Joined

  • Last visited

Posts posted by Jonas


  1. Hi Thorsten,

    thanks for your warm response. And yes, it was so nice times with old good Speccys,

    I had built my interface in 1988. I have no schematic anymore, but I still remember that I used integrated stereo amplifiers to make small-footprint H-bridge drivers for motors.

    My programs were written mainly in Basic but the time-critical parts, such as controlling motors with opto-sensor feedback or joystick control, were coded in Z80 assembler.

    BTW, I had built also another interface with 8-bit AD and DA converters and used it for my experiments in those early times of speech recognition. A large part of my dissertation in 1980s was made on my Spectrum.

    Unfortunately, the computer does not function anymore. But it still has a place of honor in my private exhibition.

     


  2. A sweet topic for us, older Technic and computer fans!

    It reminds me my attempts to link the Lego and ZX Spectrum worlds back in late 1980s.

    I was lucky to have had the Spectrum+ version whose larger case allowed me to build in a 3-port parallel interface (8255) and additional memory banks. I have also designed and built an interface for controlling LEGO models (up to 4 motors, 8 LEDs and 4 photodiodes used for feedback control). Here are several pictures:

    lm-01-control-unit-and-computer.jpg

    lm-03-control-unit-rear-view.jpg

    lm-04-control-unit-inside.jpg

    It allowed me to control various manipulators ... 

    lm-20-manipulator1.jpg

    ... and also vehicles (via a joystick connected to the parallel interface as well).

    lm-23-car-with-joystick.jpg

    Some other pictures can be seen on my Brickshelf.


  3. Hello all,

    I have a question on using memory in EV3. I want to run a program in two modes. In the first one, I am going to do some calibration based on measurements from sensors and computation, and after that to store the computed values. This should be done only occasionally, especially in case when the working environment changes. In the main mode, the program should retrieve those stored values and use them for its repeated runs.

    What is the best way to do it in Pybricks?


  4. I played with MrJos' code a bit and made some optimizations that are based on a) precomputing some variables, b) applying goniometric formulae for a difference between two angles, and c) rearranging some terms in the equations. The new code is more compact and about 2 times faster. (Now, the main speed bottleneck is the physical reading of the 6 motor angles.)

    Here is my code:

        yawbasecos = math.cos(yaw_base_angle)
        yawbasesin = math.sin(yaw_base_angle)
        pitbasecos = math.cos(pitch_base_angle)
        pitbasesin = math.sin(pitch_base_angle)
        pitarmcos  = math.cos(pitch_arm_angle)
        pitarmsin  = math.sin(pitch_arm_angle)
        rolarmcos  = math.cos(roll_arm_angle)
        rolarmsin  = math.sin(roll_arm_angle)
        yawarmcos  = math.cos(yaw_arm_angle)
        yawarmsin  = math.sin(yaw_arm_angle)
        
        #new angle introduced and its cosine and sine computed
        difpitcos  = math.cos(pitch_arm_angle - pitch_base_angle)
        difpitsin  = math.sin(pitch_arm_angle - pitch_base_angle)
    
        #new variables added
        tempA = rolarmcos * yawarmsin         
        tempB = a67 * rolarmsin * yawarmsin
        tempC = pitbasesin * pitarmcos * yawarmcos - tempA * difpitcos
        tempD = a67 * tempC - a45 * difpitsin + a3 * difpitcos - pitbasecos * (a67 * pitarmsin * yawarmcos - a2)
    
        #significantly simplified equations
        x_pos_fork = round(yawbasecos * tempD - yawbasesin * tempB)    
        y_pos_fork = round(yawbasesin * tempD + yawbasecos * tempB)
        z_pos_fork = round(a67 * (tempA * difpitsin - yawarmcos * difpitcos)- a45 * difpitcos - a3 * difpitsin +  a2 * pitbasesin + a1)
       

     


  5. I want to show you my new robot. Its construction has been inspired by the robot seen on the webpages of the German company Orange Apps - link. It is their 3rd version of the robot, the older one could be found on their Facebook page. They sell the robot either as a building kit or already assembled. (Both are pretty expensive, though.) Anyway, the robot is really elegant, with eye catching and smooth orange shell. I looked at their videos and designed something similar, but not the same. My primary goal was to build a 6DoF robot that would be lighter and more compact than my previous one inspired by Akiyuki.   

    Here are several pictures:

    or01.jpg

    or02.jpg

    And a video showing the current state in programming. The program written in Pybrick micropython includes modules for automatic home-positioning, sequential control between pre-set points and optional manual control via IR beacon. I am still working on the implementation of inverse kinematics control. Here, I must thank MrJos for showing us that it is manageable and giving us some hints.