Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FEATURE REQUEST 4-6-8 Phase PWM
#1
Wink 
hi guys.
        This is my first post on this site so hope this is the right place.
         A great Youtuber sent me here 'rdagger69' to ask this question here since he didn't know how to do this and thought it was a great idea
         and feature.

         I'm working on a motor controller for a electric car witch works but the power stage is all parallel MOSFET's 14x130 amp mosfets at 120 volts
         the controller has all the safety features and sensors for temp and voltage and current sensors.
         I want to upgrade to to 4 600 amp igbt's in 4-phase.
reasons
         igbt's don't like being switched fast at high current, too much ripple current and desat of the igbt's isn't a good thing it has blowed so many mosfets
         on mine and other club members controllers.
         along with igbt's not liking being pwm switched at high speed to cut down on ripple big electric motors don't like being pwm switched at low speed
        witch causes high ripple current, high back emf, large capacitor bank to handle the high ripple, and the motors are less efficient at lower pwm's.

        igbt's can have thermal runaway in parallel if the center igbt starts getting warmer then the outer igbt's it will start conducting more then it's partners
        and start trying to take over the whole load witch causes it to get hotter and conduct more, thus thermal run away and BOOM!! there it is....LOL

        the solution is 4 phase pwm out at 6khz pur phase (min 4khz, max 8khz), 6khz x 4 phases will be 24khz at the motor witch will greatly reduce or cancel
        out ripple current, capacitor bank size eliminate thermal run away, ect...

        I posted as 4-6-8 because because what would be better then 4 phase would be 6 or 8 but if 4 is all the ESP32 can handle then it will work fine,

request       
        So my question that I presented to rdagger69 that sent me here is can someone show me how to code the ESP32 with a 0-5 volt pot input 0-100% duty cycle
        and 4 phase output that 90 degrees out of phase?         ( 6 phase 60 degrees, 8 phase 45 degrees)
 
gibberish      
        I am brand new to Micropaython, I never heard of it till 2 weeks ago, I've learnt the basics already like every other newbee,
        I ordered some CD4017 cascade counter used for led chasers to test a idea to see if the input will except pwm input on the clock input and result in a pwm on the ten
        output lines, theoretically I could run 60khz pwm clock in and have 6khz at each output line for 10 phases and have 60khz at the motor,
        Since the cd4017 is capable of 10Mhz there wouldn't be any problem with speed just don't know if it will except pwm? it's just a theory.

         the output phases will only be driving the led's inside the optocouplers to the driver boards, I will experiment with driving some mosfets with a 12 volt battery and motor
         on the desk at first.

         so thanks guys, like rdagger69 said I don't know if one timer is needed to drive all the outputs or a timer for each and good as his videos are if he doesn't know
         I sure don't know.
         Thanks again Louie...........


Attached Files Thumbnail(s)
       
Reply
#2
Multiple synchronized PWM outputs with phase shifting are planned in pwm module, but I've never had enough free time to finish it.
When finished, you should be able to use it for your project without any external hardware (related to phase shifting).

Up to 8 PWM channels can be used that way.
Reply
#3
(11-01-2018, 03:23 PM)lobo Wrote: Multiple synchronized PWM outputs with phase shifting are planned in pwm module, but I've never had enough free time to finish it.
When finished, you should be able to use it for your project without any external hardware (related to phase shifting).

Up to 8 PWM channels can be used that way.

WOW! sounds fantastic, I wish you all the luck..
Reply
#4
If while waiting for implementation for this on ESP32 in Micro-Python you can very easily impklemnt this using a PCA9685 chip. It will generate up to 16 channels of PWM but all 16 channels must have the same freq but start on stop times on that freq can bet set.

I basically use it to do exactly what your trying to do to drive my servos. I want each servo to get the duty signal at a different time during the freq so that the current pull for each servo is spread out.

Here is the code for my servo driver you will be able to see how it works and modify it for your needs(freq, start and stop).

import time
from ustruct import pack

class Servo:
  def __init__(self, i2c_bus, slave=0x40):    
    self.slave = slave    
    self.i2c = i2c_bus    
    self.i2c.writeto_mem(slave, 0x00, b'\x10') #set mode1 to sleep    
    time.sleep_us(5)    
    prescale = int((25000000/ (4096*50))+0.5)    
    self.i2c.writeto_mem(slave, 0xfe, pack('B',prescale)) #setprescale    
    self.i2c.writeto_mem(slave, 0x00, b'\xa1') #set mode1     
    time.sleep_us(5)    
    self.step = 200/(pi/2) #step size for radians    
    for servo in range(16):  #set all servos to popsition 0    
      on_time = servo*220      
      off_time = on_time + 340      
      self.i2c.writeto_mem(self.slave, 0x06 + (servo*4), pack('
  #servo positions r set in radians not degress
  def set_servo(self, pos, servo):
    off_time = (servo * 220) + 340 - (int(pos * self.step))     
    self.i2c.writeto_mem(self.slave, 0x08 + (servo*4), pack('
Reply
#5
Thanks OutOfTheBOTS
I ordered the PCA9685 board to try out I was reading the specs sheet on the chip and said it only had a max speed of 1khz but still
eager to try it out, the code you posted got cut off at the bottom and i don't know enough yet being only little over a week into studying
micropython to finish it LOL.
but 16 channels at 1khz each thats 16khz at the motor so I'll try it with mosfets to see what happens Smile
Reply
#6
(11-01-2018, 03:23 PM)lobo Wrote: Multiple synchronized PWM outputs with phase shifting are planned in pwm module, but I've never had enough free time to finish it.
When finished, you should be able to use it for your project without any external hardware (related to phase shifting).

Up to 8 PWM channels can be used that way.

I know how busy things are and how hard it is to get to projects so I waited 5 months to ask about any updates,
and I hope I'm not being rude for asking but was checking in for any updates in the nicest way.
thank you...
Reply
#7
(11-01-2018, 03:23 PM)lobo Wrote: Multiple synchronized PWM outputs with phase shifting are planned in pwm module, but I've never had enough free time to finish it.
When finished, you should be able to use it for your project without any external hardware (related to phase shifting).

Up to 8 PWM channels can be used that way.

Was wondering if there's any updates, I been waiting patiently.. Rolleyes

I been posting replies every few months wondering if there's any updates??
I don't know if I posted the wrong way or if I said anything wrong or if my post have to
go thru a moderator before there posted but my last few post isn't showing.
Reply
#8
(11-01-2018, 03:23 PM)lobo Wrote: Multiple synchronized PWM outputs with phase shifting are planned in pwm module, but I've never had enough free time to finish it.
When finished, you should be able to use it for your project without any external hardware (related to phase shifting).

Up to 8 PWM channels can be used that way.

I don't know why my reply's isn't showing up, I've had several reply's from the start of this thread asking if there's any updates since this thread started!! maybe I'm clicking the wrong place??
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)