On Sunday 01 January 2017 23:39:21 Cecil Thomas wrote: > I am running a cnc'd jet 9x20 lathe with a treadmill motor and dc > motor controller with a 5k pot for speed control in manual. > > I previously was running the speed controlled from LCNC from the > parport to an opto interupter for isolation from the motor > controller which worked fine. > > I was running Gecko 320's with direct connection to the parport cable > (no breakout board). Everything worked as advertised but a little > slow due to latency issues. I recently upgraded to mesa 5i25/7i78 and > have worked out all the problems (mostly created by myself). > ...Except for one: > > I am using the 7i78's isolated pwm to analog output for speed control > and it works as advertised as well which means that the "wiper" > voltage on pin 17 starts out at 10 volts when the speed command is 0 > rpm and goes down to 0 volts when the speed command is at max. > I know that the 7i78 manual warns that this will be the case and that > the "pwm must be inverted" if I need the analog out to follow the > speed command directly instead of inversely. > > Problem is that I can't figure out where or how to "invert the > PWM". The only signal I seem to be able to access in hal is floating > point rpm 0 to max (my max is 1200 rpm). So when I invert the signal > the result is the mathmatical reciprocal of 1 to 1200 > or 1 to .00083333. Of course when this gets to the motor controller > the resulting output is 0 speed at all demands. > > How and where do I 'invert the pwm'
I think, (Hi Cecil) that you should treat the 5i25's pwm output pin as if it was a gpio, and set it to "is-inverted". That should turn the output upside down and do what you need. That does seem odd though. And I am assuming the pwm itself is generated in the 5i25. I would be inclined to replace that 7i78's d/a with a SpinX1, which is what I have 2 of in my systems now, one in the lathe you helped load last summer, running a vfd and a 1hp 3phase I bought a pair of from a local recycler, and the 7x12 has a 1 hp treadmill motor being controlled by one of the Pico systems pwm-servo's. At risk of being a bit picky to set up, another way is to also use a sum2, with input 0 set at 10 with a gain of 1, and input 1's gain (scale?) at -1, feeding its input with the 0-10 signal from the PID. Feed the resultant 10 to 0 signal to the 5i25. But I'd druther just tell that gpio pin to invert the waveform. Thats just an extra setp in the hal file. Have a better 2017 Cecil. > Thanks, > Cecil > > > ---------------------------------------------------------------------- >-------- Check out the vibrant tech community on one of the world's > most engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users