-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>> Hi all, >> >> I'm setting up a machine with a Mesa 5i20 driving 3 DC servos via >> homemade PWM/DIR amps. >> I've got a couple of very nice ServoDisc DC servos (0-3000rpm within 60 >> degrees of rotation!). I also want to get another I've seen with a 120:1 >> harmonic drive for a future rotational axis. >> >> Question is this: >> >> To cut down on the ridiculous size of the output inductors I'll need for >> the ServoDisc amps Id like to use at least 40khz PWM, but I've also got >> an ESA 6F2 (3000rpm 120V 3.5Nm @9A - 17.5Nm @45A) which Id like to drive >> using 2 of 3 half bridges from an integrated gatedriver IGBT module >> which only goes up to 20khz PWM. >> Can I have 40khz or more on 1 or 2 pwmgens and 20khz on another 2? >> >> I know bugger all about FPGAs, VHDL etc so making a custom firmware isn't >> an option, just learning Linux and moving from TTL and PICs to power >> electronics has opened up a big enough can of whoop ass on me for now. >> >> JHC > > > Its possible but not straightforward... > > All HostMot2 PWM channels share a common reference counter. > The reference counter count rate is set by the PWM frequency parameter for > all > PWM generators. However each individual PWM generator has a resolution setting > that allows selection of 9,10,11, or 12 bit PWM resolution. > > So for example you could set the PWM frequency to 20 KHz (the driver will then > select 12 bit resolution for all PWM generators since it selects the best > resolution it can achieve at the chosen PWM rate and 12 bits is possible at > 20 KHz and the 5I20s 100 MHz clock-high rate) > > You could than use the raw-write facility in the driver to overwrite the > PWM mode register for the 40 KHz channels to select 11 bit resolution instead. > This will double the output frequency (you could use up to 8X (160 KHz) > if needed by choosing 9 bits resolution) > > Once this is done you would have to restrict the PWM setting of the high > frequency channels in HAL to 1/2 their normal range or the PWM would "wrap" > since the driver doesn't know that the PWM resolution has changed. This can > be > done by setting the PID comps max output parameter. > > Here is the (per channel) register that needs to be changed: (from the regmap > file) > > PWM mode registers 6 bits > > Bit 1,0 = width select (With FPGA compile time constant PWM width = 13) > 00 = 9 bit PWM > 01 = 10 bit PWM > 10 = 11 bit PWM > 11 = 12 bit PWM > > Bit 2 = PWM mode select > 0 = Straight (Sawtooth) PWM > 1 = Symmetrical (Triangle) PWM > > Bit 4,3 = PWM output mode select > 00 = Normal Sign Magnitude PWM&DIR outputs normal > 01 = Normal Sign Magnitude PWM&DIR outputs swapped (for locked antiphase) > 10 = Up/down mode > 11 = PDM mode (12 bits) > > Bit 5 = Double Buffered mode > When bit 5 is set, the PWMval register is not updated until the beginning of > a > PWM cycle, avoiding extra transitions in the output PWM waveform. This adds > an extra delay of 0 to PWMWidth/PWMClock (normal mode) or PWMWidth*2/PWMClock > (Symmetrical mode) between when the host writes the PWMVal register and the > PWM output is updated. This mode should be used with HBridges. > > These registers are at 0x410X in the FPGA memory space (X= 0,4,8, etc for PWM > 0,1,2 etc) > so to set the PWM resolution to 11, you would write 0x00000022 to 0x410X (11 > bit resolution and buffered mode) > > This can be done with raw-write in hal: > > setp hm2_5i20.0.raw.write_address 0x4100 > setp hm2_5i20.0.raw.write_data 0x00000022 > setp hm2_5i20.0.raw.write_strobe true > > (and duplicated for the other channels that need 2x PWM rates) > Now that's exactly the sort of thing I needed, thanks very much, its decent of you to have taken the time. Consider yourself at the top of my christmas card list. My main alternative strategy was to make a L.Glaister style dsPIC step/dir servo drive and hack the source a bit to double the PWM freq, then drive it from one of the 5i20 stepgens. I'm going to use the SVST8_4IM2 firmware. I'm still in larval mode with regard to HAL etc so I'm going to run PNCconf, root through its output files, and have a fiddle. I've just got my dual channel scope running again so I'll be able to probe the PWM outputs and make sure I've got those raw-write lines in the right place. I assume the memory pokes are non persistent, if I mess up I can remove anything I've added then do a powerdown & restart of the machine and it should clear what I've done? Thanks again for your time, JHC -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTf048AAoJEDzttOCNrFucibEH/3gmZdfPxJSjtX47aS+m6Ui+ QEwAZDKARYdyb13Vk0E9biRm54ciuFVpbLwBO7G+kN55Jqess9XQZGqfA0FOFFbO 2jZTYfo1duQMfxZLnzOptByir2AdA2oT0LlZkmSfkM9qkjNJVizI/IM5gzQzxHmV NX0VXiPhNZRSOH+kWFgOEFF13qleK67iNcUvnpKRGPjuHpQnzAW5YE2qxCGMesX5 qqBvRC7aM0+zY3GxL31XC/rr1nsWm2Yj76xLFHFXGZDF1mrjV7plFZQ7ogRZHKRU YJOUXDUxeyN+T19VcVe/ElIDbgefAuojSvgdNC3zrgaXWOhnbKVnB5GC1adx9C8= =OfbJ -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users