I have a number of “PWM” controllers, all based on Micomites/Picomites + a power driver
A Picomite is very easily set-up by just dragging the UF2 firmware into the Pico (no programmer required). For smaller programmes the inbuilt editor is quite useable but I tend to use MMEdit these days as I don’t then need TeraTerm and I can just download/edit at the click of a button.
As I’ve stated here before, with most modern micros, ‘speed’ isn’t a really problem. Picos will run at 380Mhz – although I’m running my latest Picos (2’s with HDMI) at 315Mhz. If you are not designing for commercial use (e.g in small numbers) then the cost of hardware isn’t going to be an issue for most people. Getting it work (time consumed) might be though.
I purchased some Pico 2s recently and they cost £5.70 each (with header pins – they are £4.80 without). The original Pico (1) is still under £4. If form factor/size is an issue then a Waveshare RP2040 Zero can run the PM firmware too.
https://www.waveshare.com/rp2040-zero.htm
I’ve recommended Picomites here before because they are both cost effective and very easy to use (and very quick to debug). I am not a professional programmer and nor (I suspect) are most others here. The Picomite is now an extremely powerful platform that can be deployed in a number of modes. I use them as both embedded controllers and as standalone systems (using LCD, VGA & now HDMI displays). The Pico 2/HDMIs can display a 1024×768 image in monochrome, with various other display modes including 256×192 in 256 colours with colour mapping to an RGB332 palette! What I would have given for one of these 40 years! 🙂
As an aside – I’m in the process of building two of these as ‘Boot-to-Basic’ systems (for two of my Grandkids) using Waveshare 10″ HDMI displays. I think they will cost about £50 each when finished (inc keyboard/SD card etc) – the 10″ dispay being about half the cost. I will admit to making the mistake of offering to build a system for my Grandson within hearing distance of his sister (who immediately stated that she would like one too!) Fortunately they won’t break Granddad’s piggy bank.
https://www.waveshare.com/pico-dvi.htm
PLEASE NOTE: You need an adaptor to run a Pico2 with these older Waveshare dispays, as they were originally designed for the Pico 1 (the Pico 2 now has special display hardware inbuilt). This one was designed by a friend and makes the required pin changes and adds 32Gb storage, keyboard (VGA or USB) RTC etc. I ordered ten of them, which cost me under £13 (inc delivery) – quite remarkable value at just over a £1 a PCB.

I digress.
You can very simply control PWM based motor drivers using a using a Picomite. Here is the full PWM ‘Command’ line.
PWM channel, frequency, [dutyA] [,dutyB][,phase][,defer]
How you choose to ramp up/down the duty cycle etc is up to you – a simple loop will do it. Once running, a PMW channel doesn’t need any other processor attention btw – until you want to stop it or change something…it just runs
“There are 8 separate PWM frequencies available (channels 0 to 7) and up to 16 outputs with individually controlled duty cycle. You can output on either PWMnA or PWMnB or both for each channel – no restriction. Duty cycles are
specified as a percentage and you can use a negative value to invert the output (-100.0 <= duty <=100.0)
Minimum frequency = (cpuspeed + 1) / (2^24) Hz. Maximum speed is OPTION CPUSPEED/4. At very fast speeds the duty cycles will be increasingly limited. Phase is a parameter that causes the waveforms to be centred such that a wave form with a shorter duty cycle starts and ends equal times from a longer one. Use 1 to enable this mode and 0 (or omit) to run as normal “
Regards,
Iant