I'm Stil not understanding. Gene's math is still not clear. Is the encoder on the motor or the spindle? If the goal is to do threading it must be on the spindle or the index pulse is not going to work.
If on the motor then what is the gear ratio? The trick is to convert FIRST to revolutions per second. Some tricks: If the goal is only to control the motor speed and not the angle of the spindle then you don't need to look at all the encoder data. First off you KNOW the direction of rotation so you can ignore the entire idea of "quadrature" Just look at one channel, say "A" Next trick. If you only care about speed and the encoder data is moving to fast, the first rick is t look only at the rising edge of one phase. Now you just count "ticks" If even these ticks come to fast then use the divide by two hardware device, like a JK flipflop. All that said. The low-end $2 ARM micro controller has build in hardware quadrature decoding that handles this entire problem with ZERO use of the CPU. All the phase tracking and counting is don't with hardware logic. And it works for signals at the MHz level. So if yu really do have a requirement torun serval encoders at a million lines per second the solution is not expensive. Advice however is to design it so the MHz speed signal travels less then an inch, another words no cable, use PCB traces. I've got some motors here on my desk that spin at 11,000 RPM and I'm using s $3 computer board to control speed. No FPGA required. On Thu, Nov 30, 2017 at 10:29 AM, Gene Heskett <[email protected]> wrote: > On Thursday 30 November 2017 10:27:39 andy pugh wrote: > > > On 30 November 2017 at 14:13, Gene Heskett <[email protected]> > wrote: > > > Yes, and its math I should have explored, but I had no clue that > > > there was that big a geardown in the head, even in high gear, before > > > I ordered that 1000 line encoder. That says the motor, running wide > > > open, is turning about 20 k rpms. > > > > There is something very wrong with your maths still, I think. > > > > Your 7000:1 gear ratio is simply wrong. I think you divided > > revolutions by counts (I recall you saying that encoder resolution > > didn't matter, but you were using rawcounts, so it most certainly > > does). > > So, a 1000:1 error there. (There isn't _room_ in the head for a 7000:1 > > gear ratio) > > > > Also, you keep confusing RPM and Revs Per Second. > That too, but I have a new problem now, and need an answer to 2 > questions. > > 1. is the feedback signal in phase or out of phase with the command? > 2. and this is for Jon. > > I have a fixed gain scale setting that prevents the pwm from exceeding a > 98% duty cycle. The pwmgen is running at 20 kilkohertz, and when the pid > is outputting 46 something it is up against this limit, with a 1.06 > u-sec recharge time. The data that you get from the Pico site says half > a microsecond is needed to recharge the gate drivers. So this should be > enough. The 12 volts is nominally 11.6. > > BUT, its sitting out there right now at that minimum of 1.06 microsecnds > off time, with the spindle turning about .8 rps. It ought to be at 3 > grand. > > Clicking fwd, no reaction, add a + button click and it hits that 3 grand > in about 1/2 a second. 30 seconds later it starts to slow, and in > another minute its down to about .8 rps and running steadily. Motor is > seeing a noisy 2 volts, and it has almost zero torque. > > While this is "percolating", I'm going to reduce that scale, wideing the > off time to see what effect it might have. > > 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users > -- Chris Albertson Redondo Beach, California ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
