Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:46 10 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PWM - not sure...

     Page 2 of 2    
Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7504
Posted: 02:09pm 01 Apr 2025
Copy link to clipboard 
Print this post

Because I only very vaguely understand them?  :)
It takes me all my time figuring out some of the more exotic MMBasic commands, never mind PIO stuff. :)  I much prefer hardware, where I'm more comfortable.

I'm not sure that there'd be a lot to gain. There is still a limit caused by the ADC read commands for voltage and current and the time taken to process them. I'm already generating the output waveform using a PWM module that probably gets its mark/space tweaked once per program scan time if a tweak needed.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 02:14pm 01 Apr 2025
Copy link to clipboard 
Print this post

PIO doesn't support reading from ADC or any other bus device except GPIO nor does it have a jmp instruction that allows > or < comparisons. The instruction set is very limited.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2417
Posted: 09:00pm 01 Apr 2025
Copy link to clipboard 
Print this post

  Volhout said  @Phil,.....So the PM is now a quite expensive comparator (1/4 of a LM339 costing $0.08)
Yes I see, so that could be the solution.
The comparator generates the drive for the output while the Pico PWM + filter provides the reference voltage for the comparator (to the + input with a little AC feedback from the comparator output to ensure it oscillates, the - input connected to a voltage divider from the output terminals).
Update time less important then.

The Pico ADC can be used to provide metering and fine tune the PWM if needed.
.
Edited 2025-04-02 07:04 by phil99
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7504
Posted: 06:45am 02 Apr 2025
Copy link to clipboard 
Print this post

I partially designed a system like that some time ago - there is a circuit and drawings on here somewhere. I didn't take it further because it was already starting to look more expensive than I hoped and would still need a lot of loop tweaking to get it stable. That's a problem with this sort of supply as there's a pretty high loop gain.

My current idea deliberately takes op-amps and comparators out of the equation and the response time of the PicoMite will give automatic slugging of the loop. Additionally the power device is always hard on or hard off (the best way to use most mosfets), reducing power dissipation - like a Class D amplifier. Filtering the feedback loop should also help with stability. I expect to have some switching noise present on the output. The output capacitor is part of the control loop and its value can't be increased too much as the loop will get sluggish leading to worse load response times This probably makes this sort of supply unsuitable for high currents.
Edited 2025-04-02 16:55 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025