- aditya mehrotra.

# chip updates: some control ideas [updates]

Okay so... what we're going to try to do a little bit is create an individual model for each of chip's legs and then a model for the CHIP system. We're going to see if that works/if we can simulate it in Matlab, and then if it does work we can think about implementing it but for now I don't think we're going to get there just yet.

Let's start by looking at an individual leg. A whole leg, based on the model we previously came up with. Let's start with the leg itself right? What are the STATES of the leg/state-variables the FULLY-DESCRIBE what the leg is doing at any given moment? That would be (in the 2-D case) theta_1, theta_3, and their derivatives. So those are the variables we need to track, theta_1, theta_3, omega_1, and omega_3. Now, ofc, we can find at least two DiffyQ's from this. And we can measure all of these, pos1, pos3, and speed 1 and 3. So let's actually change the variables to THAT and not theta. So the first two differential equations are...

Now what we need to do is come up with the function that models the speed of the motor at any given instant. Omega1 and Omega3. And to do this, I want to first look at the controller itself. How does the controller, the motor controller, handle setting things like the position. Because remember, we're doing PID position control on each joint so what's happening is we send the thetas to PID controllers that set the position which means *this will be really easy to model actually*. Because we know *exactly how theta affects velocity and etc*.

Let's talk about both the mechanical and the control structure here for one second. We have a leg with some forces on it and with a relatively high moment of inertia about joint 1, where theta_1 is. The moment of inertia about theta_3, is very small. *But* let's take a look at the MOI of the gearbox/motor combination and the effective MOI is roughly (100)^2*Jm.

Here is the data from FRC 1018 (thank you guys) who put together this document on testing the motor inertias. This can give us approximates for the total felt output inertia.

MOI = (10000)*6.660*10^(-5)=0.666 kg*m^2

So how would this compare to the MOI of the leg itself? Let's assume the leg is a point mass of mass even 5kg, with com~(0.16m) away. That's MOI of 0.128 Kgm^2! Now there's no way our leg is 5kg, if we do a more reasonable (2kg) and (0.1m), then we get an MOI of 0.02 --> this is an order of magnitude less than 0.66 which means it's relatively negligible. So let's assume the MOI of the leg to be around 0.7kgm^2 (about any joint since we're ignoring the inertia of the leg itself).

Now we need to relate the command sent to the motor to the velocity Omega1 or Omega3. Let's take a look at our implementation of the controller. We've set KP, KI, KD, etc, but we've also set a very important other quantity if we remember back to when we actually did this. We set a limit on the output of the system.

THAT LIMIT, we set that limit to 0.14 of the maximum output at any time right? And the PID controller controls the VOLTAGE to the motor, so we now exactly that the voltage to the motor from this output is 0.14*12V or the bus voltage.

Now let's think about this we're usually sending the motor tens of rotations in either direction due to the 100:1 gearbox right. Which means, at any given motor command, we reach saturation of this controller extremely fast - we found that last time right? Which means we can model the voltage going to the motor as pretty much constant unless it's within range. And if it's within range, we have the differential equation of the voltage from the PID controller's KP, KI, KD, etc! We can very simply model the voltage to the motor as a constant of 0.14, the range where PID actually acts is so small, it barely matters.

So now we can relate the derivative of omega1, the MOI we found as a model earlier, the torque produced by the motor at 0.14*12V and the torques produced by the forces on the leg and the torques due to gravity.

And this is where we get stuck on leg control right? Because to COMPLETE this model we would need to know the FORCES on the leg because these REALLY MATTER in this case even when the torque is so high. Which means we'd need force sensors on the foot to complete this model and we'd need to feed that into the controller somehow as well. That would be a whole new state. And we'd need to know the CoG of individual parts of the leg and etc. and we DO NOT. THIS is why we can't really use state-space here because we don't KNOW enough. We don't KNOW the forces on the leg so we can't actually finish our model. The leg does NOT have force sensors right. And since we have a 100:1 gearbox we can't do proprioception on the actuator side.

So for anyone who is wondering - this is *why *chip cannot use STATE-SPACE control to make things work. Even though we mentioned we could try it many times, we can *relate the states* but we have no way of observing all the needed ones to complete the model without making some massive assumptions that simply aren't accurate. So? We resort to PID because we don't have enough of a model to use state-space or we sue other traditional control practices.

This afternoon for two hours or so we're going to try to make CHIP stand on two legs right? And this will be FULLY using PID control.