首页 > 编程知识 正文

pwm控制电机转速,pwm控制直流电机转速原理图

时间:2023-05-04 09:12:37 阅读:164710 作者:4905

结论为了避免浪费大家的时间,先说结论,选择合适的电机驱动模式和PWM频率,可以大大提高直流电机的性能和可控性,对于常见的48:1减速电机,http://www.Sina

引言在一些场合,需要通过慢速来精细控制机器的运转和制动。 但是,可以看出电机的启动不是渐进的,而是突然产生速度,然后突然停止。 有时通过PWM控制速度,为什么速度的变化不均匀呢? 一个明显的原因是有刷直流电机在转速小于200rpm(200转每分钟)的情况下,如果不调整,很难获得足够的转矩来维持稳定的旋转,在高速区间速度的变化也不是线性的。 通过一些实验发现,调整PWM参数可以改善这些问题。 文章尽可能详细地描述了这些信号参数,列举了一些常见电机的测试结果,希望能通过这些数据得到改进

我们先看看PWM和直流刷电机。

PWM、直流电刷电机和电刷直流电机对输入的直流电压产生磁力进行旋转。 例如,在6V下运行的小电机在使用4节AA电池时会全速运转,但使用3节AA电池供电时速度会变慢,使用2节电池时速度会更慢。 在实际的APP应用中,增减电池数量是不现实的,需要通过软件进行控制。 这就是脉冲宽度调制(PWM )。 微控制器一般通过外置的电机驱动模块控制电机的动作,通过PWM信号控制电机的方向、速度、转矩。 PWM信号一般包括三个主要特性:占空比、衰减模式和频率。

占空比(Duty Cycle )是指在完整的PWM周期中,高电平脉冲在时间上所占的比例,通常用百分率表示。 对应PWM等效电压是供电电压乘以占空比的百分比。 PWM脉冲宽度由代码控制,宽度越宽,输出能量越高,电机旋转越快。 当与供电电压直接连接时,与占空比为100 % PWM等价

电机速度可以通过占空比来控制,但电流衰减模式和PWM信号频率的选择会影响电机的工作效率,尤其是在占空比小于30%的情况下。

衰减模式电机再循环电流衰减模式是目前电机控制中的一种特殊特性。 可以分为快速衰减和缓慢衰减。 在最简单的电机控制中,用一个开关控制电机的工作和停止,接通开关则电机运转,断开开关则电机失去动力,自行减速停止。 这种情况称为快速衰减。 这是因为输入电流迅速减少。 该模式也称为滑落模式。 这是因为,关闭开关后,电机自由打滑,进入停止状态。

在大多数情况下,例如,在边缘运动的机器中,需要对自由滑落停止进行制动控制,在这种情况下缓减模式是合适的。 该模式通过利用电机旋转时的发电效果提高了控制性。

电机的发电效果很容易验证。 用小电机连接LED发光管后,转动电机,发光管就会点亮。 这表示电机旋转时会向相反方向输出电压。 这种现象称为电动势。 emf(electro-motiveforce )的单位也是螺栓,与电压相同。

电机自由停止时会产生电压。 如果将电机的输入端短路,产生的EMF会使电机反向旋转,电机像制动器一样迅速停止。 电机驱动,如DRV8833在慢衰减模式下主动制动。 之所以称为慢衰减模式,是因为电机还在用自己产生的电流工作,电流不会马上消失。 在一些地方也称为制动模式。

the yellow-ttmotor ' sspinthresholddecreasesto 1200 rpmwhenoperatinginslowdecaymodecomparedto 3000 rpmforfastdecaymode.thatmeanmed forwardspeeddropsto 8.5 cm/sec from 21.4 cm/sec。

alsonotethatthespeedversusmotorvoltagecurveforslowdecay (bluelinearthanfastdecay ) greenline ) )。 thelinearrelationshipbetweenspeedandvoltagesimplifiescalculatingmotorspeedfromthethrottlevalue。

equivalent _ voltage=power _ supply * throttle motor _ speed=(2500 * equivalent _ voltage )-2000 gearbox _ sped=mmed themotorandgearboxoutputshaftspeedsforathrottlesettingof 0.5 are 4250 rpmand 88.5 rpm。

equivalent_vol

tage = 5 * 0.5= 2.5motor_speed = (2500 * 2.5) - 2000 = 4250gearbox_speed = 4250 / 48 = 88.5

Decay mode terminology is confusing. Remember that the decay mode describes how quickly the motor recirculation current dissipates, not its effect on motor speed. A motor's rotational speed drops more quickly when using slow decay mode (braking) as compared to fast decay (coasting).

Selecting the proper current decay mode for your project will go a long way to fine-tuning required brushed DC motor performance. One other PWM parameter, frequency, is useful for increasing low-speed torque and lowering the throttle value needed to start the motor spinning.

PWM频率

PWM频率就是每秒输出的PWM周期数, 单位是Hz, 在数学上等于周期长度的倒数 (PWM_Frequency = 1 / PWM_Interval_Period).

当计算PWM等价电压时, 我们通常假定电机工作于一个理想状态的非PWM的电源提供的电压. 但是实际情况和这个差距很大. 例如对于常见的48:1小电机, 在连接1.5V的电池时可以轻松启动, 但是在PWM等价电压为1.5V时却纹丝不动, 直到等价电压上升到2V时才开始转动, 然而一开始转动就迅速爬升到4000RPM.

这种情况, 是因为有刷直流电机的转子都包含两个/三个或更多缠绕在铁芯或其他磁性材料上的线圈, 电机在电路上类似于一个电感, 取决于匝数的大小和磁芯的材料, 线圈通常需要几个毫秒才能达到起足够推动其轴转动的力矩. 所以在使用PWM进行电机速度控制时转子线圈的电感就成为一个很大的影响因素. 直接使用直流电压供电时电机线圈的工作状态是最好的, 因为磁场达到转动的强度需要足够的时间. 而对于高频PWM, 加在电机线圈上的脉冲变化太快, 就会导致线圈在脉冲宽度上无法达到转动所需的力矩而无法转动. 此时如果在占空比不变的前提下降低PWM的频率, 随着PWM频率的降低, 脉冲宽度是在增加的, 当频率降低到某个数值之后, 脉冲的宽度就足够电机线圈产生带动转子的力矩. 这样, 电机就能在更低的PWM等价电压上启动.

对于常见的48:1小电机, 最佳的工作频率接近25Hz. 当频率为25Hz时, 电机在等价电压为0.5V时就能开始工作, 此时转速可以低至100RPM. 因为齿轮将转速减为1/48, 所以此时车轮转速才2RPM.

选择衰减模式和频率

慢衰减常用于控制有刷直流电机, 因为它可以有效制动. 另外它也能帮助占空比和电机速度保持线性关系.

比较一下这两种模式, 如果需要慢速操作, 慢衰减可以增加有效力矩并增加电机的整体速度范围. Choosing slow decay also provides a linear mapping of the software throttle setting to motor speed which is helpful when measuring velocity and distance traveled.

Slow decay mode appears to be superior in most categories, but isn't the best choice if power consumption is your primary concern. For some battery-powered robots, the power saved using fast decay mode outweighs the more precise control offered by slow current decay.

Fast decay mode is the default mode in CircuitPython motor control libraries. Changing the operational mode parameter to slow decay can be accomplished with a simple, one-line statement. See the Code Examples section for the details.

After changing the mode, test the operation to confirm that the lowest required motor speed is working as needed. If a lower spin threshold is required, try reducing the PWM frequency to the lowest possible value (usually about 25Hz) and work up towards the maximum of the motor controller. Choose the frequency that provides the best balance of torque throughout the desired speed range while balancing the motor chatter that can happen at lower frequencies.

As a rule of thumb, most small brushed DC motors will operate nicely with a PWM frequency of 50Hz to 100Hz and slow decay mode. Projects like the StringCar Racer that don't use gearbox motors seem to work best at 25Hz.

In combination with its CircuitPython library, a motor controller board will offer a range of selectable PWM frequencies as well as decay mode. The table above shows the available frequency range and mode support for a variety of Adafruit motor controllers. Refer to the Code Examples section for how to select a specific decay mode and PWM frequency for your motor controller board.

参考https://learn.adafruit.com/improve-brushed-dc-motor-performance

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。