Hi,
I am currently using the latest toolbox (2018.R1) and I am trying to create a PWM signal for motor control without any luck. I am testing using LEDs for visualization, I know they work because they light up with the GPIO high signal. I have also tried various modules and output pins, I am currently sending a duty cycle of 0.5, because I noticed in the C code it gets multiplied by a value of about 32700. I have attached a screenshot of my settings on my block, do you guys have any suggestions?
Thank you in advance.
已解决! 转到解答。
Hello fernando.barrios@uwaterloo.ca,
I tried to replicate your use case and the result was successful: the PWM period is 100ms, as you can see in the image attached. For the CH4(PD13) I used a duty cycle of 25%(0.25) while on the CH5(PD14) I used a duty cycle of 50%(0.5).
The duty cycle must be provided as "single" data type values in the interval [0.0, 1.0], proportional with the percentage of the duty cycle. This makes easier the usage of the PWM blocks alongside with the AMMCLIB blocks.
As a suggestion for your issue, please be sure that in the General Tab of the PWM blocks, the checkbox "Start PWM signals generation immediately after initialization" is checked because your board might not start the PWM and no signals generated. To be honest with you I don't think I understand your LED testing mechanism, so if the problem continues please consider attaching your model here and I will have a look.
I am waiting for your response!
Best regards,
Marius
Hello fernando.barrios@uwaterloo.ca,
I tried to replicate your use case and the result was successful: the PWM period is 100ms, as you can see in the image attached. For the CH4(PD13) I used a duty cycle of 25%(0.25) while on the CH5(PD14) I used a duty cycle of 50%(0.5).
The duty cycle must be provided as "single" data type values in the interval [0.0, 1.0], proportional with the percentage of the duty cycle. This makes easier the usage of the PWM blocks alongside with the AMMCLIB blocks.
As a suggestion for your issue, please be sure that in the General Tab of the PWM blocks, the checkbox "Start PWM signals generation immediately after initialization" is checked because your board might not start the PWM and no signals generated. To be honest with you I don't think I understand your LED testing mechanism, so if the problem continues please consider attaching your model here and I will have a look.
I am waiting for your response!
Best regards,
Marius
Hi mariuslucianandrei,
That is exactly what I was missing, I did not see the Initialization option in the advanced settings.
Thank you for your help,
Fernando