Debugging C Code of Heating Machine - PWM & Actual Current

In summary: Duty cycle is a percentage of time the PWM output is on. It is important to understand as it will have an impact on what can be controlled with PWM. In summary, rama1001 is trying to change the PWM cycles so that they are always constant, even though the actual current changes. He is unsure if he can do this without causing problems.
  • #1
rama1001
132
1
Hi,
I am debugging a C code of a heating machine. I am so confused about real time current and programming control over all the parameters of the machine. The code was written by some one though, i understand it well until now.
Problem is that the previous code works according to the actual current and the PWM cycles are purely depending on the actual current. I want to change this varying PWM cycles to constant PWM cycles even though the current changes. I noticed that the PWM cycle generation was depend on the actual current that generated from the transformer and because of that reason these cycles are always changing their period time.

My doubt is that, if i make this to constant PWM cycles even though the actual current not same for all the working time. Is this to show only to customers or the current should also constant during this constant PWM cycles?
 
Engineering news on Phys.org
  • #2
I guess I don't understand your post at all. The way I read it makes me believe that you have the cause and effect reversed. If the load doesn't change and the duty cycle of the PWM doesn't change, then how can the current change?
 
  • #3
My take on this is that rama1001 is planning to change it from a variable period to a fixed period--and within that period vary the duty cycle. Such a major redesign falls outside my usual definition of "debugging".

I suggest that rama1001 get his supervisor's approval to proceed on this course before investing time in it. Can we assume the program does not control the heating satisfactorily as it stands?
 
  • #4
mention of heaters and transformers suggests some form of AC power is being controlled.

is it possible that the code senses the AC signal and implements phase angle modulation control? this may appear as variable period PWM to somebody who wasn't aware of this method.
 
  • #5
My guess is that the OP understands less than we even think. Nowhere in the original post do I see the words "duty cycle". What exactly does this mean:
I want to change this varying PWM cycles to constant PWM cycles.
I have never had a discussion of PWM without mentioning the words duty cycle.
 

1. What is debugging and why is it important?

Debugging is the process of identifying and fixing errors or bugs in a computer program. It is important because it ensures that the program runs correctly and produces the desired results.

2. How do I know if my code needs to be debugged?

If your heating machine is not functioning as expected, such as not reaching the desired temperature or not turning on at all, then it is likely that your code needs to be debugged.

3. Can debugging C code be challenging?

Yes, debugging C code can be challenging because C is a low-level language and does not provide built-in error handling mechanisms like other high-level languages. As a result, identifying and fixing errors can be more tedious and time-consuming.

4. What is PWM and how does it relate to debugging a heating machine?

PWM stands for Pulse Width Modulation and it is a technique used to control the amount of power delivered to a component, such as the heating element in a heating machine. Debugging PWM code may be necessary if the machine is not producing the desired temperature output.

5. What is the role of actual current in debugging a heating machine?

Actual current refers to the amount of electrical current being drawn by the heating machine. Debugging actual current may be necessary if the machine is drawing too much or too little current, which can affect its performance and potentially cause damage.

Similar threads

Replies
23
Views
6K
Replies
2
Views
4K
  • Electrical Engineering
Replies
14
Views
793
  • Electrical Engineering
Replies
7
Views
13K
  • Electrical Engineering
Replies
15
Views
2K
  • Electrical Engineering
Replies
2
Views
1K
Replies
13
Views
5K
  • Electrical Engineering
Replies
14
Views
3K
Replies
7
Views
872
Replies
5
Views
5K
Back
Top