Using the PPG in Processor Expert

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using the PPG in Processor Expert

ソリューションへジャンプ
2,996件の閲覧回数
AK88
Contributor I

I have a set of Servos that are RC servos, they do not operate on a PWM signal.  I need to drive these using a square wave and the PPG seems like it would work.  My frequencies are:

Forward: 800 Hz

Neutral: 350 Hz

Reverse: 230 Hz

Any chance I could get some assistance on how to go about using the PPG, my chip is the MCF51JM64VLD 44 Pin LQFP.  Thank you!!

0 件の賞賛
返信
1 解決策
2,227件の閲覧回数
Petr_H
NXP Employee
NXP Employee

Hi,

both the PPG component or  PWM can be used. As it was already mentioned, the servo just takes length of the active pulse.In the past we made a demo for HCS08 SH8 that used PWM component for driving a servo.

The PWM component was set to period 20ms and the angle was set using SetDuryUS which sets the time in microseconds (1000-2000). You just should be careful to use timer with enough resolution.

You can check servo timing for example here: http://www.epanorama.net/documents/motor/rcservos.html

best regards

Petr Hradsky

Processor Expert Support Team

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
2,227件の閲覧回数
JimDon
Senior Contributor III

I am very familiar with the 51JM, but I am not sure what you mean when you say PPG (must be a processor expert thing). Also, to drive an RC servo, you do not really need a square wave, just a pulse where the width is the right period.

I have used Output Compare mode on the Timer/PWM module triggered off the RTC to periodically send a pulse to an RC server and it works fine.

Would this work in your case?

2,227件の閲覧回数
AK88
Contributor I

I am using these, so they are not RC servos, I was wrong.  They are not driven with PWM, so I need to create a square wave signal (which yes, I could do with PWM) but I need to change the frequency when the go into neutral, and reverse.  I want to be able to stop the vehicle, start it, move it in reverse and such.  PPG is a processor expert thing, seems to allow one to create a period and duty cycle percentage, so it seems as though it would work.  I am asking this here because I want some more background and ideas before I test it next week. Appreciate your response!!!

0 件の賞賛
返信
2,227件の閲覧回数
JimDon
Senior Contributor III

First of all, it is often mistakenly believed that RC servos use PWM, when in fact they don't. They only care about the on time, not the off time. In fact modern "digital" servos, only have to be pulsed once and then remember it and hold the position.

One problem is that each Timer/PWM module can only generate a square wave at one frequency at a time. That is, each channel will have the same period, so if you need many channels, that may not work.

2,227件の閲覧回数
AK88
Contributor I

That is what I am afraid of, so this PPG may work, which I will be performing next week, or I may have to purchase new servos, not sure. Thanks for the info!

0 件の賞賛
返信
2,228件の閲覧回数
Petr_H
NXP Employee
NXP Employee

Hi,

both the PPG component or  PWM can be used. As it was already mentioned, the servo just takes length of the active pulse.In the past we made a demo for HCS08 SH8 that used PWM component for driving a servo.

The PWM component was set to period 20ms and the angle was set using SetDuryUS which sets the time in microseconds (1000-2000). You just should be careful to use timer with enough resolution.

You can check servo timing for example here: http://www.epanorama.net/documents/motor/rcservos.html

best regards

Petr Hradsky

Processor Expert Support Team

0 件の賞賛
返信
2,227件の閲覧回数
JimDon
Senior Contributor III

There are still other ways to skin the cat.

A periodic timer at say 50us with counters that count down and then toggle the bits.

I'm not sure how accurate the square wave needs to be, and that would determine how fast you need the periodic timer to run.

0 件の賞賛
返信