搜索
金币充值液压资料下载官方微信群
楼主: PEN

使用Python进行液压缸模拟

    [复制链接]
  • 打卡等级:无名新人
  • 打卡总天数:3
  • 打卡总奖励:9
发表于 2019-9-28 20:41:43 | 显示全部楼层
PEN 发表于 2018-4-9 01:34
我喜欢使用简单的开环线性模型进行仿真。
OLTF(s)= K *ω^2 /(s *(s^ 2+ s *ζ*ω* s+ω^2)
Python ...

Hi  Peter,

I noticed the three differential equation in your openloop simulation are:

1.  dPosition(t)/dt=v (last round)
2.  dVelocity(t)/dt=a (las round)
3.  dAcceleration(t)/dt=jerk= -c^2·v-2·ζ·ω·a+ω^2·K·control

yet I don't know where the third one comes from, if follow your post here
https://www.iyeya.cn/thread-60194-1-1.html


you said:

you use equation below:

x'+ 2 * zeta * omega * x'+ omega ^ 2 * x = A(t)

1. is the first x' translation mistake, should be x'' ?
2. I don't know the first term -c^2·v and the secon term -2·ζ·ω·a come from, could you please explain them in detail? Thanks.


回复

使用道具 举报

  • 打卡等级:偶尔看看
  • 打卡总天数:107
  • 打卡总奖励:321
 楼主| 发表于 2019-9-30 01:05:15 | 显示全部楼层
1.        You are correct.  I corrected the error above.
2.        I could not find dAcceleration in English on iyeya.cn.   I searched on Google. I also searched my own document.
I have a document where I keep track of what I write by topic URL.

1.你是对的。 我更正了上面的错误。
2.我在iyeya.cn上找不到英文的dAcceleration。 我在Google上搜索。 我还搜索了自己的文档。
我有一个文档,可以按主题URL跟踪编写的内容。

回复

使用道具 举报

  • 打卡等级:无名新人
  • 打卡总天数:3
  • 打卡总奖励:9
发表于 2019-9-30 12:29:11 | 显示全部楼层
PEN 发表于 2019-9-30 01:05
1.        You are correct.  I corrected the error above.
2.        I could not find dAcceleration in English on i ...

why I need to know how they come from is because I want to use the method to calculate ζ,the way you posted in here:
https://www.iyeya.cn/forum.php?mod=viewthread&tid=60194&page=1#pid474360


Then I modefied the py file you uploaded and made a model with

ζ = 0.333333
ω = 10*2*pi
K = 13.4815 mm/s/%


and I creat a openloop with control increasing from 0 to 30%, and increasing ratio is 300 %/second, finally I got curve and result below


30-300.png

jerk,control vs time

jerk,control vs time


Average velocity = 404.4436
Shock percent = 0.0730


then the model ζ was calculated,  0.6401, is far greater than the value I made this model.
So what's wrong with my code? thanks very much.
回复

使用道具 举报

  • 打卡等级:偶尔看看
  • 打卡总天数:107
  • 打卡总奖励:321
 楼主| 发表于 2019-10-1 22:56:15 | 显示全部楼层
本帖最后由 PEN 于 2019-10-1 22:59 编辑

您必须尝试通过测量过冲来计算阻尼系数。 除非控制输出立即更改,否则将无法正常工作。 在您的示例中,控制输出逐渐变化。

You must be trying to calculate the damping factor by measuring the overshoot.   That will not work unless the control output changes instantly.  In your example the control output changes gradually.
我修复了Python代码中的某些问题。 新代码在
https://deltamotion.com/peter/py/HydSim.zip


I fixed some things in the Python code.  New code is at
https://deltamotion.com/peter/py/HydSim.zip



回复

使用道具 举报

  • 打卡等级:无名新人
  • 打卡总天数:3
  • 打卡总奖励:9
发表于 2019-10-2 08:53:16 | 显示全部楼层
PEN 发表于 2019-10-1 22:56
您必须尝试通过测量过冲来计算阻尼系数。 除非控制输出立即更改,否则将无法正常工作。 在您的示例中,控制 ...

It works!!! Thank you Peter!
回复

使用道具 举报

  • 打卡等级:无名新人
  • 打卡总天数:12
  • 打卡总奖励:38
发表于 2019-10-9 13:57:40 | 显示全部楼层
PEN 发表于 2019-6-17 00:07
我改变了一些参数让你开始。
您可以在5个地方更改参数。
@ 1是开环增益,固有频率和阻尼系数改变的地方。 ...

teacher pen:

Thanks for you program, and it's great, but I want to know how to choose moveabsolute or movesine?

回复

使用道具 举报

  • 打卡等级:无名新人
  • 打卡总天数:3
  • 打卡总奖励:9
发表于 2019-10-11 19:05:32 | 显示全部楼层
cn_young 发表于 2019-10-9 13:57
teacher pen:

Thanks for you program, and it's great, but I want to know how to choose moveabsol ...

在Hydsim-linear.py里,看定义运动的这一块,
以下两行没被注释的时候是直线运动
move = ma.MoveAbsolute(800, 500, 500, 300)
tg = move.tgcos

以下两行是按照sin曲线运动

move = ms.MoveSine(1.02, 8, 0., 0)                # @2
tg = move.tgsine

这两种运动只能选一种,然后将另外两行注释掉即可。

回复

使用道具 举报

  • 打卡等级:无名新人
  • 打卡总天数:12
  • 打卡总奖励:38
发表于 2019-10-12 08:16:47 | 显示全部楼层
工业智造 发表于 2019-10-11 19:05
在Hydsim-linear.py里,看定义运动的这一块,
以下两行没被注释的时候是直线运动
move = ma.MoveAbsolu ...

ok了,非常感谢
回复

使用道具 举报

  • 打卡等级:无名新人
  • 打卡总天数:12
  • 打卡总奖励:38
发表于 2019-10-14 07:47:13 | 显示全部楼层
工业智造 发表于 2019-10-11 19:05
在Hydsim-linear.py里,看定义运动的这一块,
以下两行没被注释的时候是直线运动
move = ma.MoveAbsolu ...

还想问下,kp/ki/kd/k2/kv/ka/kj是自动优化的吗?自己可以修改吗?

谢谢
回复

使用道具 举报

  • 打卡等级:无名新人
  • 打卡总天数:3
  • 打卡总奖励:9
发表于 2019-10-14 08:23:12 | 显示全部楼层
cn_young 发表于 2019-10-14 07:47
还想问下,kp/ki/kd/k2/kv/ka/kj是自动优化的吗?自己可以修改吗?

谢谢

不是自动优化的,可以自己修改。因为代码不多,建议你把所有模块的代码都读一遍,理解一下模拟过程。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则