Using the PPG in Processor Expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using the PPG in Processor Expert

Jump to solution
1,616 Views
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 Kudos
1 Solution
847 Views
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

View solution in original post

0 Kudos
6 Replies
847 Views
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?

847 Views
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 Kudos
847 Views
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.

847 Views
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 Kudos
848 Views
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 Kudos
847 Views
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 Kudos