This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HOW CAN I MEASURE THE EXTERNAL PWM SIGNAL ?

Hi,

I'm new person on this forum. I'm working on a project. I encountered a problem with PWM. I have a remote control to control the servos using PWM. The remote control produces a pwm signal with different duty . Therefore, I need to observe and find its width(both Ton and Toff). What should I suppose to do first ?

Thanks in advance.

Batuhan 

  • Hello Yildirim,

    What is the frequency of the PWM signal, what is the duty cycle min and max to be measured and what is the error that your application can sustain?

    Regards
    Amt
  • Hi Amit,

    We note, "remote control" which suggests the PWM may be modulating an RF or Infra-red wave - which adds to the fun.

    I'd ask, "Why must the (always) unspecified PWM be measured - to what point? And - should that measurement be obtained - then what?

    We're getting a "fraction of the story" - poster is good enough to (admit) he doesn't know what to do - and the forum enables he (and all others) to proceed unguided!
  • Hi Amit,

    The frequency is 2.4 GHz. Min duty cycle is %5 or %10, max duty cycle is %90 or %95. %5 or lower error can be exceptable.
    First I thought that, I find the rising edge of the pwm signal then changing with parameter I find the falling edge and so on. But I'm searching a different solution.

    Regards,
    Batuhan
  • We note - as this reporter surmised - that poster lists the "carrier frequency" NOT the (requested) frequency of the PWM signal.

    The PWM signal - modulating that 2G4 RF - is usually w/in the 5 - 20KHz frequency range.

    In answer to this poster - that PWM signal may be (far more easily & comfortably) measured either "pre or post" its application to the RF carrier.   It may be measured at the transmitter - prior to its introduction to the RF stage - or at the receiver - after the PWM has been "demodulated."   The 2G4 RF carrier is incidental to the PWM duty cycle - and in fact, "gets in the way."

  • Hello Batuhan

    Are you sure the PWM signal is a 2.4 "GHz". Which remote control is this?

    Regards
    Amit
  • Hi cb1

    Actually, I don't know the frequency of the PWM signal. Tomorrow, I will observe its output with the oscilloscope. When I note the frequency , Which path do I need to choose? Does falling edge and rising edge method works ?

    Regards,
    Batuhan
  • Greetings Batuhan,

    You should be able to quickly & easily measure the PWM frequency - and duty cycle - provided you perform your PWM probing either, "Pre or Post" the RF stage. (it IS possible to extract the PWM from the RF stage - but such proves more complex - and (likely) unnecessary in your application.)

    At your transmit side - you should be able to "probe/intercept" the signal from (the unknown/unspecified) MCU (unlikely to be TM4C) which feeds into the RF stage. Depending upon the complexity of your remote control - more than one PWM "train" may be embedded. (we'll pray that proves NOT your case)

    If you have access to the receiver side - and the servo - monitoring the signal at the servo - (may) reveal (both) PWM frequency and duty. "Devil in the details" - few usable details have arrived...
  • After the measuring pwm frequency I will do your solution that you said both transmit and receiver side. It looks little complex but I'll see what i can do.

    Thank you for answers both cb1 and amit.
  • Hello Batuhan

    Still unclear what "remote control" it is? Wireless, modulated Consumer Infra Red?

    Regards
    Amit
  • Hi Amit,

    I'm quite certain that this poster's "remote" is not TM4C based. (I know of NO TM4C based, commercial remote - and if his was so based - there's a good chance such would have received mention.)

    Perhaps poster wishes to employ TM4C to "measure" the PWM duty cycle - or alter it - or???
    Have we spoken/written/ever mentioned the complexities introduced by (completely) "Unguided Posters?"
  • Hello cb1

    Yes, I do know that. My question is still stuck in the first post "I have a remote control to control the servos using PWM."

    So is it remote control using PWM or servo using PWM. I am making sure that the association of the PWM is clarified.

    Regards
    Amit
  • Hi Amit,

    Amit Ashara said:
      So is it remote control using PWM or servo using PWM.  I am making sure that the association of the PWM is clarified. 

    My suspicion is that the PWM modulates the RF carrier @ the remote TX head - and then that carrier is received (remotely @ the RX) and demodulated - exposing the original PWM duty cycle & frequency - which drive the servos.

    Where, how, even "if" the TM4C "comes out to play" - is "unguided" - thus a (highly expected) and unwanted, mystery...

  • Hi Amit

    It's not based TM4C microcontroller its name is FLY-SKY FS-T6 radio controller. It contains 6 channels so it produces 6 different PWM signals. However, I don't know PWM's frequency yet.

    Hi cb1

    As like you said, I'm just using the TM4C to measure the PWM duty cycle.

    Forgive me, I couldn't explain the what I want to do at first. I'm new at this forum and microprocessors.
  • Hi back,

    And - once you've "measured" the PWM duty cycle - what will you do w/that info?

    Indeed Amit's MCUs can well measure to your need - yet they must be programmed and you must master the IDE.  (development environment)

    If you can borrow a scope - or lab student - you may learn the Duty Cycle & Frequency of the PWM - with very minimal time/effort.   (may be worth considering!)

  • I will explain the situation again. I guess that I could not tell correctly.

    First of all, I have 6 servos that are controlled by the my remote controller(FLY-SKY). It sends PWM signal to the servos to control servos. Also their signal pins(servos pins) are connected to TM4C microcontroller to observe how much duty cycle each servo received. It's like a feedback. I just want to know how much duty-cycle signal servos received using the TM4C.
  • Hi cb1,

    Yes, I'm lab student and tomorrow I will observe its output and I just want to see its pwm via Putty and to make feedback.
  • yildirim batuhan said:
    I'm lab student and tomorrow I will observe its output and I just want to see its pwm via Putty and to make feedback.

    Do realize that, "Just wanting to see PWM (frequency & duty cycle) via any ARM MCU - may well take several days worth of time/effort!"    Is that acceptable?

    Working w/a scope - and probing correctly - same info can be gleaned w/in a few hours (sometimes faster.)

    Once you KNOW the PWM frequency and duty cycle - what will you do with that info?   That's the question both Amit & I have - unclear to both...

  • Once I know the PWM duty-cycle(from remote control), I will write a new code to produce PWM signal from TM4C and I will use it on servos too. After that I will compare the both of them in PWM . That's all what I am going to do and also yes I realized that ıt looks hard but I think I can manage it in 1 week.

  • Ok - thank you - please realize this is the first writing which "clarifies" your need and intent.

    I have some experience w/remote controls (past contracted for Futaba) and your TM4C must do far beyond "just generating PWM" it must read various joy-sticks & panel command/control buttons - integrate them all - "while" pushing PWM streams across six channels.

    Can it be done - I'd say Yes - in one week - I'd NOT "bet the farm."