Monday, October 31, 2016

Simple kinematic simulation of a TreppenSchlepper


After getting in touch with HotInt (see previous post), it was time to try a little TreppenSchlepper multibody dynamics model myself. After a few hours of try & error (and a little help from HotInt support; these guys a very quick and supportive, really great!) a TreppenSchlepper model Version 0.1 was ready to be simulated. 
 Ok, even "0.1" is quite exaggerated, because it just consists of 3 parts: the FootPlate, an OuterShell and a SpringDamper in between.
The SpingDamper is just a simple substitute for the ElevatorCylinder which would be really needed, but it at least links the other two parts and provides the damper for that link. The elevation itself is currently done by a load (called ElevatingForce) defined for the z-Axis and acting on OuterShell. A Contact1D acts as coordinate constraint, making sure the OuterShell can move up but not into or below ground.  
FootPlate is fixed to ground with a RigidJoint element. The model (a text file with extension .hmc, to be fed directly into HotInt) can be found here (Filename TreppenSchlepperV0.1.hmc), while a simple up/down simulation animation is here.


The blue part (OuterShell) is modelled having a mass of 30kg , which gets lifted by a force F(t), plus gravity and spring force counter-acting.

I'm not a mechanical engineer, so if you are or know an expert: help is greatly appreciated. Just mail me at treppenschlepper@gmail.com

What could be the next steps?
  1. Model a SlidingInnerShell:
    This crucial part is currently missing in the TreppenSchlepper. The SlidingInnerShell sits between the ElevatorCylinder and the OuterShell. It is needed to allow TreppenSchlepper to move forward onto the next step once it is elevated enough.
  2. Model a stair
    At least a LowTread -> Rise -> HighTread for the beginning, to have something TreppenSchlepper can start to climb up
  3. Model the ElevatorCylinder
    Currently it is only a SpringDamper, but eventually this should become the actuator doing the actual lifting. Probably that's a part which needs to connect to some kind of controller (to be modelled as IOModule in Hotint ?).
  4. Add wheels to OuterShell
    This allows TreppenSchlepper to move on flat surfaces, like the floor, and to position itself correctly in front of a step.

As a summary, the simple TreppenSchlepper consists of
  • FootPlate
  • ElevatorCylinder (currently simplified with a SpringDamper)
  • SlidingInnerShell (we really need that!)
  • OuterShell + wheels


Then we should be able to simulate different phases during operation of TreppenSchlepper, like
#
Phase
remarks
1
move to starting position in front of step
Under control of path planning algorithm
2
Elevation

3
slide to upper level of step
actually, this will be a quite interesting phase.
We need to make sure nothing gets out of balance
4
Lift, fetch and retract FootPlate


As always, comments and feedback (and help!) is appreciated, contact me treppenschlepper@gmail.com or directly via commenting this post below.

Thursday, October 27, 2016

Going model-based

Why do good engineering practices often include some kind of models?
To better understand the underlying technical problems, and in order to engineer a really good design, certain aspects are typically stated in an abstracted way, a model. It allows e.g. to express, then simulate its behavior. Models provide means to explore the solution space. They help to formulate and iteratively improve the design in a virtual world, without the costs and limitations of real physical prototypes. Even better, tools exist which can more or less automatically translate the solution from the model representation to a design (code, drawings, even 3D-printed parts) for the "real world", keyword: model-based design. Good news: there were some activities started at CAMPUS02 (https://www.campus02.at/automatisierungstechnik/) by Johannes about a month ago, addressing how to express TreppenSchlepper in a model approach. We are looking forward and hope to report on results soon.
In the meantime, let's dig a bit more into modelling certain aspects.
Fortunately  there are lots of simulation tools available for domains like system architecture, physics, or software design. Some of them are free, some even in open source.
For me as an E/E engineer, the biggest question-marks in TreppenSchlepper's design lie in its mechanic. First, will it move the way we intended it to (kinematics)? What is the power, the torque required at the motors, how shall we control it? Can we be sure it will be intrinsically safe in any situation, i.e. with all the loads and dynamics involved, on challenging surfaces of stairs with a step pitch for example?  How do we determine the boundaries of such safe operation? We need this to provide the path planning of TreppenSchlepper with information ("safe envelops") so it can decide on go/no-go.
Being a layman in kinematics I turned to a web search, which brought up HOTINT from LCM (Linz Center of mechatronics), see https://www.hotint.org/.

Hotint
According to its description it is a flexible multibody system dynamics modeling and simulation tool, offered as freeware. And it integrates with another tool called X2C, which "is an open source tool for the model-based development and code generation of real time control algorithms for micro processor units" (cited from its web page http://www.mechatronic-simulation.org/x2c/x2c-home/).
So why not try it? There are even user manual and a reference manual available, although I have to admit some things became only clear after looking at the tutorials, and try and error it myself.

After spending a free afternoon with HOTINT I had my first DIY project ready, which involved 3 bodies: two masses experiencing gravity pull, hovering (at time t=0) above a third, fixed body, which should represent the step of a stair. There is a "collide"-relation called "Contact1D" between one of these masses (actually, the red box) and the stair, so while the blue body just transits through on its way down to minus infinite, the red box really bumps onto the stair and sits there. By defining material properties like spring stiffness and damping, we can simulate this bump in more detail (depth of penetration for example). Hotint allows to define "Sensors" which probe and record certain properties through simulation, like the acceleration of red box. Playing with these is fun, you can find it ("PeterTest1.hmc", done with Hotint Version 1.2.41) here.


These hmc files can be read into Hotint for simulation and visualization, or it can be used with a text editor like notepad++, with support for syntax highlighting via an extension from Hotint 




So what will come next?
It would be nice to model a simple scenario with two masses, representing the "Outer Shell" (with wheels) and the "Inner Shell" (with a lifter) of a TreppenSchlepper. Such a simplified system shall climb up one step of a stair, with the main forces/loads modeled as well. So far I'd expect to model
  • gravity
  • vertical lift force (between outer and inner shell)
  • horizontal drive (wheels of outer shell)
  • horizontal friction (between outer shell and step floor, and during lifting between inner shell and step floor)

Let's see how that works….