Input floating element problem

A.Y
A.Y Altair Community Member
edited July 9 in Community Q&A

Hi,

 

I am trying to produce PWM signal with variable frequency. But i could not do this. When i try to produce that signal like in the pwm photo, the system warns like in the error photo. How can i solve that problem. My output variable type  from c block is double. Could somebody help me about that problem ? 

Answers

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited July 4

    do the code gen examples run? This error looks to be a secondary error, there is something else wrong in the sim. Can you post a bigger screenshot?

  • A.Y
    A.Y Altair Community Member
    edited July 5

    Yes code gen run, if i don't connect to the ADC block. That is the bigger screenshoot.

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited July 5
    A.Y said:

    Yes code gen run, if i don't connect to the ADC block. That is the bigger screenshoot.

    can you put all this on the other side of the ADC? It will need to be there if you are doing a proper digital control setup as the cblock is currently "outside" the MCU and will not be included in the code.image

     

    Can you also try with A0 grounded or with a constant applied? also what is the rate of the ZOH fs the PWM frequency?

  • A.Y
    A.Y Altair Community Member
    edited July 9

    I tried this but unfortunately could not run simulation. After that i tried replaced C block with Simplified C block, At least simulation is working for now. Maybe C block can not use with ADC or there is another something wrong but i can not solve that .

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited July 9
    A.Y said:

    I tried this but unfortunately could not run simulation. After that i tried replaced C block with Simplified C block, At least simulation is working for now. Maybe C block can not use with ADC or there is another something wrong but i can not solve that .

    ah, which type of C block are you using? the simcoder c block or the code gen c block? there is a bug with the simcoder c block and I have a patch I can send you.

     

     

  • Rhonda_20369
    Rhonda_20369 New Altair Community Member
    edited July 9

    Where do you put your C block in your real engineering system?

    If the C block is outside the F28335 DSP, do you have another MCU to run the code?

    If the C block is inside the F28335 DSP, you should put the block at the output of the ADC, not the input of it.

    If the C block is inside the DSP, you must use either a Simplified C block or a SimCoder C block for code generation. 

    As Albert has stated, PSIM2024.0 needs a service patch package for code-gen if the Simplified C blocks or SimCoder C blocks are used in a schematic. If you are using other PSIM versions, you don't have this problem.

    Please use the Altair support portal to create a support ticket so we can send you the PSIM2024.0 service package.
    Here is how you can create a support ticket:
    Contact Support