Processor

Status
Not open for further replies.

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
I use a Microchip PIC24FJ32GA004 on my latest mod. Working on a new one that will use a PIC24FJ16GA002. These are 16 bit µcontrollers.

I like Microchip's µcontrollers a lot and they have a wide 8, 16, & 32 bit product range. They're easy to program, easy to implement, they have great documentation, a free IDE, and inexpensive programmer/debuggers. Really well suited for a hobbyist or small scale developer.

The Amtel AVR µcontrollers are also well suited for smaller scale development. They have similar advantages as the Microchip stuff, but are only offered in an 8 bit or 32 bit product range.

The ARM stuff is typically used in more advanced, large scale products like cell phones and handheld computers. Everything about them involves big development costs. They're also more of a general processing machine as opposed to a microcontroller.

Microcontrollers have a lot of on-chip functions you typically don't find in a processor, like analog to digital conversion, PWM generators, and bit by bit register control, to name a few. Most appliances don't actually need that much computing power and a microcontroller is better suited for the task. Though, µcontrollers have been quickly advancing in the last couple decades and many of the 32 bit ones are just as capable on the processing front. Some of them can even run an embedded version of Linux.
 
Last edited:

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
How'd it go with that 1st PIC e-cig Craig? Did you end up using the PWM and making it pseudo-vv?

Like your avatar for the holiday there AttyPops.

With a dual batt setup, I imagine it would be quite elementary to program the PIC to drive a MOSFET for a strictly PWM output. Just about all the PICs have a nice flexible PWM module on-chip, but only the fastest ones would be able to drive a boost or buck circuit. It's better to use a dedicated controller for that. Most of the PICs are certainly fast enough to PWM an atomizer output.

The first PIC mod I did worked well right of the gate. These MCUs (µcontrollers) are pretty robust really. They rarely don't operate as expected unless you try to do something sketchy with them.

For my design, the MCU drives a digital pot (also Microchip) that adjusts booster output. I wanted to use a single batt to make on-board charging simple. A digital pot interfaced with a DC-DC controller was the easiest way I could see to do it.

It would be possible to use an MCU to handle the PWM for a boost circuit, but you need a very fast MCU and that leads to a whole different set of design issues. It would be a cheaper circuit with a lower component count, but coding it would be a real pain, feedback stabilization and all.

On the one I'm using now, I upgraded from the MAX1709 to the TPS43000 for a ~10% improvement in efficiency. I did in fact see a the expected improvement in run time. Though the MAX1709 is very easy to wire up and use so I highly recommend it for that. The TPS43000 needs a feedback compensation network which is a RPITA to design and tune, but the booster can put out 30W and it's highly efficient (peak 98%, minimum 92%, average 95%).

The new one I'm working on now will be essentially the same, but I'm going to try to shrink down the circuit board quite a bit for a smaller battery and smaller overall device size. The one I'm using now is pretty big (97x64x14mm) and has a very high capacity battery. Reducing the profile as much as I want is going to be a challenge.

The first thing I need to do is get rid of two big expensive tantalum polymer output caps. I'm going to attempt to replace them with much smaller ceramic caps. Boost needs a lot of output capacitance. It makes compensating the feedback loop sketchy because the ceramics don't have the controlled ESR characteristics of the tantalum polymers. Plus, I'm cutting the capacitance in half. I have no idea how much trouble it's going to give me, have to guess at the ESR (not specified or controlled) so I'm going to be winging it. But, I'm all for the challenge so I'm excited about it.
 

AttyPops

Vaping Master
ECF Veteran
Jul 8, 2010
8,708
135,304
Hc Svnt Dracones - USA EST
I'd trust your "winging it" more than most peoples facts, Mr. Spock.

Sounds like a real hoot. Average 95% efficiency with the TPS43000 wow.

Yeah, I was thinking dual batt PWM, obviously. Boost.... hehe... let's just say I'd leave that one to you. I'm not a boost fan anyway. By the time you mess with it, you could have just stuck in another battery and been done with it. For the pros, or those that really enjoy tinkering with it, fine. I've never been motivated enough to mess with it.
 

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
You're definitley taking it to the highest level with that MCU stuff. Some people are into it, some people just want to build something that works well without getting into it too heavily. I've been doing stuff with electronics since I was a kid so I was on it the first time I used an e-cig.

You definitely can do a lot without getting too deep into the electronics. That PWM circuit with the 555 that's been making the rounds is very simple and highly efficient, way more efficient than any buck or boost mod would be and it's super easy to build.
 

Sweeper

Full Member
Verified Member
May 4, 2011
32
1
41
Clarkston, WA
sounds complicated. I was planning on just PWM at whatever battery voltage is set to, but checking the resistance of the atty between pulses (well every 100 pulses or whatever) to regulate the width of the PWM pulses. That should let me maintain a constant temperature regardless of battery voltage or actual amps being pushed. Just two 3.7 batteries in series, and it'll provide enough voltage to keep things hot regardless :)
 

kwcharlie

Ultra Member
ECF Veteran
Apr 24, 2009
1,213
605
78
Houston
acrigs.com
you check the amps, tells you what the resistance is, you got the right idea to check the temp and that is a squared relationship to the amps. Have you googled PID Loops yet? I do that with the control i do, IT'S NOT EASY, but there are PIC stuff to do it. area under the curve stuff, the "easy" part is the only input is the heat/amps and dv/dt of the PWM output. Watts is the easy side of a PID Loop.
OK disclamer, it's only an idea I HAVE NEVER DONE with atty's.
You working in C?
 

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
It's real tricky getting a good pyhsical measurement of RMS voltage and/or current with PWM. That's one thing nice about boost and buck, easy to close the loop. I'd probably just keep it open loop and calibrate the code to measured data points. After that, I'd either calibrate each device individually or live with the error.
 

kwcharlie

Ultra Member
ECF Veteran
Apr 24, 2009
1,213
605
78
Houston
acrigs.com
YES, that's why no other commercial/HACKER MOD product uses a PID Loop, it's all about watts and maybe a dt of vape time. YOU ARE RIGHT, but the PID Loop has so much possibilities, when it's tuned "right". Keep reminded of the PLC stuff i do now being done, many years ago, by the operators (who tuned the integral and derivative with pots by hand) and kept their pot settings in a black book and reset it back after their shift was over. The productivity of the process while they were on duty proved their "knowledge" of PID Loops. Now we do it with PLC/PIC's but the tuning possibilities are still there IMHO.
and YES again the timing and accuracy (over VERY small time slices, area under the curve again) are the limiting factors.
 
Last edited:

CapeCAD

Senior Member
ECF Veteran
Verified Member
Jun 2, 2010
232
25
Massachusetts
YES, that's why no other commercial/HACKER MOD product uses a PID Loop, it's all about watts and maybe a dt of vape time. YOU ARE RIGHT, but the PID Loop has so much possibilities, when it's tuned "right". Keep reminded of the PLC stuff i do now being done, many years ago, by the operators (who tuned the integral and derivative with pots by hand) and kept their pot settings in a black book and reset it back after their shift was over. The productivity of the process while they were on duty proved their "knowledge" of PID Loops. Now we do it with PLC/PIC's but the tuning possibilities are still there IMHO.
and YES again the timing and accuracy (over VERY small time slices, area under the curve again) are the limiting factors.

PID is used in the CNC world, see SuperPID.
 

kwcharlie

Ultra Member
ECF Veteran
Apr 24, 2009
1,213
605
78
Houston
acrigs.com
YES, I think that's done with a encoder off the spindle, same idea, for a PWM PLC Control it would be done from amps, just software, IT'S ALWASE just software now isn't it. everything has a hardware solution or a software one. We've been working with all the hardware ones: atty's E2's CE2's G4, DC's Fusions, it goes on and on.
 

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
YES again the timing and accuracy (over VERY small time slices, area under the curve again) are the limiting factors.

It's always a trade-off. Simplicity of design versus accuracy and stability. For example, I believe the Pro-Vari uses a closed loop control scheme which allows them to boast very high accuracy. My personal feeling is that it's not something really necessary in powering an atomizer. With the normally tight tolerances of modern components, once control is calibrated, you're not going to see all that much deviation from device to device. In my own experience, I can't tell the difference in peformance with less than two tenths voltage deviation. You might get a half tenth in variation due to component tolerances. For this application, I just don't see the payoff in complicating the design with a closed loop system. However, I think this is a legitimate point of debate and a designer could be justified in going either way.
 

kwcharlie

Ultra Member
ECF Veteran
Apr 24, 2009
1,213
605
78
Houston
acrigs.com
but if you did it very fast, with a large TC integral to dt as the amps changed "just a little" .............well it's just an idea that i have never tried, you are writing the code and YES YOU ARE RIGHT, it's a very untested trade off. Just look into embedded PID Loops in your code as you experiment, as a "not doer" I'll stop now, just check out PID coding for your PIC's, start with just using them to just hold the WATTS then tighten the time slices of the derivative and narrowing the Constant [TC] of the integral.
 

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
I'm not particularly experienced in coding control loops. I've done a few analog ones and muttled through a few digital ones, but you're talking about more advanced digital control which I haven't thought about since college (long enough to forget). I can't say myself how easy or hard it is to properly code that stuff. I've always just used simple timers and delays to emulate integrals in code, it's sort of an ugly hack, but does the job well enough. It's all I've ever needed to do. I'm sure I could get away with coding a closed loop system for a mod the same way. Though, I haven't done one yet and don't plan to. All the mods I've done so far have been open loop. Though, the DC-DC converter I'm using is closed loop, like all DC-DC converters, but that's analog and it's not the primary control system.
 
Status
Not open for further replies.

Users who are viewing this thread