1

This is my first time asking a question so I'll try my best to include all the necessary information.

I am currently working on a machine learning project using PyBrain. My aim is for a driven pendulum to learn when force should be applied to maximise the amplitude of oscillation.

To do this, I have modelled the system in ODE (Open Dynamics Engine) using the xodetools.py script that is included with PyBrain. While the model works and is simulated, I cannot figure out how to add friction to the pendulum hinge joint.

Some of the example models included with Pybrain (e.g. johnnie_pgpe) redefine a paramater called FricMu in their Task class. I have included this in my code, but no matter what value I set FricMu equal to the system is unchanged (note: if I make it a string the simulation still runs so I presume this parameter is actually doing nothing).

A quick look at the ODE documentation (http://ode-wiki.org/wiki/index.php?title=Manual:_Joint_Types_and_Functions#Contact) suggests to me that I need to be using a contact joint. This type of joint is not supported by the script so I think would require me to write direct to the XML file.

Can someone with an understanding of either PyBrain or ODE give me some advice on how to increase the damping of my system. Thank you.


Below is the XML code for the pendulum that is imported by PyBrain

<?xml version="1.0" encoding="UTF-8"?>
<xode version="1.0r23" name="pend"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://tanksoftware.com/xode/1.0r23/xode.xsd">

<world>
    <space>
        <body name="arm">
            <transform>
                <position y="0" x="0" z="0"/>
            </transform>
            <mass>
                <mass_shape density="125.0">
                    <box sizex="0.2" sizez="0.2" sizey="0.2"/>
                </mass_shape>
            </mass>
            <geom>
                <box sizex="0.2" sizez="0.2" sizey="0.2"/>
            </geom>
        </body>
        <body name="swing">
            <transform>
                <position y="0" x="0" z="2.2"/>
                <rotation>
                    <euler y="0" x="0" aformat="degrees" z="0"/>
                </rotation>
            </transform>
            <mass>
                <mass_shape density="6.36619772588">
                    <cylinder length="5" radius="0.05"/>
                </mass_shape>
            </mass>
            <geom>
                <cylinder length="5" radius="0.05"/>
            </geom>
        </body>
        <joint name="arm_swing">
            <link1 body="arm"/>
            <link2 body="swing"/>
            <hinge>
                <axis y="0" x="1" z="0"/>
                <anchor y="0" x="0" z="0" absolute="true"/>
            </hinge>
        </joint>
        <joint name="fixedPoint">
            <link1 body="arm"/>
            <link2 body="swing"/>
            <fixed>
            </fixed>
        </joint>
        <geom name="floor">
            <plane a="0" c="0" b="1" d="-44.0"/>
        </geom>
    </space>
</world>
</xode>
<!--odeenvironment parameters
<passpairs>
('arm', 'swing')
<affixToEnvironment>
fixedPoint
<end>
-->
Chris H
  • 11
  • 3
  • welcome! Would you please post the relevant parts of the source of your model so we can see what's going on? Thanks! – cxw Mar 17 '15 at 16:11
  • A guess-I am not an expert by any means. Have you tried hinge torques or motor max forces listed at the bottom of the linked page? I see that contact joints typically only exist for one time step. – cxw Mar 18 '15 at 10:06
  • Or look at the angular-velocity damping at http://ode-wiki.org/wiki/index.php?title=Manual:_Rigid_Body_Functions#Damping – cxw Mar 18 '15 at 13:04

0 Answers0