We had a brief introduction to parallel composition last segment. In this segment, we're going to talk about details. We'll push on a synthetic view of parallel composition. That is as roboticists we want to construct behaviors using compositions and we'll talk about how we accomplish that. And we'll place a special emphasis on behavioral modularity and I'll explain what that is. Jeff talked about templates in section 2.1. Just to quickly recap. Templates are low dimensional reference dynamics. In this picture you can see how we use the idea of templates and anchors to analyze biological systems. A complicated system sometimes behaves like it's actually a simpler one and the template captures the underlying simpler dynamics. This idea is later used to analyze machines like Rex as Dan said in section 4.1. Instead of the bodycentric view of templates and anchors, what about a more dynamical systems view? In this cartoon, the blue line indicates the template dynamics. That is they're actually lower dimensional and simpler than the full state space which is in grey. The actual evolution of the system might follow something like the red arrows where the attraction down to the template sub manifold is called the anchoring dynamics. Somewhat surprisingly, anchoring is actually a parallel composition. Here is my template dynamics, the blue again and the anchor dynamics is simply a parallel composition of something that attracts down to the template sub manifold. With them together, you get something like the picture on the left again. To summarize, for systems with a high number of degrees of freedom, there's really no alternative to thinking about parallel composition. Why is this? It's because uncoordinated degrees of freedom in a mechanical systems tend to accumulate energy and that usually causes the robot to fail. What happens in lots of animals and robots is that these extra degrees of freedom might be passively controlled? In this situation, they're actually referred to as something called preflexes. So either you have preflexes or you can think about parallel compositions of templates. One of the difficulties of parallel composition is coupling. To illustrate this, look at this circuit. There are two physical parts of the circuit if you look carefully. An RL circuit over here and an RC circuit over on the right. These two separate parts are connected by the resistor R21. Let's think about the limit if R21 goes to infinity. That would physically disconnect the circuit and the current in the RL part would not interfere with the current in the RC part. This is a physical decoupling. And the solutions of the RL part and the RC part would not interact. You could say that the evolution of the system can be represented by this diagonal linear system or x1 dot is not affect by x2 and vice versa. Here's some images of what happens when you don't have the coupling which are the arrows in blue and you start slowly adding coupling by reducing R21 from its initial value of infinity. You get something like the red lines, which are slight deformations of the blue lines. And if you keep increasing the coupling, you get higher deformations, but you can see how it still resembles the original decoupled system somewhat. Crosstalk can be much worse in mechanical systems. Let's think of a simple system like a double pendulum. Which you can think about as a parallel composition of an upper link and a lower link, where the controller is just gravity and there's some natural damping. So if I held one of the links of the double pendulum rigid, you'd imagine that it would oscillate until it slowly died out. So the template dynamics is really a slow oscillation or fast oscillation where the energy is not increasing. That is, if I release the pendulum from some height, you would expect it to not go above that height. But now let's take a double pendulum. You can see that even though I started below the line, one of the links ended up crossing the line. Why is this? It's really because that the energy in mechanical systems is coupled tightly, and energy from one link can cross over into a second one and cause obstacles to be hit where you didn't expect. And here are the traces, and you can see that even though, in the right trace the height of the system started at zero, it tends to go above it and cause failures. So this kind of mechanical coupling really messes us up when trying to do parallel composition in mechanical systems. To summarize the motivation for parallel composition, robots have many degrees of freedom and you either need to incorporate preflexes at design time or you need to think about parallel composition of templates at control time. Let's talk about this with a simple example. Here's a vertical hopper, and what I would like to do as an engineer is embed this behavior into my planer hopper, which is a slightly more complicated system. So what I'd like to do is to map my controllers from template to anchor. So that's part one of the agenda. However, I would also like to embed multiple templates, not just one. For instance, my planar hopper should not just be able to hop up and down, but also move laterally on the plane. To do that, we embed a second template, the rimless wheel, which Jeff talking about in the previous week, and have both of those controllers acting on my planar hopper. Additionally, I would like the controllers to be decoupled. I would not like to have to worry about the fore-aft control, and the vertical hop control, and vice versa. However, when anchoring multiple templates, you have to be worried about coupling forces, as we saw with the double pendulum example in the previous slide. We could either try to cancel these coupling interactions, which remember get worse with higher velocities since Coriolis terms depend on velocity, but then you would ruin the decouple nature of our controller. We'll talk in the next segment about how it's much preferable to not have coupling between our controllers. Lastly, I've just talked about the implementation. But that's not really enough. You have to be able to verify that our parallel composition works both in practice as well as analytically. Now that I've explained some of the difficulties, let see some empirical parallel compositions. Raibert was one of the first to pioneer on this. Here's a video of a Raibert hopper hopping up and down. And this is using the controller that Jeff described in the previous weeks. What Raibert did, was he took this vertical hopping idea, and added a decoupled controller for fore aft movement. And you can see here, hopper is happily hopping along the boom at control speeds. It seems like the implementation was very simple but there are some considerations that might not be so obvious. The ratio of the leg inertia to the body inertias turns out to be very important to the decoupled controllers to work in this example. For Raibert this ratio was 14:1 for the body to the leg inertia. I've made a simulation here where this ratio is actually changeable. Here it's hopping fine for a ratio of 7:1. But then if you keep increasing it so that it's about 1:1, it doesn't work anymore. So there's an interesting interaction of design choices with the ability to implement decoupled controllers. To summarize, in a high degree of freedom robot, there's no alternative to either incorporating preflexes or thinking about parallel composition of templates. Coupling forces in mechanical systems will really try to screw us up when we try to implement decoupled controllers but it's really preferrable to be able to do this for a number of reasons, which are going to be more obvious in the coming lectures. Lastly verifying that the parallel composition is correct is difficult, but it's also very important. And we're going to talk about that in the next segment.