Modelling the Maslow Sled

Hi,

New guy here that does not have a Maslow (yet). Has anyone tried building a state space model of the maslow and using this to find a suitable controller? I’ve been reading the forums and it seems like tuning the PID loops can be problematic. My guess is that basing the controller on a mathematical model will let you run the sled at higher speeds while keeping stability.

As a disclaimer, I’m no expert in this matter, but have been doing a little research into it as a thought experiment. I took several controls classes in college, but that was a decade ago and have only dabbled since. However, I would like to try to collaborate on this with someone if they are interested.

Andrew

4 Likes

We do have a mathamatical model of where the sled should be, the PID loops are
to drive the motors to match the model.

1 Like

This would be to replace the PID loops. You would model the physics of the sled with differential equations. The inputs to the system would be position and the output would be motor torque/current.

I think the procedure is that you linearize the differential equations and convert them to a state space model. Once you have the state space model you can find the transfer function. If you have the transfer function you can design controller optimized for the process (ie you could specify amount of overshoot and design them in such a way that the controller loops do not interact/oscillate).

Again, I’m no expert, so I might be off on some things, but this is the general idea.

but that requires that you have an accurate model of the motor performance at
different speeds, which we don’t have (especially for DIY systems using
non-standard motors)

David Lang

Torque is proportional to current in dc motors. If the motor controller can monitor current, lifting know weights, at known speed, with known sprocket geometry you could figure out the current/torque curve.

except that as you change the PWM power level, it’s not a single curve.

We tried this. The early versions of Maslow did a ‘motor calibration’ step where
it moved the sled around at different power levels and watched the encoders to
figure out what speed it was getting, and the results were horribly unstable.

In addition, the current motor controller doesn’t have a current measurement
capability, so even if it did work, it couldn’t be implemented on existing
machines.

The idea of modeling things so that you don’t have to measure them is a very
attractive approch, but it utterly collapses when you hit the real world where
every machine is unique, and no two motors provide exactly the same performance.

Add to this that the friction of the sled is going to vary depending on
conditions, and the force that needs to be applied to move the sled at a given
speed is not predictable. The best that you can do is to make an educated guess,
watch what happens, and adjust your controlls to reduce the error. This is
exactly what the PID loops are there to do.

Changing PWM does not change power level, it is essentially changing voltage. What you tried with the motor calibration is not what I am describing to do to characterize the current vs torque curve.

It is obvious that while doing your motor calibration moves it was unstable. Your “model” was saying that it takes the motor the same amount of force to move the motor regardless of the relative angle of the chain. This is obviously not the correct if you look at the extreme cases. Ie if the sled is directly under the motor moving vertically or if the sled is to the slide moving exactly horizontally.

I did not realize that the current controller does not have current feedback. This is an interesting point and I will have to think on this for a while.

The point of modeling a system is not so you do not have to measure things and it is not intended to replace your PID or controller. If you have an even simple system model it lets you make a better educated guess when choosing values for your controller. I fully agree with you that you must observe the system and adjust after making your choices. It is an art and science.

If you are interested, I’ve been reading parts of this book http://www.cds.caltech.edu/~murray/books/AM08/pdf/am07-complete_17Jul07.pdf I’m not absorbing all of it, but it’s well written compared to the other books I have looked at recently.

Andrew

1 Like

Changing power level is exactly what changing the PWM percentage does. At least when I was in EE school (when my good friend Sly Drool was my closest companion. No computer like my daughter insisted engineering school was impossible without, although she was a ChE and clearly improperly educated :duck::duck:) power was a function of current and voltage with a little imaginary math thrown in for that pesky inductance stuff

1 Like

pwm-ardu

1 Like

No power to all the power!

Normally changing PWM does not directly control the power output of your motor. Yea I agree P=I*V. PWM controls the V part of this equation. The current is a function of the motor load. You could output the the same PWM value to a motor that is free wheeling or to a motor that is stalled and get two different power values.

I might be able to be convince that for this specific application changing PWM directly controls the motor power, but I would have to see a free body diagram.

The current limiting driver alters the equation. The driver’s response isn’t a perfect square wave, and the motors inductance will resist a change in current, but it’s close enough for our purpose that it can be considered a near-constant current device.

The present PowerControl board doesn’t use the current control function of the L298, though.

Well, that shot down my argument🍃

1 Like

They didn’t have free body arguments when I was in engineering school ( free beer arguments were more likely) but it’s in a slowly changing load environment

1 Like