> > > > On Mon, 13 Jan 2020 at 05:18, John Dammeyer <jo...@autoartisans.com> > wrote: > > > I have LinuxCNC with the parallel port configured to create 1kHz on PIN14 > and DIR on PIN16 out through the PMDX-126. Through my adaptor board I > can run the Bergerda AC Servo from 135 RPM all the way up to 2950 RPM. > The PWM to 0V-10V board was only $11.23 Cdn and works best with a max of > 1kHz. Any higher and the low end won't drop below about 500 RPM. > [/quote] > > I think that you will have trouble with a 1kHz servo thread and a 1kHz PWM. > > > That doesn't work for > > setp hm2_7i92.0.pwmgen.00.pwm-freq 1000.0 > > > > How do I set the PWM frequency? Googling hm2_7i92 doesn't turn up > anything that is helpful. > > >The generic docs for Mesa card HAL is here: > >http://linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html#pwmgen > >But to find that you do need to know that the Mesa firmware is called > >Hostmot2, and that the docs section exists. > > > >It should be setp hm2_7i92.0.pwmgen.00.pwm-frequency 1000.0 > > > >-- > >atp > > You dont need to guess about pin and parameter names. > With LinuxCNC running type: > > halcmd show pin hm* > to show all Hostmot2 hardware pins > > and > halcmd show param hm2* > to show all Hostmot2 hardware parameters > > To create a list of all pins, parameters, and signals as a copy-paste donor > file: > > halcmd show all > linuxcnc-names.txt > Peter Wallace > Mesa Electronics
OK. So the documentation at http://linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html#pwmgen is incorrect and also a little on the ambiguous level. "pwmgens have names like "hm2_<BoardType>.<BoardNum>.pwmgen.<Instance>". "Instance" is a two-digit number that corresponds to the HostMot2 pwmgen instance number. There are ’num_pwmgens’ instances, starting with 00. So, for example, the HAL pin that enables output from the fourth pwmgen of the first 7i43 board is: hm2_7i43.0.pwmgen.03.enable (this assumes that the firmware in that board is configured so that this HAL object is available)" The command halcmd show pin hm* Isn't any better than looking at the HAL Meter pins list which I did. Using the halcmd show all > linuxcnc-names.txt and searching for all instances of pwm shows it's a parameter. Not a pin. Then using the HAL meter under parameters both the pdm and pwm frequency parameters show up so it's back to if you don't know you don’t know what to look for circle. And it turns out it's _not_ as Andy suggested setp hm2_7i92.0.pwmgen.00.pwm-frequency 1000 but instead it's setp hm2_7i92.0.pwmgen.pwm_frequency 1000 And there's another example of where the documentation sends people in the wrong direction. So I'd like to formally request that whoever is responsible fix the documentation and /or the program. It's absolutely nuts to have a variable named (s32 rw) output−type And then another one named (u32 rw) pwm_frequency Consistency in using either the '-' or '_' is important. And I prefer the '_' simply because it doesn't overload the concept that the '-' is also used for the subtraction symbol. Second, the hm_7i92 probably doesn't have the internal infrastructure to support more than one PWM frequency which is perhaps why there is no '.00' as part of the pin description. That too should then be in the documentation. Maybe not the Linuxcnc.org doc but then certainly in the manufacturer 7i92 documentation. Or maybe just, as an idea, even if there is only one PWM frequency generator then '.00' should still work but '.01' etc. would fail. That makes everything consistent again. Perhaps whoever is in the know can pass this information on to whoever is responsible for the documents and/or the software. Both the document (naming) and the driver code (.00 and output_type instead of output-type) would be better if changed in that manner. What does work giving me, using pwm, 165 RPM to 2950 RPM with the little pwm to voltage module is: setp hm2_7i92.0.pwmgen.pwm_frequency 1000 Thank you for the support. John Dammeyer _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users