Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

T1452 SLOW LED WITH TRANSFORMER

2 posters

Go down  Message [Page 1 of 1]

1T1452 SLOW LED WITH TRANSFORMER Empty T1452 SLOW LED WITH TRANSFORMER Thu Jan 05, 2023 11:48 pm

Defran

Defran

T1452 SLOW LED WITH TRANSFORMER 1hz_fr11

Same circuit, but with transformer it is slower. If I add more hardware, it is more and more slow, it does not matter if the extra hard is contemplated in the program, with its mere presence it inceases the slowness.

Tell me please.
Attachments
T1452 SLOW LED WITH TRANSFORMER AttachmentTRANSFORMADOR_LENTO.zip
You don't have permission to download attachments.
(7 Kb) Downloaded 4 times



Last edited by Defran on Sun May 21, 2023 11:05 pm; edited 1 time in total

2T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Fri Jan 06, 2023 2:23 am

arcachofo

arcachofo

Yes, transformer is slower than a controlled source.

If I add more hardware, it is more and more slow, it does not matter if the extra hard is contemplated in the program, with its mere presence it inceases the slowness.
I can't reproduce this.
Which hardware do you add to make it slower?

3T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Fri Jan 06, 2023 8:54 am

Defran

Defran

I attach schematic with a rare delay in the seconds. Use and test are into the schematic. I wait for your comments...

T1452 SLOW LED WITH TRANSFORMER Temp0t10
Attachments
T1452 SLOW LED WITH TRANSFORMER AttachmentTEMP0_SECONDS_TEST.zip
You don't have permission to download attachments.
(9 Kb) Downloaded 3 times



Last edited by Defran on Fri Jan 06, 2023 2:42 pm; edited 1 time in total

4T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Fri Jan 06, 2023 1:46 pm

arcachofo

arcachofo

It is normal that adding more reactive and non linear components will slow down the simulation.
Anyway I will have a look.

5T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Fri Jan 06, 2023 2:27 pm

Defran

Defran

Muchas gracias.

Well, it is a simple circuit, but the delay is notorious. I tink it is a small simulator glitch that you will undoubtedly see. If you need more info, let me know it, please.

In my program, the good values to obten 1 Hz in the led (1Hz) are the called "official second values" according with the program idea, but with this is when the delay is longer (almost 10 seconds).

6T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Fri Jan 06, 2023 5:15 pm

arcachofo

arcachofo

What counts for simulation speed is how much "activity" there is in the circuit.

For example if you make the simplest circuit: a Clock an one led.
If you set the clock frequency to 1 KHz, it will run at 100% speed.
But if you set the frequency to 1 GHz it will run very slow: the circuit is simple but there is a lot of activity, so lots of cpu usage.

Non linear and reactive components can take a lot of cpu.
You can mitigate this in different ways, for example:
- For reactive components increase the reactive step, in this case you can set it to 10 us or more and speed up the simulation a lot, but this depends on the circuit.
- Reduce the number of steps in WaveGen, in this case it is not very important because frequency is very low.

Also removing unnecessary components, for example:
- Some filter capacitors: in the simulation there is no electric noise and switches don't bounce.
- Resistances for leds: you can set led internal resistance.

Also using alternative components.
- Use buffers instead of transistors if possible.
- Use Mosfet instead of BJT if transistor is really needed.

In some cases you might want a very simplified version of the circuit.
For example to test your MCU firmware sometimes you need real time (like this case).
For that you don't need most of the analog circuit, just some way to get some signals in and out of the MCU.

In this concrete case start by increasing reactive step to 20 us or more until you get 100% simulation speed.

KerimF likes this post

7T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 11:09 am

Defran

Defran

Yes, Following your instrusctions it improbes a lot, but it is not enough. If I change the "AUTO STEP" value in the reactive components to more than ZERO nothing works at all.

Tell me, please.

I Attach new schematic.

T1452 SLOW LED WITH TRANSFORMER Temp0t11
Attachments
T1452 SLOW LED WITH TRANSFORMER AttachmentTEMPO SIDE TEST_1.zip
You don't have permission to download attachments.
(9 Kb) Downloaded 2 times

8T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 12:46 pm

arcachofo

arcachofo

Auto step should be 0.

Go to Circuit toolbar->Settings->Simulation
Change "Reactive Step" to 20 us, if not enough maybe you can go even up to 50 us, but accuracy might suffer.

T1452 SLOW LED WITH TRANSFORMER Se10

9T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 1:21 pm

Defran

Defran

OK, Now it works! and now I understand what is the function of this parametires, but i see that 20us is too much. Realy more than 2 it does not work.

And now repeating again to 2, nothing works. Changing to 1, after several operation save, load, etc it works but slowly.

changing to 2000 ns it works again but only for 3 or 4 seconds, later nothing...

Tests done with T1452. Last published version.

Tell me, please.

10T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 3:36 pm

arcachofo

arcachofo

Yes, there is something wrong here... let me have a look.

11T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 4:33 pm

arcachofo

arcachofo

Seems that the voltage regulator is not happy in this circuit, I will se how to solve it.
By now you can try removing the regulator and  powering the relay directly from the 470 uF capacitor.

EDIT:
I don't know if the circuit is working as intended.
What should happen? ... something about a led...

12T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 4:50 pm

Defran

Defran

Removing the regulator and 6 us, the circuit works ok and stable, but with 7 it does not work, 6 is the limit.

The 1Hz LED always blinks at 1 second, but the time led-on decreases as it approaches at the end of the programmed time. Thus, the LED shows two things: 1hz as clock working signal and the reaining time until the end of what is programmed, which by default 1s 10 seconds with the switch in B position (test).



Last edited by Defran on Sat Jan 07, 2023 5:11 pm; edited 1 time in total

13T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 5:07 pm

arcachofo

arcachofo

Removing the regulator and 6 us, the circuit works ok and stable, but with 7 it does not work, 6 is the limit.
I have tested it up to 500 us and it's working, the voltages are way off but everything works.

What do you mean by "it does not work" ?

The 1Hz LED always blinks at 1 second, but the time led-on decreases as it approaches the end of the second, thus the time remaining in the timing is displayed.
Ok, now I understand how it works:
You just push the button briefly and the timer starts.

EDIT:
I mean 50 us...

14T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 7:18 pm

arcachofo

arcachofo

Playing with the circuit I found some curious issues...

Not 100% sure how it exactly should work, but I think there are some posible issues:

Here pulsav can overflow and start from 0 again:
Code:
do {pulsav=digitalRead(sense); pult++;}
  while (pulsav==LOW);

And I dont understand this:
Code:
if (pult<90){digitalWrite(rele, LOW);}  // Tiempo bucle inicio. Eliminacion rebotes. 1000
If there are some rebounds then everything is shut off?

Here I espected 1,6 seconds to shut off, but I think it is much less:
This loops takes maybe 10 us, so 10*6000 = 60000 = 60 ms.
Or I am missing something?
Code:
pult=0;                                                   // Pulsador.
    do
    {                                                         // ____ TIEMPO PARADA FORZADA _____
      pulsav=digitalRead(sense);                              // Lee Pulsador.
      if (pulsav==LOW) digitalWrite(RED, HIGH);               // RED ON para hacer bonito en proceso forzado OFF.
      if (pult>6000) {digitalWrite(rele, LOW); delay(90000);} // Tiempo bucle parada forzada. Retardo final. 1,6 segundos.
      pult++;                                                 // Incremento bucle parada forzada
    }
    while (pulsav==LOW);

15T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 8:10 pm

Defran

Defran

Well, I attach here the project with all modifications, now the timer works ok with 300us in "reactive step". I have included a discrete regulator for 5v. The delay in my program is not a problem because it need to be adjusted acording with the delay times to study. It is a final point in the development.

For now the problem is the regulator 7805, which makes the theme of "reactive step" not work, but this is in your hands. I await the result of your study,

I take the opportunity to ask you what is the funtion of  "Auto Step" in the reactive devices...

Thaks you for your support.

T1452 SLOW LED WITH TRANSFORMER Temp0t12
Attachments
T1452 SLOW LED WITH TRANSFORMER AttachmentTEMPO SIDE TEST_2.zip
You don't have permission to download attachments.
(9 Kb) Downloaded 2 times

16T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 9:19 pm

arcachofo

arcachofo

Cool, at least now is fast enough to test the circuit.

I didn't realize that variable pult is a long, so it will not overflow for sue.

I tried to delete 2.2 uF capacitor to speed up the simulation, but then it does not work.
It is caused by this line:
Code:
  if (pult<60){digitalWrite(rele, LOW);}
I'm curious about what is the purpose of that line.

17T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 10:20 pm

Defran

Defran

The 2,2 uF capacitor has the delay funtion in the start, it avoid start and stop at the same time, giving priority to the start. This capacitor is dicharged with the button.

In the real circuit is important to filter in the push button bounces all low pulses less thant "60" (empirically adjustable value). This makes the relay not turn on during the bounce time. This avoid oscillations.

 pult=0;                                                 // Tiempo de pulsador.  
 do {pulsav=digitalRead(sense); pult++;}
 while (pulsav==LOW);
 if (pult<60){digitalWrite(rele, LOW);}     //  Eliminacion rebotes.

This project was published with the number 164 when Simulide did not have transformers. Now I will publish it again with transformer. This is important because the idea is to be completly disconnected from the electrical network without consumtion. I have this projet done and running. In #164 post real scheme and photos,



Last edited by Defran on Sat Jan 07, 2023 10:52 pm; edited 2 times in total

18T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sat Jan 07, 2023 10:24 pm

Defran

Defran

The regulator (de nuestros pesares) is necessary to feed the controller as well. For the moment I have put a discrete regulator until you solve the prblem with the 7805.



Last edited by Defran on Wed Jan 11, 2023 10:41 pm; edited 2 times in total

19T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sun Jan 08, 2023 12:04 am

arcachofo

arcachofo

The 2,2 uF capacitor has the delay funtion in the start, it avoid start and stop at the same time, giving priority to the start. This capacitor is dicharged with the button.
Ok, now I understand.

In the real circuit is important to filter in the push button bounces all low pulses less thant "60" (empirically adjustable value). This makes the relay not turn on during the bounce time. This avoid oscillations.
I thought that this was the only function of this capacitor, that's why I tried to remove it, in the simulation debouncing is not needed.

I forgot about the auto-step:
https://simulide.forumotion.com/t938-simulation-speed-reactive-components

20T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sun Jan 08, 2023 7:43 pm

arcachofo

arcachofo

Problem with Voltage Regulator solved at trunk Rev 1493.

21T1452 SLOW LED WITH TRANSFORMER Empty Re: T1452 SLOW LED WITH TRANSFORMER Sun Jan 08, 2023 7:57 pm

Defran

Defran

Bieeeennnn!

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum