pwm NOT behaving

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
go233
Posts: 96
Joined: Mon Mar 02, 2015 12:32 pm
Has thanked: 5 times
Been thanked: 11 times
Contact:

pwm NOT behaving

Post by go233 »

Hello,

in the program I have attached here, the MIAC does not switch off the PWM coming out A, but it does from the PWM coming out of C.
Plus this program does not seem to change the duty cycle on the fly.
In general I am bit confused about how to turn on and off PWM: is PWM disable sufficient to turn it off? or I need to use OUTPUT ? or do i need both?
Could you help me, please?
Attachments
main v 4_0.fcfx
(35.08 KiB) Downloaded 317 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: pwm NOT behaving

Post by LeighM »

Hi,
I had a quick look at your program, but cannot yet see where the problem is.
Although one issue found was that both PWM components were set to the same channel.
I think it's a program logic issue though, as I've just done a quick test program which does correctly turn off the PWM with only PWM disable.
Hope it helps ...
Attachments
MIAC PWM TEST.fcfx
(34.44 KiB) Downloaded 309 times

go233
Posts: 96
Joined: Mon Mar 02, 2015 12:32 pm
Has thanked: 5 times
Been thanked: 11 times
Contact:

Re: pwm NOT behaving

Post by go233 »

Hi,
your program works just fine.
Mine does not work and I am desperate I don't know what to do.....I tried different combination, but as the simulation will show you the PWM1 does not switch off and PWM2 does not turn on.
What to do? Could you help me ,please?
I think there is a bug in the PWM macro.....
what do you say?
Attachments
main v 4_0.fcfx
(39.19 KiB) Downloaded 293 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: pwm NOT behaving

Post by LeighM »

Hi,
Yes, you are right, the PWM component does seem to have some quirks in simulation.
The duty mark/space graphic only updates when the PWM is in an enabled state, so maybe best in your program to Enable and then set Duty.
The duty mark/space graphic remains static when the PWM is in a disabled state, so there is no indication that the PWM is disabled.
It should all work OK on the target MIAC, apart from the fact that you need to change PWM2 to use Channel 2 (both PWMs are currently set to Channel 1 in your program).

I'll have a look at our PWM component and see if I can change the graphics such that it is clear when it is enabled or not.

Leigh

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: pwm NOT behaving

Post by LeighM »

Hi,
I've added an Enabled/Disabled indicator and also now update the Duty when disabled.
So if you replace this into your components directory it should help diagnose your application.
Leigh
Attachments
PWM.fcpx
(8.92 KiB) Downloaded 296 times

go233
Posts: 96
Joined: Mon Mar 02, 2015 12:32 pm
Has thanked: 5 times
Been thanked: 11 times
Contact:

Re: pwm NOT behaving

Post by go233 »

Hi,
as you said the program works on the target, fine.
I am going to check the simulator....
Giovanni

Post Reply