gfxgfx
 
Please login or register.

Login with username, password and session length
logo
 
gfx gfx
gfx
19852 Posts in 1275 Topics by 5182 Members - Latest Member: charbuild March 28, 2024, 05:48:14 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: You asked mamu it's coming.
gfx
gfxgfx
 

Author Topic: You asked mamu it's coming.  (Read 151201 times)

0 Members and 5 Guests are viewing this topic.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #50 on: July 22, 2014, 09:13:30 PM »
Maybe someone else who knows more about electronics/arduino's can answer my questions, so I'll just ask.

What is the purpose of the 100 ohm POT connected to the N-FET and A0 on the Arduino?  If it is required, would any 100 ohm pot be suitable? The purpose was to allow a variable resistance to calibrate the Ohm measurement circuit. Following the original wiring diagram, I have found that it is not totally necessary as the values can be adjusted via code. You do need a refference load to calibrate it with.

The part of the circuit diagram with the 1.3k res + 1.5k pot on Rtrim of the OKL seems off, would it be ok to use a 1k or 1.5k ohm pot as specified in the arduino-less implementations of the OKL2? The values were chosen to provide I wider range of voltage control they are not "off" they are simply not exactly what was used in that build. These values if I remember right should go from 2.5-6 volts rather than 3-5.5 like the other build.

The zener diode and 1A fuse in the circuit diagram are not needed, correct? Correct, not needed at all and totally redundant.

In order to use the arduino with Vout on the OKL2 of >5v, I would have to implement a basic resistor based voltage divider (2x 1k ohm resistors) and modify the code to adjust accordingly, correct? Yes, that is correct. It is the same way I did the battery voltage measurement. You can duplicate that voltage divider on the atty voltage input. The code is already setup for the divider, the wiring diagram just doesn't reflect it.

Are there any other issues with the circuit diagram? Probably. I need to go through it again :P Take it as a starting point but not a 100% one. I am learning as I go too!


I am very comfortable writing the code for the arduino but I want to make sure the physical circuit is sound. If you read through the second post, you will see what aspects of the circuit are working 100% (most of it).

Also, does anyone know how the setup in this thread actually works, meaning, does the main pot connected to the OKL2 still just adjust voltage and the arduino does nothing more than provide a fancy display of various parameters or is there a way to make it function more like a DNA/Gi2/VariAnt whereby you are adjusting the wattage from A-B and the arduino takes care of the voltage adjustment.  I assume this would require the use of a digital pot or something but I'm not sure. The way it works is the 1st way you describe, adjustment is done via the pot. I hate buttons and find that it is way more efficient to just grab a knob and turn than press a button like 100 times to go from low to high power.

As craigHB mentioned, this design in totally separate from the converter/regulator chosen, so can work with any of them, or multiple in parallel if you really feel the need to push .1ohm builds at 6 volts lol. I have since found some significantly miniaturized components for the project and am almost at the point where it is not worth integrating them onto one board as far as size is concerned. At this point I think the main reason to combine it into a single board would be simplicity and cost.
« Last Edit: July 22, 2014, 10:02:22 PM by Claviger »

Offline werkkrew

  • Full Member
  • ***
  • Joined: Sep 2013
  • Posts: 25
  • Karma: +2/-0
Re: You asked mamu it's coming.
« Reply #51 on: July 23, 2014, 12:26:59 PM »
Thanks for the response Claviger.

I realize you are working on having it totally integrated as a drop-in module, which is awesome!  However, I already have an Arduino Pro Micro and an OLED display I could use.  If it wouldn't be too much trouble could you help me out with a finalized/working circuit I could use with your code in conjunction with either an OKL2-T/20 or a NSR020A0X43Z (Naos Raptor 20A), preferably the raptor.  I would love to build one of my own just as you have.

I have the Arduino, the display, an OKL2 and a Naos Raptor sitting at my house just waiting for this project.  I wish I was smart enough to figure it all out on my own but I'd be a lot more comfortably learning from your mistakes and following a finalized diagram provided by you.

Thanks so much for your time!

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #52 on: July 25, 2014, 04:47:08 AM »
I'll work up a revised diagram this weekend. PCs been down getting a thorough cleaning, 1.5 years without a water change or dust removal is a bit too long lol. 

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #53 on: August 02, 2014, 12:14:20 AM »
I can't believe I stumbled onto this thread. I have been searching far and wide for something like this. Recently saw some similar projects on reddit but unfortunately they are not nearly as generous as you. No one shared their code base or anything close to that. I am so thankful that you are willing to share diagrams/code/etc. I can't wait to read up on this some more and start tinkering. Excellent work so far!! Too cool!!

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #54 on: August 04, 2014, 10:19:57 AM »
Beginning to look at how to put one of the 20A Raptors into this schematic. This is by no means anywhere near complete/correct. I just scabbed the raptor board into your layout minus a few parts. I referenced Mamu's diagram and a few others just to get a rough idea. Currently trying to determine how to work a digital pot into the schema.



I found this schematic for a digital pot.



Claviger, I know you aren't big on using push buttons for the wattage adjustment, but I think it is something that I'd like to work into the scheme just to see if I can get it to work. Need to research how to incorporate that through the Pro Micro though, that way the up/down can be used for other adjustments and such.

Anyway, hope you don't mind me jumping in on this. Not trying to beat anyone to it, I just love this idea.
« Last Edit: August 08, 2014, 02:03:33 AM by karadorde »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #55 on: August 04, 2014, 07:03:52 PM »
It's hard to find digital pots with an up/down interface like that.  When they do have an up/down interface, it's typically multiplexed with a serial bus so there isn't a discrete up and down input.  What they have is an up/down input and a direction input.  Not a big deal but it takes some extra components and different wiring to facilitate use of buttons that way.

Another issue is that converter module requires a 200 Ohm pot.  Digital pots are not available with a 200 Ohm range.  I think the closest you can get is 1k or maybe 500 Ohms, which is fine if the pot has enough taps. 

Normally you would just control the digital pot with one of the MCU's serial buses.  The only reason not to would be if you adamantly want to avoid any additional coding or wiring changes to the original design.

Running the digital pot off a serial bus is going to be a lot easier than trying to multiplex tactile inputs with a pot and an MCU separately.  That's still going to require code changes, and hardware changes too.  Why not just add code to control the POT serially which will avoid any hardware nonsense.

Offline Visus

  • PV Master
  • *******
  • Joined: Oct 2013
  • Location: Nexxus
  • Posts: 929
  • Karma: +62/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #56 on: August 04, 2014, 07:55:29 PM »
You could toss in a micro mini servo that rotates an analog pot.  I at first wanted a digi pot but no luck finding any.   
I have even stopped mounting exterior dialing pots on my mods.
They have some that are uber tiny too, smaller than a dime, hella accurate too. Ya stop it, it stops.
That would be kinda cool put a 12-24 turn on it and hear the servo  spin them up  awesome..lol

Now thinking I might do this in future lol..  :thumbsup:

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #57 on: August 04, 2014, 07:59:38 PM »
Craig, I see what you are saying. Looking at it now, that digipot schematic doesn't make much sense for this application. Even if I had that pot with the correct ratings, why wire it up like that and use the buttons only to adjust the pot.

Personally, I have no problems adding additional wiring/hardware and code. I know it strays from Clav's original design, but adding a digipot/buttons does that already.  Now it is just a matter of finding the right potentiometer and figuring out how to wire it in properly. I do believe another use with the same type project is using this: http://parts.arrow.com/item/detail/analog-devices/ad8403arz1#gnyF I am just not sure how he has it wired. Other forums aren't quite as generous as the crowd here.

Visus, that's an idea. Sounds like something out of a Rube Goldberg box mod, ha! Not something I'd want to venture in to but I'd be anxious to see what you come up with.

Offline werkkrew

  • Full Member
  • ***
  • Joined: Sep 2013
  • Posts: 25
  • Karma: +2/-0
Re: You asked mamu it's coming.
« Reply #58 on: August 05, 2014, 09:25:54 AM »
I'd like a digital pot which can be adjusted using a knob with 360 degrees of rotation (not an analog pot).  I know DNA boards support either buttons or knobs, I am also partial to knobs.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #59 on: August 05, 2014, 04:41:39 PM »
Problem with mechanical pots is they wear out and get jumpy.  A rotary encoder would be the best option there.  I have a DC power supply that uses a rotary encoder to set output voltage.  I really love that dial control and it will never wear out.

I've had to dispose of DC power supplies before because the pots in them wear out and get too jumpy to use anymore.  I've tried to clean them at times, but it's only a short-term fix.  Doesn't take long for the pots to get jumpy again.  In any case, those cheap DC power supplies with the mechanical pots are something to avoid.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #60 on: August 06, 2014, 11:10:07 AM »
I think the closest you can get is 1k or maybe 500 Ohms, which is fine if the pot has enough taps. 

Craig, can you elaborate on that a bit? Please and thank you.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #61 on: August 06, 2014, 05:21:13 PM »
Ah, I see what you're saying now. I did the math for each step on a 1k ohm - 256 step digipot and once you get past 60 watts, it starts to get jumpy. I couldn't find much in the way of higher step count or lower ohm rating. Hmm...




I did find this which talks about wiring several digipots together in parallel to achieve a desired output that is not available with a single pot. I need to do some more research on this before I can fully understand how it is done unless someone can provide some insight.

Edit:
Additionally, after speaking with someone, adding a 1k resistor in parallel with the pot's wiper and ground gives us a much better solution. We can get much closer to the values we want using that. It isn't perfect but it is pretty darn close.
« Last Edit: August 06, 2014, 06:55:11 PM by karadorde »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #62 on: August 06, 2014, 07:10:39 PM »
Sounds like you have a handle on it, yeah, more taps means less difference in resistance as the you increment or decrement the resistance value.  In other words you get better resolution. 

Resolution also depends on the overall value of the pot.  For example, a 50k pot with 1024 taps has about 50 Ohms per step.  A 10k Pot with 256 taps has about 40 Ohms per step.  In this case resolution is similar, but range is greater for the 50k pot.

One trick to get high resolution over a wide range is to run series digital pots.  For example, with a 1k pot that has 256 taps, you have about 4 Ohms per step.  If you put that in series with a 50k, 64 tap pot, you have a resolution of 4 ohms per step over a range of 50k.  That's like a 50k pot with 12k taps.  However, you can't do that with a low overall range in value since digital pots are only available in a small selection of range.  To some extent, the range of the first pot has to fit inside one step of the second pot.

Trying to run parallel digital pots results in non-linearity issues.  You cut range half and you only improve resolution in the middle of the range.  You're going to lose resolution at either end of the range.  Plus it's going to be a big headache to code output levels based on two tables with a parallel relationship.  I would avoid doing that myself.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #63 on: August 06, 2014, 11:51:18 PM »
Sounds like you have a handle on it, yeah, more taps means less difference in resistance as the you increment or decrement the resistance value.  In other words you get better resolution. 

 :thumbsup:

Well, that small victory feels really good, haha.

So that solves that problem, for the most part.

I wasn't sure how I would go about the paralleling of digipots. I just know another modder managed to parallel a quad pot and make it work. I was just afraid that was the only way to do it. I am glad I was able to learn something and heed your advice and figure this out. Many thanks for the direction and education, Craig!!

So, all things considered, using Clav's diagram and dropping in that digipot with the right connections to the Arduino, I don't think I am too far off from at least a V1 of his design but with the Raptor. Woohoo!

Speaking of Claviger. I know he was tearing down his PC for a little late spring cleaning. Hopefully he got it back together alright. Could really use his input on this, considering I am bastardizing his work, ha.
« Last Edit: August 08, 2014, 02:04:00 AM by karadorde »

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #64 on: August 08, 2014, 10:44:13 AM »
Hmm, coming up short due to my lack of knowledge in regard to the Arduino/ATMEGA32U4. I have seen a couple of ways to wire digipots, just not sure which is the best. One way would go through the SCLK, MISO, MOSI pins, but those are taken by the OLED. I could grab an I2C OLED screen and wire it through the I2C pins (SDA/SCL)but the SDA is taken by the PFET and fire switch. I need to figure out what the limitations of the board are I guess. If I can possibly reprogram/repurpose certain pins or some other method. Or find out if there is a specific reason Clav is using that SDA pin in the PFET scheme.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #65 on: August 08, 2014, 06:07:18 PM »
There's two main serial bus types used to interface an MCU with a peripheral IC.  I2C and SPI are the ones commonly provided as an interface on general purpose ICs.

I2C is better suited for running mulitple devices on a single bus.  SPI is better for one or two devices on a bus.  SPI is slower and requires more pins for two way comms.  However, SPI is more robust since it uses low impedance lines and lower frequencies.  In other words it's more immune to noise and connection quality.

SPI only requires a clock and data line for one way comms so overhead is pretty much the same in that case.  Two way comms are typically not required for a display or digital pot in our application.

You can use either bus type so it really comes down to which is more convenient for your particular design.  The parts you will want to interface with your MCU generally don't support both bus types so that usually makes the decision for you.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #66 on: August 12, 2014, 04:19:29 PM »
Craig, you spoke about non linearity issues and some other stuff when using pots in parallel. I kept researching and found out what you meant. If you take four 1000 ohm 8 bit digital potentiometers and wire them in parallel, it gives you 4,294,967,296 different combinations of steps. So I decided to do the math for that.

Taking a 1000 ohm 8 bit quad digital potentiometer, wired in parallel, and used in a rheostat configuration. I figured out every unique possibility of resistance based on the step each pot was on along with some other things like wiper resistance. I know there are other things to think about like variations in wiper resistance or accuracy of the potentiometer itself, but with the bare calculations, I've come up with a fairly accurate way of finding just the right steps to assign each of the four pots in order to achieve a certain voltage/wattage.

My database is still building as we speak (go figure! evidently it takes time to do four trillion calculations) but it is returning results already. Right now I have http://goatweb1.tinyw.in/test.php returning values for a certain wattage range on a .30 ohm coil. I have to do some testing and more math before I can put this into practice, but I think I might be on the right track. If not, it was a fun little project.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #67 on: August 12, 2014, 04:59:19 PM »
That sounds like some rather complicated math.  I wouldn't do it myself, but that's interesting you did the formulation.  A good routine can make it usable I suppose.  But yes you end up with 32 bits you have to deal with which is a lot.  You can run into issues with sluggish response if using a closed loop system to regulate voltage.  I'm running into that possibility with 10 bits (1k steps), let alone 32 bits (4G steps).

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #68 on: August 12, 2014, 05:05:38 PM »
The calculations alone are ridiculous. But, once I run these, I have them and never have to run it again unless it is for a different size pot. My best guess, depending on the storage I'll have onboard the MCU, is to generate all the info beforehand for each resistance of an atomizer (I am thinking .30 to 1.5 ohms. I could always expand that later). So I'd have an array of steps for all possible wattages for all possible coils. That way I could check my atomizer resistance, and then just grab the corresponding array for said resistance.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #69 on: August 12, 2014, 07:11:11 PM »
Hopefully you have a routine already in mind for that.  I imagine the formula is looks rather ugly with 4 resistors in parallel.  Don't know if you could use a table with that, not enough program memory available with a typical MCU.  How would you even program a 4 dimensional table anyway, I don't have a clue.  Well I guess someone did it already so it's possible, goes beyond my programming ability though.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #70 on: August 13, 2014, 05:23:06 PM »
Depending on how I could set up the data structures, it might not be too ugly. The hardest part would be culling out the data for each setting available to the user. I'd have to do more research that will come a little later in the game.

I may also simplify it and find the correct keys for stepping up an ohm of resistance at a time. And just use that as my range for what to fire the atomizer at. That gives me 250 steps of adjustment. Something like this: http://thirdshift.co/oneOhmIncrements.php It would be a lot easier to use that rather than an individual dataset for every possible resistance in a given range.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #71 on: August 18, 2014, 11:50:58 PM »
And so it begins.



I think I've got just about everything worked out (for the most part.) Digikey, Adafruit, and amazon orders should all be here by Thursday. I hope to have everything bread boarded by this weekend. After that I will report back with pics, schematics, and some code. Hopefully. ^_^

Offline slaw_dawg

  • Jr. Member
  • **
  • Joined: Aug 2014
  • Location: USA
  • Posts: 2
  • Karma: +0/-0
Re: You asked mamu it's coming.
« Reply #72 on: August 19, 2014, 09:33:00 AM »
I joined this board and am closely following the progress in this thread. I really hope to make a 120W raptor box mod with all the features of a DNA 30 chip. Thank you everybody involved for your work!
I am an automation engineer, so I may be able to contribute some to this work once I get all the parts in the mail and start tinkering around!

 ;cheers;

Edit to correct spelling

Offline hanukun

  • Jr. Member
  • **
  • Joined: Aug 2014
  • Location: 49428
  • Posts: 5
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #73 on: August 23, 2014, 06:17:00 AM »
what about adding a color screen to add a custom picture on load up or would it be to much recoding in arduino http://www.adafruit.com/products/684

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #74 on: August 23, 2014, 06:46:00 PM »
Probably not too much.  Though display drivers are not generic, you have to write code for each type of display based on its controller anyway.  It probably would not be too much additional coding for a color display over a monochrome one.  You just have some added bits for color definition.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #75 on: August 23, 2014, 06:47:42 PM »
The Arduino libraries are actually really well developed and easy to use. I don't see it being too difficult to get a color screen running, I have seen them on projects like this elsewhere. I, myself, don't see the point. I am using a 128X32 monochrome OLED for my project (got it wired today) and I think it works really well.

EDIT: Also have the AD8400 (just going with one pot for now) and the current sensor wired up. Between hand soldering SOIC 8 boards and building that box mod today, my nerves/hands are fried. Time for some light datasheet/code reading before bed. Going to try to get it all up and running tomorrow.
« Last Edit: August 23, 2014, 11:13:26 PM by karadorde »

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #76 on: August 25, 2014, 11:53:18 AM »
Just a quick update. I got most everything breadboarded over the weekend along with redoing the Raptor bread board connections (yeesh that was hideous.) Right now I have it up and running with the very basic bare bones.

I am rewriting everything rather than using Claviger's code, mainly because I don't know enough about the ClickButton library and because the OKR board uses negative logic whereas the Raptor uses positive.

I am also using an I2C display so that I can free up the SPI pins on the board to use with a digital potentiometer.

Next steps are going to be building a couple of voltage divider circuits so I can measure battery voltage and output voltage of the board. Claviger was using the raw input pin on the Pro Micro to measure voltages. This is a great way to check unregulated voltage but it won't be a viable option in the long run when I go to make a custom PCB.

After that it will be connecting the current sensor and digital potentiometer and the corresponding code for each of those.

Here's hoping I can pick up where Clav left off.

Online geothee

  • Full Member
  • ***
  • Joined: Mar 2010
  • Posts: 35
  • Karma: +2/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #77 on: August 25, 2014, 12:04:53 PM »
Sounds interesting. Will be watching  :popcorn:

Offline slaw_dawg

  • Jr. Member
  • **
  • Joined: Aug 2014
  • Location: USA
  • Posts: 2
  • Karma: +0/-0
Re: You asked mamu it's coming.
« Reply #78 on: August 25, 2014, 01:16:13 PM »
Karadorde,

I am very anxiously awaiting your notes and progress. Thank you for your work on this. Your rockin bro :rockin smiley:

I have my 20A raptor board and box, just waiting on some notes and code so I can make myself 20a raptor box mod like no other!

If theres anything I can do to add to this or help please let me know.

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #79 on: August 25, 2014, 03:55:42 PM »
Karadorde,

I am very anxiously awaiting your notes and progress. Thank you for your work on this. Your rockin bro :rockin smiley:

I have my 20A raptor board and box, just waiting on some notes and code so I can make myself 20a raptor box mod like no other!

If theres anything I can do to add to this or help please let me know.

Good to hear!! And thanks!! Once I have a little bit more done, I will put out a schematic and some code. Hopefully by this weekend I will have a lot of the features up and running. The work that Clav has done is making this a whole lot easier for me on the Raptor end.


On another note, is there any reliable way to calculate proper resistor values for use in a resistive voltage divider circuit? I've found the math needed to get values that will provide a safe output voltage to the Arduino based on a max input voltage from the board/battery bank, but I want to get values for my resistors that offer the greatest range in order to measure my voltages more accurately. Short of testing the math on rather arbitrary values for resistors, I am coming up short. Any help would be appreciated.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #80 on: August 25, 2014, 04:38:44 PM »
You have the range of the atomizer value then the other value that follows from the math.  The constraint is the power consumption of the circuit.  If you use a lower value you'll get higher currents and more power consumption, but better resolution.  If you use a higher value you'll get less power consumption, but less resolution.  Like most things with electronics design, you have to arrive at a reasonable trade-off for either.

One of the tricky things with measuring something using a divider is the small voltage levels you have to measure.  There's a couple ways to handle that.  You can use a low voltage reference with your ADC, but then you can run into the limitations of your MCU.  Or, you can linearly amplify the voltage level to allow the use or a higher ADC reference, possibly even the MCU's supply voltage if you use an LDO (low drop-out linear regulator) with high accuracy.

In any case, whether you use a lower voltage reference or amplify the signal, there are noise considerations.  When you amplify a signal, you also amplify the noise.   It's better to use lower gain or a higher reference, but then you can have issues with power consumption.  You will need some kind of filter on the ADC input to the MCU however you do things.  Not a big deal, just a cap and resistor.

I don't think anyone can say, "use such and such a value whatever the case."  It depends on how you want to do things, the range of resistance you want to cover, and how much power consumption you're willing to accept.


« Last Edit: August 25, 2014, 04:44:02 PM by CraigHB »

Offline jimmothy86

  • Newbie
  • *
  • Joined: Aug 2014
  • Location: United States
  • Posts: 1
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #81 on: August 29, 2014, 01:01:06 PM »
Trying to put together a raptor build based on mamu's diagram, still need two things, preferably from digikey, I need the reverse polarity led and the voltmeter any recommendations?

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #82 on: August 29, 2014, 01:05:06 PM »
Trying to put together a raptor build based on mamu's diagram, still need two things, preferably from digikey, I need the reverse polarity led and the voltmeter any recommendations?

I don't think you'll find the volt meter on digikey and the LED doesn't have to be any special kind.

Offline bob salter

  • Jr. Member
  • **
  • Joined: Aug 2013
  • Location: UK
  • Posts: 12
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #83 on: September 01, 2014, 06:52:48 AM »
Any recommendations for the fet? I just placed an order with mouser and dont want to get hit with massive postage for a couple of fets. How about bf245c and 2n3820 on ebay uk. Cheap as chips and free postage.

Bob

Offline bob salter

  • Jr. Member
  • **
  • Joined: Aug 2013
  • Location: UK
  • Posts: 12
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #84 on: September 04, 2014, 01:21:20 PM »

@karadorde  Did you get any further with this? Can I use the same code for the raptor as the okl? If not I have some okl2 20s but they are positive logic. Would that involve a change in code? Just waiting for the screen, I found some fets on ebay so would be good to start this at the weekend.

Bob

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #85 on: September 04, 2014, 01:26:51 PM »
The code that Claviger provided is written for a board with negative logic. The Raptor is a positive logic device so the code doesn't have to be completely rewritten, but it has to be changed as well as some of the wiring. It is not terribly difficult. I will work on getting some info up so. I stopped active development on this for a bit and have been doing A LOT of research on somethings. I changed a lot of my initial plans around to make everything as efficient and accurate as possible.

Offline bob salter

  • Jr. Member
  • **
  • Joined: Aug 2013
  • Location: UK
  • Posts: 12
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #86 on: September 04, 2014, 03:14:59 PM »
I assume then I need to invert all digitalwrite(powerconvertor )  code for positive logic? I think this is going to be GREAT fun. I THINK I follow all the code OK otherwise but will report back once its running.

Bob

Offline ShadowBlade

  • Jr. Member
  • **
  • Joined: Sep 2014
  • Location: Florida
  • Posts: 2
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #87 on: September 13, 2014, 01:23:27 PM »
Hey everyone, new guy here. I found a 100 ohm Digital Pot; can we use this? I know its not 200 ohm, but its a lot better than 1kohm or 500ohm.

http://www.mouser.com/ProductDetail/Intersil/X9C103SIZ/?qs=dAsayXGOMrtxfD7JtBRmDA%3d%3d

data sheet: http://www.mouser.com/ds/2/465/fn8222-86825.pdf

I want to use an arduino to control my raptor chips; i like the re-done schematic (claviger's with the raptor instead) anyone tested the code (from page 1) with this?

Any luck on turning this all into one PCB with oled and everything (like a vape shield?)

thanks!

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #88 on: September 13, 2014, 01:36:49 PM »
That's a 10k ohm potentiometer with 99 resistive elements. The description is kind of wonky but the data sheet clarifies it: X9C103 = 10k. They offer a 1k version, but it is a poorer choice than something like the 1k AD8400 which offers 256 resistive elements since it is an 8 bit digipot.


Don't pay attention to the raptor schematic. It is very basic and it won't work with claviger's code. I need to pull it down and upload an accurate one.
« Last Edit: September 13, 2014, 01:48:08 PM by karadorde »

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #89 on: September 16, 2014, 05:00:07 PM »
This is kind of where I am at right now.

Some important things to note about this schematic:
  • It is not complete. There are certainly things that I am missing
  • There is no reverse polarity protection.
  • It is not fused
  • Again, It is not finished yet. But it is a start.

Other things to point out:
- The AD8403 is the digital potentiometer.
- The TPS63060 is the power supply for everything (minus the raptor obviously).
- The INA225 is the current sensor.
- There are no values for the resistors in the voltage dividers. I haven't sat down to do the math yet.
- The LM4040 is an external voltage reference, because I don't like using the internal reference on the Arduino.
- It is currently laid out for an Arduino Micro board. Later I will revise it to be wired straight to an ATMEGA32U4 or perhaps a different mcu.

I am waiting on PCBs from Oshpark right now. After that I will revise and post my code. At that time I should have the programming done for reading the raptor output voltage, the overall battery voltage, each cell's voltage, as well as the amperage output and the coil resistance.

« Last Edit: September 17, 2014, 11:27:17 AM by karadorde »

Offline miskol

  • Super Member
  • *****
  • Joined: Mar 2014
  • Location: Malaysia
  • Posts: 106
  • Karma: +9/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #90 on: September 25, 2014, 08:33:15 AM »
building electronics and OLED especially, is very very fortunate for Arduino users... there' a lot of OLED library that can be used just like that... i have been working for weeks now to port AVR / Arduino libraries for use with PIC and unfortunately its not going very well haha...

unfortunately also there's this one guy who shared his OLED library for use with 128x64 I2C OLED... i'm using 128x32 SPI OLED and i edited some parts of his library, it is not working well but it is from his work that i got to display text on the OLED for the first time hehe.

still hoping some other forumers to reply on different other forums regarding OLED library for PIC.

Offline ShadowBlade

  • Jr. Member
  • **
  • Joined: Sep 2014
  • Location: Florida
  • Posts: 2
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #91 on: September 25, 2014, 02:09:07 PM »
wow karadorde thats a lot of work! Thanks for sharing. Looking forward to your finished version!

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #92 on: September 25, 2014, 02:11:20 PM »
PCBs to test the Current Sensor and the External Voltage Reference arrive today. I screwed up and didn't order a SMD resistor for the VREF board so I have to wait for Digikey to send me some goodies. Hopefully I can have some code up by next week :-).

Offline norcalreballer

  • Sr. Member
  • ****
  • Joined: Jul 2014
  • Location: USA
  • Posts: 63
  • Karma: +4/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #93 on: September 29, 2014, 06:46:22 PM »
Hi, I just joined up.  Designing my on MCU mod using teensy 3.1.  I'm also using an lm4040(2.5v though). Teensy 3.1 has a 470ohm resistor from aref to agrnd, so I soldered the little sot23 right to the bottom of the board on the aref pin to agrnd.  I'm learning as well..  Works perfect, right now, though. Anyways, I see people are using current sensors and I'm not sure about Claviger's way of reading resistance.  I'm using an lt3092 constant current source set at 10ma and going to use analogReadDifferential to read the voltage across the atty.  This way we can read resistance before firing and hopefully within 1% accuracy after calibration. 

I haven't seen anyone talk about it on here(new here), but there are around 20a regulators with 5.5v or so max output that can be controlled via i2c/PMBUS.  Someone linked me to one a week or so ago.  I still think pulsing a mosfet may be better, as your only limits are the limits on your batteries. :)  I'll be following this post and posting up when I have more progress.

« Last Edit: September 29, 2014, 07:00:24 PM by norcalreballer »

Offline karadorde

  • Full Member
  • ***
  • Joined: Aug 2014
  • Location: USA
  • Posts: 43
  • Karma: +2/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #94 on: September 29, 2014, 07:58:24 PM »
The GE DLynx can be controlled with PMBus and I have seen some projects using it. I am working on some ideas that incorporate an MCU with a new Murata chip that is coming to market. I will share as I have more details.

The constant current set up works and works pretty well. However, there are some issues with it that I didn't really care for. For my project, I think the in line current sensor is a better and safer alternative. I can go into more detail on this if you'd like.

Claviger is not reading resistance. He was setting the resistance of the coil in his actual source code. 

Are you talking about pulsing a mosfet to send power to the coil without the use of a power converter like the OKL2 or the Raptor?

Offline norcalreballer

  • Sr. Member
  • ****
  • Joined: Jul 2014
  • Location: USA
  • Posts: 63
  • Karma: +4/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #95 on: September 29, 2014, 08:02:59 PM »
Hi, thanks for the quick reply.  What is the problem with 4 wire resistance measurement?  I'm just learning, so some insight is greatly appreciated.  Yes, I'm talking about controlling the power to the coil(s) using PWM via digital pin. 

Offline scripto23

  • Jr. Member
  • **
  • Joined: Sep 2014
  • Location: USA
  • Posts: 8
  • Karma: +0/-0
Re: You asked mamu it's coming.
« Reply #96 on: October 06, 2014, 07:16:49 PM »
The GE DLynx can be controlled with PMBus and I have seen some projects using it. I am working on some ideas that incorporate an MCU with a new Murata chip that is coming to market.

Do you happen to know a part number for the new Murata chip you are referring to?

Offline miskol

  • Super Member
  • *****
  • Joined: Mar 2014
  • Location: Malaysia
  • Posts: 106
  • Karma: +9/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #97 on: October 14, 2014, 04:50:12 PM »
hi guys,

i tried to build my own Booster circuit, but the converter part is not working, burnt MOSFETs everywhere lol.

so i connected an OKR T/10 to my board for the moment :)



every info on the OLED is real-time, battery level, OKR output, ohm checker, Watt estimation.

but there's some problem with the OKR output read and current measurement. apparently when the RL (coil resistance) is changed, the ADC reading for the OKR output and current measurement would be different and out of range, when software-adjusted, it will work nicely (by varying the OKR output) as long as the same RL is used and not changed to different ohm.



from the circuit shown, voltage divider of two 3.3k resistors are used to divide half the max 6V OKR output for ADC reading (max 3.3V). its a simple process for ADC reading isnt it?

so my question is,
1) does the changes of RL effect Vfb?

2) should it be better for the R2 voltage divider is changed to connect between R1 & RL?


hope others could help, thank you.
« Last Edit: October 14, 2014, 05:50:28 PM by miskol »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #98 on: October 15, 2014, 03:23:11 PM »
There's something else going on there.  The voltage Vfb will always be 1/2 the voltage applied across R2 an R3 regardless of the R1 and RL values. 

In any case, that's how you would typically measure a voltage higher than the ADC reference.  You should add a 100nF filter capacitor across R3 or the readings will jump around a lot.  You can alternately filter readings in software, but I always use a hardware filter as it's a simple thing to do with a voltage divider (and one is often required).

There's lots of things that can cause issues when taking ADC measurements.  For example, if you're trying to measure a voltage higher then the ADC reference, your readings will get clipped by the ADC reference.  Then there's the reference itself.  If you are using supply voltage as your reference, ADC accuracy is dependent on the supply.  If supply voltage dips, then so will ADC readings.  Then there's issues you can run into with sample and hold timings.  If those are not ideal, you can get pretty wild swings in readings due to external conditions.

BTW, what controller were you using to build a boost converter.  Usually with converters getting them to work at some level is not a big problem, getting them unconditionally stable is where things get tricky.

Offline miskol

  • Super Member
  • *****
  • Joined: Mar 2014
  • Location: Malaysia
  • Posts: 106
  • Karma: +9/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #99 on: October 15, 2014, 11:34:40 PM »
noted with thanks Craig, will try to add cap, the ADC does fluctuates like crazeh!

however for the problems that i'm having, i dont think it relates with ADC reference since the problem only occurs for reading ADC value of 510 output where i have to re-adjust by software to get the value within OKR voltage range whenever RL resistance is changed. reading ADC value of the battery level is not affected (from what i remembered, will have to confirm back).

it seems that the current circuit looks like a Wheatstone bridge?

if the circuit is modified into below circuitry would it solve the problem?


video:
http://youtu.be/GPV-AmsKNJo

i'm using the old school way Craig, using a gate driver to control two MOSFETs.


Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: You asked mamu it's coming.
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!