On Monday 13 August 2018 21:52:44 jeremy youngs wrote:

> I loadrt hostmot2
>
> And 7i90 at the top so it can find the 7i90 pins ( it was failing to
> do that )
> Now it gives this , I'm close , I can feel it , but I'm also ignorant
> ant trying , lol. Sometimes that's all a steer can do to .
>   terminal qi.jpg
> <https://drive.google.com/file/d/1Uedha2IahFssFjNX4puq-4pwywhzhsx5/vie
>w?usp=drivesdk>
>
>   qi.hal.jpg
> <https://drive.google.com/file/d/1ejuDkTJCzWbZW20hCyowJlSWPdF82KGV/vie
>w?usp=drivesdk>
>
You've not set a value for "scale" in line 15.

This is often done by setting it in the .ini file, which you can reuse 
once per axis and referencing it in the hal file like this, which 
turning into a how-to:

setp hm2_[HOSTMOT2](BOARD).0.stepgen.03.position-scale  [JOINT_0]SCALE

Where HOSTMOT2 and BOARD are also obtained from the bottom (usually) of 
the ini file.

Mine for that looks like this at the end of the .ini file:

[HOSTMOT2]
DRIVER            =       hm2_rpspi
BOARD             =       7i90
CONFIG            =       "num_encoders=4 num_pwmgens=1 num_stepgens=4"

But that [HOSTMOT2] could be anyplace in the ini file as long as another 
[name] terminated that stanza.

And using the same lookup mechanism; Where [JOINT_0] is the JOINT_# 
stanza in the ini file, then it will search down that list for SCALE = 
and use that value. So you can have multiple SCALE's, one per [JOINT_#]

In my case that scale line in the ini under the [JOINT_0] is:
# scale is 200 steps/rev * 5 revs/inch times driver microstepping,
Which IIRC is 8. and its a 1/2 belt drive reduction from motor to a teeny 
ballscrew for X, 8mm or so, actually derived from fine tuning it with a 
dial indicator.
SCALE            =       25685.0000

16 or 32 would move smoother, but then the rapids would exceed the motor 
drivers's opto input speeds. The opto's are usable to about 200 
kilohertz. Besides, thats equ to .0000389332295114 inch per step, "good 
enough for the girls I go with" :)

2 of those 4 encoders are reading the hand dials on the apron, and 4 
stepgens is because that 7i90 has blown gates and 2 of them don't work.
 
This is more than just fixing your instant problem, but also a how-to. I 
hope its not confusing the issue. You will also need a lengthy stanza of 
addf's in order to install these logic bits and pieces you've loadrt'd 
into the threads execution loop.  The addf's should be in the order of 
the signal as its processed, so that a fully processed signal read at 
the top arrives at the cards write line in one thread execution. Mix 
them up and the latency's will eat your lunch.

That addf chain starts like this:
addf    hm2_[HOSTMOT2](BOARD).0.read    servo-thread
addf    wd-bite-reset                   servo-thread
addf    watchdog-reset                  servo-thread
everything else goes in here, and this is last:
addf    hm2_[HOSTMOT2](BOARD).0.write   servo-thread

Then the first setp or net statements.  Keeps the .hal file a little 
neater. :) The order of addf's is the important detail.

-- 
Cheers & thanks for fixing google, 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

Reply via email to