How to genereate PWM by using AWG for Picoscope 2208B

Post discussions on projects you are working on
Post Reply
avi.patel001
Newbie
Posts: 0
Joined: Fri Oct 30, 2020 9:44 pm

How to genereate PWM by using AWG for Picoscope 2208B

Post by avi.patel001 »

Hello Folks

I am working on the PicoScope 2208B, Can We generate the PWM signals by using AWG? If yes then Can you please guide me through the procedure?

Thanks
Avi

Gerry
PICO STAFF
PICO STAFF
Posts: 970
Joined: Mon Aug 11, 2014 11:14 am

Re: How to genereate PWM by using AWG for Picoscope 2208B

Post by Gerry »

Hi Avi,

Unfortunately, you can't modulate the duty cycle of a pulse waveform in the Arbitrary Waveform Generator, as you can only use the fixed version of a customized waveform. Some of our Data loggers have Digital outputs that can be modulated to provide a PWM waveform (in PicoScope 6, or using our SDK), such as our PicoLog 1216, and DrDaq, but not the PicoScope 2208B.

With some clever manipulation of functions it may be possible to generate a Math Channel that is pulse width modulated by some other function, but this would be a bit pointless, as it would not be able to generate any stable waveform for external use.

Regards,

Gerry
Gerry
Technical Specialist

JoeD
Newbie
Posts: 0
Joined: Mon Jan 27, 2020 6:10 am

Re: How to genereate PWM by using AWG for Picoscope 2208B

Post by JoeD »

Good Day,

while I cannot comment on the picoscope model 2208B, I can confirm that an arbitrary PWM signal can be generated using the PicoScope - PC Oscilloscope software version 6.14.23.5207 and a PicoScope Model 3203D MSO. At least a basic arbitrary PWM signal can be generated as follows:
  • Configure the Signal Generator for arbitrary operation.
  • Create a binary bitstream where the binary or hex pattern matches the desired PWM duty. For example, you use "0x1" for a 25% duty cycle, "0x3" for a 50% duty cycle and "0xF" for a 100 % duty cycle per the attached screenshot.
  • Remember that the whole pattern or bitstream is generated at the specified frequency, i.e. the period is divided into equal timeslots for every pattern. In the given example, the bitstream "137BF" has five patterns, each with a duration of 1/5th of the total period (1/frequency). So, with a 1 kHz frequency, every pattern has a timeslot of 1/5 * 1 msec = 200µsec.
  • Each single hexadecimal digit is represented by a nibble or 4 bits. Consequently, the shortest pulse in our example is as follows: For "0x1" it is 1/4th of the timeslot or 200µsec / 4 = 50 µsec.
  • The 2nd attached screenshot shows the PWM signal resulting from the example bitstream "137BF" (blue trace). The green trace is a low-pass filtered signal (custom Math channel, corner freq. of 5 kHz). I am showing this as PWM signals are quite often used for driving actuators with a low-pass characteristic such as motors..
Have fun,

JoeD
Attachments
picoscopeAWG_PWM_May2021.jpg
picoscopeAWG_1_May2021.jpg

Gerry
PICO STAFF
PICO STAFF
Posts: 970
Joined: Mon Aug 11, 2014 11:14 am

Re: How to genereate PWM by using AWG for Picoscope 2208B

Post by Gerry »

Hi JoeD,

This one is all about interpretation of the original question posted here.

Forum questions are often phrased differently to the required literal meaning, I chose to discuss the most likely required PWM functionality by someone who is unaware of the full capability of the AWG in our PicoScopes. So, my interpretation of the most likely question being asked here is "Can we modulate the pulse width of a signal in real-time using the AWG?" i.e. can we change the duty cycle of a square waveform according to an external control, as that would be useful in more applications than just generating a fixed already modulated waveform.

So, just to be sure that there is no confusion, from anyone reading this post, while you CAN create waveforms that have already been pulse width modulated in a PicoScope AWG (and thanks for posting the example), you CAN'T change the duty cycle of a square waveform, according to an external control, in a PicoScope AWG.

Regards,

Gerry
Gerry
Technical Specialist

JoeD
Newbie
Posts: 0
Joined: Mon Jan 27, 2020 6:10 am

Re: How to genereate PWM by using AWG for Picoscope 2208B

Post by JoeD »

Good Evening Gerry,

thanks - we are in agreement that the method I have explained only provides "a basic arbitrary PWM signal".
And you are correct that the AWG does not provide any means of a real-time-controlled PWM signal, of course.

Now, as that might be a very useful feature to have - please can we get this added to your list of feature requests? I have no idea if that is feasible or how much effort it would take to implement this.

Cheers,

JoeD

Gerry
PICO STAFF
PICO STAFF
Posts: 970
Joined: Mon Aug 11, 2014 11:14 am

Re: How to genereate PWM by using AWG for Picoscope 2208B

Post by Gerry »

Hi Joe,

I'll log the feature request, but just be aware that your last comment is likely to be poignant regarding the outcome.

Regards,

Gerry
Gerry
Technical Specialist

Post Reply