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?
pwm NOT behaving
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: pwm NOT behaving
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 ...
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 365 times
Re: pwm NOT behaving
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?
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 362 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: pwm NOT behaving
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
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
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: pwm NOT behaving
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
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 359 times