Announcement

Collapse
No announcement yet.

How could I find a FET with specific specs?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by eccerr0r View Post
    I'd not be surprised if some of the arduino code dedicates some of the hardware resources for itself and you may not be able to change some things without serious side effects.
    Well ... yeah ...

    These blocks are pretty much the whole Arduino theme on a chip, no?

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by sam_sam_sam View Post
    My problem is I do not know where to start looking for this information is it possible to point me in the right direction

    Thanks
    You know I was actually thinking about that very thing yesterday as I was reading your posts and reading different blogs and so as I thought about it ... when a microcontroller is first released ... how do we get those juicy blog posts that explain how to do what it is we want to do with clear examples etc.? Where do those great libraries come from?

    Those guys have the same resources available to them that we have ... THE DATASHEET!

    The only difference between them and me is that they apparently can read and understand hieroglyphics where-as the stuff gives me hives ... I'm exaggerating but ... the last course I took on microprocessors was in 1991 and the "microprocessor" was a Motorola 6800 ... we did simple boolean logic with the darn thing cause obviously, it wasn't a fraction of what MCs are today.

    If I understood better what all the stuff was "under the hood" on a more comprehensive level, I could probably just grab a datasheet and go to town. But if there's anything I know ... it's what I don't know... and that becomes painfully obvious whenever I read a datasheet.

    I understand OOP programming just fine, and C++ wasn't too difficult to learn on a somewhat functional level ... but man ... when they get deep into registers stuff ... for example, I understand that if you want to manipulate settings directly on an MC without burning clock cycles on c++ execution, you write bits to PORTS ... but beyond that, I have no idea what a "PORT" is ... stack pointers, overflow registers ... direct memory access ... Atomic byte programming, split byte programming ... I understand CONCEPTUALLY what these things are but understanding things enough to be able to do something useful straight from the datasheet? I'm not there ... and don't know if I ever will be. I feel like I need a basic course in general microprocessor theory before ill even have a chance at getting totally self-sufficient.

    THANKFULLY, people who know what they're doing write nifty libraries for us commoners so that we don't have to re-invent the wheel.

    But to answer your question more directly, the way I learned was by reading other people's code and making sense of what they were doing. I started with a project that does something I've always wanted to do which is build a battery charger (Still haven't done it yet but I've attempted it many times - need more education on different aspects of it before I'll be able to conquer it) ... but when I started, I bought an Arduino 2560 I believe it was ... but then after frying it, I discovered the Nanos and those things are nice, although the Chinese versions are inexpensive for a reason ... I almost always end up destroying the USB port on them for some reason ... and then I have to program them with a USBASP device which can be a real drag. I've gone through at least a dozen Nanos and my last purchase was a box of 10 of them because they just don't hold up well... and I would be the first to admit if I were being careless with the darn things, but Ive literally hooked up a brand new Nano and flashed one program to it with NOTHING connected to it, and the next flash wouldn't go because the USB port died. Theres something about the USB chips that they use on those knockoffs that really suck. Ive threatened to get a brand name Nano to see how it does but I haven't done that yet.

    I do really like the Teensy 4.0 ... $20 and its a very robust board ... check out the benchmark comparisons to other Arduinos ... the Nano would fit somewhere at the bottom of this chart:



    And you can kind of multi-thread with them which has been real convenient for some things that Ive done. It's nice to have basically multiple loops in the same program. You have to do some things a little different like declare your variables as volatile if you share them between threads and in each thread loop you have to yield at least once so that the other threads can get clock time (they will take it at an interval but calling a yield makes things flow smoother)... so it's not true multi-threading but it is nice because your code can be broken down into isolated functions, and that board running with 7 threads all sharing clock time will still be way faster than a nano running its little heart out.

    But for me, I have to be wanting to DO SOMETHING before I'll really dig in and learn ... and that has lead me into different directions of learning where I just want to know something specific or sometimes certain things are just interesting and ill read up on them just for the curiosity of it.

    ... Then there are the forums ... I always try to exhaust everything I can find online and make sense of before posting in forums ... and the regulars in this forum can be brutal sometimes... I picture them sitting on their porch yelling at the neighbor kids to get off their lawn! (the visual helps - lol) ... but either I'm not asking questions in the right way or they think I know more than I do ... I'm not sure... but I tend to get scolded more often than not ... and I haven't really figured out why - but it is what it is ... I keep coming back so ... :-)

    I'd be happy to work with you if you really want to start learning how to program Arduino's. I've got a lot of code that does various things ... or I can help you figure out how to code whatever it is you're wanting to do ... if there is anything I do feel like I have a good bite on in terms of knowledge, its coding Arduinos. I've written some libraries of my own and I've learned some tricks and styles of coding that keep program flow SIMPLE and EASILY READ - which is very important especially when you put something down and don't come back to it for a few months ... my main hobby that I cant get enough of is writing java apps. There's just something about Java that I really like ... it's a fun language to code with. I wish MCs could be coded with Java but as it is now, it would be far too heavy for a typical microcontroller since the language needs to be interpreted at runtime whereas C++ is much more root level and is much more efficient as an MC language.

    If you wanna email me off list, my addy is: sims.mike@gmail.com

    Leave a comment:


  • eccerr0r
    replied
    Re: How could I find a FET with specific specs?

    Unfortunately the answer is "They're all in the datasheet."

    Then there's also the problem with "arduino" that may force certain resources to be dedicated to the arduino system else some functionality will be broken... I'd not be surprised if some of the arduino code dedicates some of the hardware resources for itself and you may not be able to change some things without serious side effects.

    Again with the disclaimer that I do not use arduino, I've only used straight C and assembler and thus have to deal with the resources directly.

    Leave a comment:


  • sam_sam_sam
    replied
    Re: How could I find a FET with specific specs?

    I have one question where do you get the information for each of the interrupts and all types of code parameters and definitions and examples for you to learn how to program these type of devices

    As I used the basic stamp example earlier there is all kinds of examples a lot of articles about how to program them

    My problem is I do not know where to start looking for this information is it possible to point me in the right direction

    Thanks
    Last edited by sam_sam_sam; 01-27-2021, 07:19 AM.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by sam_sam_sam View Post
    I have one question are there any PWM code that would adjust from 0 to 255 and you can see the difference as you increase/decrease the scaler value
    Sam,

    Here is part two: the actual code ...

    Code:
    /*
     ATtiny85 test code
     
     Overview:
     This code flashes the LEDs and outputs data on the serial port.
     This is to test the function of the IC at lower voltages.
     
     This code is designed to run on the ATTiny 25/45/85
     The serial output only works with the larger ATTiny85 IC
     
     The connections to the ATTiny are as follows:
     ATTiny  Arduino  Info
     Pin 1 - 5     RESET / Rx (Not receiving any data)
     Pin 2 - 3     Tx for serial conenction
     Pin 3 - 4     FET driver (PWM)
     Pin 4 -      GND
     Pin 5 - 0     RED LED (PWM)
     Pin 6 - 1     GREEN LED
     Pin 7 - 2 / A1   Vsensor (Analog)
     Pin 8 -  +Vcc
     
     See www.samaenergy.org/www.re-innovation.co.uk for more details including flow code
     
     13/11/13 by Matt Little (matt@re-innovation.co.uk/www.re-innovation.co.uk)
     
     Updated: 
     13/11/13 Added fast PWM frequency - Matt Little
    
     
     This example code is in the public domain.
     */
    
    #define F_CPU 8000000 // This is used by delay.h library
    
    #include <stdlib.h>
    #include <EEPROM.h>
    
    #include <avr/io.h>    // Adds useful constants
    #include <util/delay.h>  // Adds delay_ms and delay_us functions
    
    // Only use Serial if using ATTiny85
    // Serial output connections:
    #include <SoftwareSerial.h>
    #define rxPin 5  // We use a non-existant pin as we are not interested in receiving data
    #define txPin 3
    SoftwareSerial serial(rxPin, txPin);
    
    #define INTERNAL2V56NC (6)
    
    //************ USER PARAMETERS***********************
    
    //**********MODE*************************************
    const int deviceType = 85; // 45 = ATTiny45, NO serial output, 85 = AtTiny85, with serial output
    
    // LED output pins:
    const int redled = 0;     // Red LED attached to here (0, IC pin 5)
    const int buzzLedSw = 1;    // Green LED/buzzer/Switch attached to here (1, IC pin 6)
    
    // MOSFET Driver output
    const int FETdriver = 4;
    
    // Analog sensing pin
    const int VsensePin = A1;  // Reads in the analogue number of voltage
    long int VsenseValue = 0;  // Holds the voltage data
    unsigned long int Vint = 0; //Holds the voltage as an int
    
    int voltageRange = 0; // This stores the volatge range. This is 12V, 24V or 0v (error)
    const int Taverage = 10; // This is the number of samples to average over (each sample is around 5ms)
    
    // PID CONTROL values
    int FETPWM = 0;   // This is the control for the PWM 
    int integral = 0;  // Holds the integral part
    int proportional = 0;// Holds the proportional part
    int error = 0; // Holds the error term
    
    //Timing for serial output
    long int oldMillis = 0; //This holds the previous millisecond count value
    
    // Varibales for EEPROM
    int hiByte;   // These are used to store longer variables into EEPROM
    int loByte;
    
    // Varibles for the calibration factor
    int calibrationFactor = 0;  // This holds the Vref value in millivolts
    
    // State machine control
    int stateControl = 0; // This controls the state of the device
    
    // the setup routine runs once when you press reset:
    void setup() { 
    
    
      /*
      Control Register A for Timer/Counter-0 (Timer/Counter-0 is configured using two registers: A and B)
      TCCR0A is 8 bits: [COM0A1:COM0A0:COM0B1:COM0B0:unused:unused:WGM01:WGM00]
      2<<COM0A0: sets bits COM0A0 and COM0A1, which (in Fast PWM mode) clears OC0A on compare-match, and sets OC0A at BOTTOM
      2<<COM0B0: sets bits COM0B0 and COM0B1, which (in Fast PWM mode) clears OC0B on compare-match, and sets OC0B at BOTTOM
      3<<WGM00: sets bits WGM00 and WGM01, which (when combined with WGM02 from TCCR0B below) enables Fast PWM mode
      */
      TCCR0A = 2<<COM0A0 | 2<<COM0B0 | 3<<WGM00;
      
      /*
      Control Register B for Timer/Counter-0 (Timer/Counter-0 is configured using two registers: A and B)
      TCCR0B is 8 bits: [FOC0A:FOC0B:unused:unused:WGM02:CS02:CS01:CS00]
      0<<WGM02: bit WGM02 remains clear, which (when combined with WGM00 and WGM01 from TCCR0A above) enables Fast PWM mode
      1<<CS00: sets bits CS01 (leaving CS01 and CS02 clear), which tells Timer/Counter-0 to not use a prescalar
      */
      TCCR0B = 0<<WGM02 | 1<<CS00;
      
      /*
      Control Register for Timer/Counter-1 (Timer/Counter-1 is configured with just one register: this one)
      TCCR1 is 8 bits: [CTC1:PWM1A:COM1A1:COM1A0:CS13:CS12:CS11:CS10]
      0<<PWM1A: bit PWM1A remains clear, which prevents Timer/Counter-1 from using pin OC1A (which is shared with OC0B)
      0<<COM1A0: bits COM1A0 and COM1A1 remain clear, which also prevents Timer/Counter-1 from using pin OC1A (see PWM1A above)
      1<<CS10: sets bit CS11 which tells Timer/Counter-1 to not use a prescalar
      */
      TCCR1 = 0<<PWM1A | 0<<COM1A0 | 1<<CS10;
      
      /*
      General Control Register for Timer/Counter-1 (this is for Timer/Counter-1 and is a poorly named register)
      GTCCR is 8 bits: [TSM:PWM1B:COM1B1:COM1B0:FOC1B:FOC1A:PSR1:PSR0]
      1<<PWM1B: sets bit PWM1B which enables the use of OC1B (since we disabled using OC1A in TCCR1)
      2<<COM1B0: sets bit COM1B1 and leaves COM1B0 clear, which (when in PWM mode) clears OC1B on compare-match, and sets at BOTTOM
      */
      GTCCR = 1<<PWM1B | 2<<COM1B0;
     
     // Set up IO pins
     pinMode(rxPin, INPUT);
     pinMode(txPin, OUTPUT); 
     pinMode(redled, OUTPUT);
     pinMode(buzzLedSw, OUTPUT);    // First want to read the switch
     pinMode(FETdriver, OUTPUT);
     
     digitalWrite(FETdriver, LOW);  // Switch the FET OFF
     
     if(deviceType==85)
     {
      // Start the serial output string - Only for ATTiny85 Version
      serial.begin(4800);
      serial.println("TEST ATTiny85");
      serial.println("13/11/13 Matt Little"); 
     }
    
     analogReference(INTERNAL2V56NC); // This sets the internal ref to be 2.56V (or close to this)
     delay(100); // Wait a while for this to stabilise.
     
     // Read in the Calibration Factor
     hiByte = EEPROM.read(124);
     loByte = EEPROM.read(125); 
     
     calibrationFactor = (hiByte << 8)+loByte; // Get the sensor calibrate value 
     
     serial.print("Calibration Factor: ");  // TESTING
     serial.println(calibrationFactor);  // TESTING
     
    } 
    
    // the loop routine runs over and over again forever:
    void loop() { 
     
      // RED LED ON 
      // set the output RED
      analogWrite(redled, 127);  // Set it to 50% running at 31.2kHz 
      analogWrite(buzzLedSw, 0); 
      _delay_ms(500);
      serial.println("This is a NEW TEST");
      // GREEN LED ON 
      // set the output GREEN
      //analogWrite(redled, 0);  
      analogWrite(buzzLedSw, 255);  
      _delay_ms(500);
    }
    Last edited by EasyGoing1; 01-27-2021, 06:08 AM.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by sam_sam_sam View Post
    I have one question are there any PWM code that would adjust from 0 to 255 and you can see the difference as you increase/decrease the scaler value
    Sam,

    As I was looking into how to increase the PWM clock on the ATTINY85, this here is a CLASSIC discussion blog on topics that deal with the deeper roots of microcontrollers ... pretty much after he says, "When we read the datasheet..." I'm on a fast track to snooze-ville... I read it to see what I can absorb, then I just look for the code examples... lol

    But this will give you an idea of how NON-TRIVIAL it is to do something you would think should be simple, like increasing the frequency of a MC's PWM output:

    Also, checking the ATTiny85 datasheet to look at the Timer 0 and 1 and setting fast PWM we find the bits we need to set. Its not very obvious, but here is a brief explaination of the bits to set. One problem with changing Tiner0 is that it will affect the normal delay function (as this depends upon the Timer 0 value for its timing).

    In order to overcome this we have to use a different delay function, by including the library “#include <util/delay.h>”. This also requires us to set the define the CPU frequency, which is used to calculate the correct delays “#define F_CPU 8000000”, as I have set the clock to 8MHz. We must also use the new delay functions from the new delay library. These are written as “_delay_ms(500);”. The “delay(500); ” does not work as it uses the timer 0, which we need to change in order to get fast PWM.

    We also include the library “#include <avr/io.h>” which has the definitions for the various register we need to set.

    When we read the data sheet we see that we need to set:

    WGM0[2:0] to 3 (binary 011): this is the Waveform Generation Mode which we set to Fast PWM.
    COMOA0/COMOB0 to 2 (binary 10): Compare Match Output Mode needs to be ‘Clear on Match. Set at Bottom'
    CS00/CS10 = 1: This tells Timer 0/1 NOT to use a prescaler.
    PWM1B = 1: This enables the use of Output Compare Unit B from Timer 1 (OC1B).
    PWM1A = 0: This disables the use of Output Compare Unit A from Timer 1 (OC1A) as that pin is shared with OC0B.
    If we check the data sheet we see that OC1B is on pin 3 (Arduino pin 4), OC0A is on pin 7 (Arduino pin 2/A1) and OC1A/OC0B is on pin 6 (arduino pin 1) of the IC. In the end I only want OC1B to give me fast PWM, but its good to see how the other outputs can be used.

    This is done by setting the following registers (notes have been copied from here):

    TCCR0A = 2<<COM0A0 | 2<<COM0B0 | 3<<WGM00;
    Control Register A for Timer/Counter-0 (Timer/Counter-0 is configured using two registers: A and B)
    TCCR0A is 8 bits: [COM0A1:COM0A0:COM0B1:COM0B0:unused:unused:WGM01:WGM00]
    2<<COM0A0: sets bits COM0A0 and COM0A1, which (in Fast PWM mode) clears OC0A on compare-match, and sets OC0A at BOTTOM
    2<<COM0B0: sets bits COM0B0 and COM0B1, which (in Fast PWM mode) clears OC0B on compare-match, and sets OC0B at BOTTOM
    3<<WGM00: sets bits WGM00 and WGM01, which (when combined with WGM02 from TCCR0B below) enables Fast PWM mode

    TCCR0B = 0<<WGM02 | 1<<CS00;
    Control Register B for Timer/Counter-0 (Timer/Counter-0 is configured using two registers: A and B)
    TCCR0B is 8 bits: [FOC0A:FOC0B:unused:unused:WGM02:CS02:CS01:CS00]
    0<<WGM02: bit WGM02 remains clear, which (when combined with WGM00 and WGM01 from TCCR0A above) enables Fast PWM mode
    1<<CS00: sets bits CS01 (leaving CS01 and CS02 clear), which tells Timer/Counter-0 to not use a prescalar

    TCCR1 = 0<<PWM1A | 0<<COM1A0 | 1<<CS10;
    Control Register for Timer/Counter-1 (Timer/Counter-1 is configured with just one register: this one)
    TCCR1 is 8 bits: [CTC1:PWM1A:COM1A1:COM1A0:CS13:CS12:CS11:CS10]
    0<<PWM1A: bit PWM1A remains clear, which prevents Timer/Counter-1 from using pin OC1A (which is shared with OC0B)
    0<<COM1A0: bits COM1A0 and COM1A1 remain clear, which also prevents Timer/Counter-1 from using pin OC1A (see PWM1A above)
    1<<CS10: sets bit CS11 which tells Timer/Counter-1 to not use a pre-scalar

    GTCCR = 1<<PWM1B | 2<<COM1B0;
    General Control Register for Timer/Counter-1 (this is for Timer/Counter-1 and is a poorly named register)
    GTCCR is 8 bits: [TSM:PWM1B:COM1B1:COM1B0:FOC1B:FOC1A:PSR1:PSR0]
    1<<PWM1B: sets bit PWM1B which enables the use of OC1B (since we disabled using OC1A in TCCR1)
    2<<COM1B0: sets bit COM1B1 and leaves COM1B0 clear, which (when in PWM mode) clears OC1B on compare-match, and sets at BOTTOM
    I'll post the actual code in part two ... who knew there was a size limit on how much text you could post in here? LOL

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by eccerr0r View Post
    To be honest 450Hz should be fast enough to not see much flickering unless your software is glitching and introducing a beat pattern... so are you actually seeing a beat pattern without the capacitor? What frequency is it beating?
    The only way I can describe it ... and it may sound weird and you'll probably make fun of me ... but it's something I actually FEEL in my eyeballs.... "seeing" it is more of a perception, but it definitely feels like a pulsating pressure in the back of my eye. and it is VERY fast no question about it.

    I was able to capture it with my phone ... here's a standard 30fps

    https://youtu.be/TWD-3F9ObF0

    And this one was recorded at 120FPS slowed down to 30 ... I only recorded like 12 seconds but it's over a minute long.

    https://youtu.be/OnpcsmbC4Mw

    Notice in the first video at the fastest duty cycle the flicker goes away ... for obvious reasons.

    Leave a comment:


  • eccerr0r
    replied
    Re: How could I find a FET with specific specs?

    To be honest 450Hz should be fast enough to not see much flickering unless your software is glitching and introducing a beat pattern... so are you actually seeing a beat pattern without the capacitor? What frequency is it beating?

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by eccerr0r View Post
    Ever since your stirrer project: I've been saying: NO analog, NO filtering. budm hit it on the nose, go reread his post.

    Your microcontroller should not deal with any analog at all. If you're thinking analog on the microcontroller, you're doing it wrong.
    Well if you remember, I got the best results on the stirrer project using a stepper motor controller ... I'm kind of in neutral on that project because I can't seem to figure out how to get enough electromagnetic strength in terms of coil specs and required voltage, etc. Coil design seems to be an entire discipline in it of itself and I'm just not knowledgable enough to know how to proceed with it.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by sam_sam_sam View Post
    I am not a nano programmer and never programmed one but I would like to see if I could learn enough to some what get good enough at it to maybe correct some issues with the way this program is written and I aware of the fact that it will take time
    Sam,

    Take a look at those three scope screenshots that I posted ... click on them to make them bigger then look at the bottom of the screen and notice that the frequency of the PWM signal is the same at every different duty cycle.

    That analogWrite command from 0 to 254 is only controlling the duty cycle, the frequency is not easily adjusted ... you have to get into the control registers for that and there are no simple C++ commands to do it, you have to know the name of the register and which bit to set at which value then you set it in code by naming the register and setting it equal to an 8-bit binary number to set those bits ... or you can do other tricks like using an OR statement so that you can flag the other bits in the register at 0 so that they don't change because you don't always know what affect you could have changing them, so let's say you had to set bit 2 to 1 but you don't want to mess with the other bits in the register, you would just OR B00000100 that way you're guaranteed to set the bit in position 2 to a 1 while whatever values are in the other bits, you won't be affecting them at all.

    And if memory serves ... that would look something like this (assuming the name of the register you wanted to change was MCRC):

    MCRC |= B00000100

    Notice the pipe symbol before the = sign ... which means OR ... if you wanted to AND the bits, you would use an ampersand etc...
    Last edited by EasyGoing1; 01-26-2021, 11:31 PM.

    Leave a comment:


  • eccerr0r
    replied
    Re: How could I find a FET with specific specs?

    Ever since your stirrer project: I've been saying: NO analog, NO filtering. budm hit it on the nose, go reread his post.

    Your microcontroller should not deal with any analog at all. If you're thinking analog on the microcontroller, you're doing it wrong.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by eccerr0r View Post
    Also need to consider the fact that there are so many variables are involved, but if there's a capacitor that can sustain the LED for longer than the pulse width and the switching transistor output impedance is low, well, there you have it - a recipe for the LED to be on full brightness that has no dimming capability.

    As for why I think the design OP had created is "broken" - notice he had hardcoded constants in his code. These hardcoded constants are specific to the specific transistor being used: if a different IRF510 was substituted, there's no guarantee the behavior would be the same - some would be brighter at some values, other dimmer, and very possible that some transistors would not even light up at all even though the transistor is considered "working". That's the concern I have.
    You know to be honest with you ... I thought you guys were pushing for the RC filter earlier in this discussion and that presumption, along with noticing the flicker I just threw it in, but I would definitely rather not use it ... and as far as the code goes, the final PCB will have a 6 pin header on it for re-programming as needed. But I'm going to look at bumping the PWM frequency because Id much rather drive this with as few components as necessary.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by sam_sam_sam View Post
    I have a nano controller for my engraving machine and I to test the PWM output pin I hooked up a LED to it and adjusted the 0 to 255 scaler but what I noticed is there only seem to either very dim or very bright but no real in between or is the way the controller program is written ( this is for laser diode input to its controller ) and also for the spindle motor controller has the same problem

    I actually had to buy a controller that the controller could adjust the frequency lower for it to work correctly

    This is why I did not recommend a nano for his project
    I've worked with the Arduino Nano more than any other microcontroller... you have to make sure that you're on a pin capable of PWM and on the Nano those pins are 3, 5, 6, 9, 10, 11 - both the physical pin number and the number you reference in code... you set the pinMode to OUTPUT, then you vary the duty cycle using the analogWrite command like this:

    analogWrite(5, 100);

    You can choose a value anywhere from 0 to 254 and each higher value is a faster duty cycle, but NOT a faster frequency. In order to increase the frequency, you have to set certain control registers to get clock multiplication or even switch over to a different clock depending on the MC...

    BUT, I'm not using a nano for this project ... I'm using an ATMEL ATTINY85

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by eccerr0r View Post
    I'm done. I think I've already stated all the problems, in the design - even if you wish to mass produce them and reduce amount of defective devices - at this point, whether you take the red pill or the blue pill is up to you.
    Mass production wasn't in the plan ... but making some for friends and family definitely was in the plans.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by sam_sam_sam View Post
    Easygoing

    Are you using a USB battery charger unit for the ( battery or batteries) for this project if so why not run the LEDs at 5 volts and use the correct value resistor for this voltage
    Yes, one of those chargers for LiIon that lets you both run the circuit and charge the battery at the same time. It was an experiment for me and I'm not happy with it because when the battery discharges and gets sufficiently low enough, you can't run the circuit even if you recharge the battery without first disconnecting the battery then re-connecting it ... I don't know if it is an anomaly with this specific charger or if that is the standard behavior of all such chargers ... this is my first experience with this type.

    And the reason why not 5 volts is because the best I can get from the battery is 4.2.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by budm View Post
    That large RC on the GATE of the MOSFET defeats the purpose of turning MOSFET ON and OFF in PWM fashion, you are using MOSFET in linear mode, wasting energy. 3.3V drive is barely enough to turn MOSFET fully ON and OFF, look at the spec sheet of the MOSFET for clarification.
    Look at the RC Time constant and look at you PWM frequency, is the cap able to be fully charged and discharged based on your PWM frequency?
    Study the effect of that RC and experiment with changing the value of RC and the PWM frequency to see what effect you will see if you want to learn.
    I posted this earlier, but here it is again ... this was taken from my scope on this exact RC filter... The yellow line obviously is the output of the MC and the green is at the point where the resistor and the cap meet ... so basically this is the waveform both before and after the resistor...



    Leave a comment:


  • EasyGoing1
    replied
    Re: How could I find a FET with specific specs?

    Originally posted by eccerr0r View Post
    If you write your microcontroller software right, you won't see the LED pulsing, key is that you need it to be fast, very fast, like many kilohertz fast, then you won't see the pulsing anymore.
    This is actually a solid statement... the MC currently defaults to only 450 Hz on the PWM frequency, but I was looking at the datasheet as it tries to explain how to speed that up ... but datasheets sometimes are very ... ummm ... concise??? might be the word I'm looking for? Of course, they assume a certain level of knowledge then they're very brief in what they say ... so I'll look for some blogs on how to do it because you're on to something here. If I could get that PWM frequency up into the Khz range it certainly would not be noticeable.

    I'm curious though ... how is that cap sucking down energy when all it can do is balance the waveform that the pin is kicking out? I mean whether the cap is there or not, the chip only puts out what it puts out... and it would put out the same whether the cap was there or not ... so I'm a bit confused about that point.

    Leave a comment:


  • budm
    replied
    Re: How could I find a FET with specific specs?

    That large RC on the GATE of the MOSFET defeats the purpose of turning MOSFET ON and OFF in PWM fashion, you are using MOSFET in linear mode, wasting energy. 3.3V drive is barely enough to turn MOSFET fully ON and OFF, look at the spec sheet of the MOSFET for clarification.
    Look at the RC Time constant and look at you PWM frequency, is the cap able to be fully charged and discharged based on your PWM frequency?
    Study the effect of that RC and experiment with changing the value of RC and the PWM frequency to see what effect you will see if you want to learn.
    Last edited by budm; 01-26-2021, 07:31 PM.

    Leave a comment:


  • sam_sam_sam
    replied
    Re: How could I find a FET with specific specs?

    I realize that and I also know that probably the manufacturers of these DYI kits for engraver machines are probably taking as many short cut as they can to keep the cost down

    So I have to see if I can improve the functionality of the the board that I plain to use if that means removing components that should not be there for how I want to use it

    Or make my own board but I am not up to doing this at this point

    I have one question are there any PWM code that would adjust from 0 to 255 and you can see the difference as you increase/decrease the scaler value

    ( now if you hook a meter to the output you do see the voltage climb but increments are to large for what I want in steps or I might be asking for to much )

    I am not a nano programmer and never programmed one but I would like to see if I could learn enough to some what get good enough at it to maybe correct some issues with the way this program is written and I aware of the fact that it will take time
    Last edited by sam_sam_sam; 01-26-2021, 07:35 PM.

    Leave a comment:


  • eccerr0r
    replied
    Re: How could I find a FET with specific specs?

    Also need to consider the fact that there are so many variables are involved, but if there's a capacitor that can sustain the LED for longer than the pulse width and the switching transistor output impedance is low, well, there you have it - a recipe for the LED to be on full brightness that has no dimming capability.

    As for why I think the design OP had created is "broken" - notice he had hardcoded constants in his code. These hardcoded constants are specific to the specific transistor being used: if a different IRF510 was substituted, there's no guarantee the behavior would be the same - some would be brighter at some values, other dimmer, and very possible that some transistors would not even light up at all even though the transistor is considered "working". That's the concern I have.

    Leave a comment:

Working...
X