(you are viewing a thread; or go back to
list of threads)
PWM problem in LDmicro (by Solt)
Hi,
in ldmicro there is a problem with pwm output. Ldmicro is too slow for converting ADC to PWM. I'm right? I have the same problems with a 16f88 20MHz osc. PLC cyc.time 10ms, if I go below 10ms it restarts itself. if i go over 30ms to plc cyc.time pwm goes with interruptions with 32KHz PWM, if the freq. is 1,22KHz also with interruptions but less often. If I use without pwm, everything is good. I hope there will be a solution in the future for problems like this.
(no subject) (by MGP)
You must reset the PWM frequency before changing the frequency otherwise or it will not work.
You also have a frequency limit how low you can go with a 20MHz crystal.
(no subject) (by Solt)
The frequency limit is 1,222KHz to 1MHz with 20MHz crystal,frequency limitation is given by LDmicro. i using V.5.4.0.4 of LDmicro.
I use single frequency program.
I tried with different resolution 10bit, 8bit.with 8bit resolution it is much worse.
(no subject) (by MGP)
Post the LD-file so we can see what is wrong.
(no subject) (by Solt)
Here is the file
(no subject) (by Solt)
The output mosfet is a irf9540, the driver is vn0106n3
I must try with opto. TLP250 or 350.
I try later, same LD-file with Atmega8
Maybe it will work ADC to PWM
(no subject) (by MGP)
This is not about the PWM freq. but duty-cycle!
I think it should work, I don't see any errors.
ADC, PWM and cycletime have nothing to do with each other and can work perfectly in any cycle time.
If you send the ADC value to the duty-cycle, the latter must be set to 10bit.
If the 16F88 resets, I think there is something wrong with the power supply or schematic.
por Solt) (by Paulino)
Hello, you have RESET (RES) that have to be Reset by pulse (high francs or low francs) not direct since if you have direct resets they will always be reset since the res sends over the Stay, if you do the test with a direct reset and give March you will see that the lines in the simulator seem to be working but if you look at the program pins you will see that they are 0 not 1 (in ladder programming this has to be taken into account.
Hola Tienes RESET (RES) que tienen que ser Reset por pulso (Franco altos o Francos Bajos)no directos ya que si tienes reset directos siempre estarán reseteados ya que el res manda sobre el Estar, si haces la prueba con un reset directo y das marcha veras que las lineas en el simulador parecen ser que funcione pero si se pone vista en las patillas del programa veras que están en 0 no en 1 ( en la programacion en escalera esto se tiene que tener en cuenta.
(no subject) (by MGP)
Btw. I have not looked at the program just the PWM problems and config words.
But as Paulino writes, you may also need to rethink your program.
(no subject) (by Solt)
Hi Paulino,
The program works correctly, including (RES). My problem is why PWM can't work at 32KHz. It cannot work with variable ADC, only if it is set to a frequency between 1.2KHz and 4.5KHz.
At 32KHz it can work if the ADC is 1024 bits.
(no subject) (by MGP)
I have tested your program in real with a 16F88 and it works fine.
I can select all the frequency's I want, from <1500Hz to >100kHz and the dutycycle from 0-1023.
Remember, the pullup resistors are ON !
(no subject) (by Solt)
Problem rezolved.......do not buy mosfet from China!
:) After three china mosfet, i ordered genuine mosfet, and everithing works great. Now i using at 48KHz.
Thank you MGP for your time.
(no subject) (by Paulino)
The Chinese are the sack man, I buy transistors and out of 100 they work 10%, these people work around the world. In the laboratories of the company Tecno Calubert S.L it is where the verification tests are made and the Chinese are over 70%, it does not work as expected.
LD micro ultrasonico (by gabriel )
como se configura en ld micro el sensor ultra sonico ya probe de varias formas pero no puedo encender mis salidas a las distancias que quiero
(no subject) (by Calubert)
Post a reply to this comment:
|