On Sunday 12 November 2017 05:12:54 andy pugh wrote: > On 12 November 2017 at 01:49, Gene Heskett <[email protected]> wrote: > > If I write a hal thing that changes the value pushed into the > > encoder's scale input, how much of a time lag might there be to make > > it effective? > > The scaling does not happen in the Mesa layer, it happens in the HAL > driver. > I had assumed it was in the fpga. My bad.
> But, the encoder scale is a parameter, not a pin, so you can't change > it in HAL. Ooops, best laid plans, etc. > What I would do would be to pass the hm2_..._position and > hm2..._...velocity through a pair of "scale" HAL functions with the > scaling factor for both chosen by a "mux2" controlled by the gear > selection before connecting to the motion... pins. If the parameter is changed for a 1.0 scale at boot time, then the other scale is the gear ratio's, right? But I'd better use the mux4's so the illegal combo's are skipped as they are now, in fact I've put an offset on inputs 0 and 3 of the selector mux4 that actually runs the motor at about 40 rpm as it makes the gear shifting instant and effortless, no grabbing the stopped spindle to get the gears to mesh. And I've disabled the pid that is unselected to get rid of the windup. Works very well indeed even if the spindle is running at high speed, Jons driver pulls it down to creep in a few milliseconds, the gear change is effortless and the spindle winds back up to full speed as the other switch finally closes long after the new gear is solidly engaged. > You might be able to use the "gearchange" component for this (or, > specifically, two more instances of the component) as this is > basically what it does, ie switch between two scales. Or between straight thru and the gearchange(or scaled) version. addf order sensitive I assume? Thanks for the heads up Andy. But I'll not do anything until the encoder arrives, could be into December according to the shipping notice. I'll have to make an extension shaft to drive the encoder, to be fitted to the back of the motor, whose shaft ends at the top of its rear ball bearing. I'll run the motor backwards to drill the hole, first with a center drill to get a bigger socket, then tap it for a 3mm bolt that runs down the center bore of the extension shaft. I want the encoder in hand before I make the shaft extension. And a flimsy mounting bracket so the encoders bearings aren't taking a beating from gross mis-alignment. Cheers Andy, 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
