John Figie wrote:
> Hi,  I think I am real close to getting this to work but...
> 
> I am having 2 problems with emc2, I don't know if they are related but I 
> suspect that they are:
> 
> 1) I have created a test.hal file that I have been using without emc2 so that 
> I can test my I/O, run servos open loop, and tune my PID gains.  This file 
> runs fine except the first time I run it after a cold boot of the computer.  
> After a cold boot and loading the file into hal using "halrun -I -f test.hal" 
> the watchdog.has.bit always starts as TRUE and the I/O does not work.  If I 
> exit hal and then rerun the command everything is fine and I can control the 
> I/O. Or, if I don't exit and just reset the bit in hal then everything is 
> fine from that point on until I turn off  the computer.
> 
> 2) I have made a m5i20.ini file for my machine and another hal file made from 
> test.hal so that I can run emc2.  When I start emc2 using m5i20.ini the 
> initialization seems to load the stuff in the hal file without errors but 
> then has problems starting.  I get an error:
>  "Invalid configuration of axes is preventing emc from starting"
>  
>  Looking at the dmesg output I see something about the watchdog.bit that 
> Doesn't look good:
>  [11773.532552] hm2_5i20.0: initialized AnyIO board at 0000:00:09.0
> [11774.744518] hm2/hm2_5i20.0: Watchdog has bit! (set the .has-bit pin to 
> False to resume)
> [11893.995647] hm2/hm2_5i20.0: trying to recover from IO error or Watchdog 
> bite
> [11893.995653] hm2/hm2_5i20.0: error recover successful!
> [11942.947460] hm2_5i20.0: dropping AnyIO board at 0000:00:09.0
> [11942.947468] hm2/hm2_5i20.0: unregistered
> 
> I have tried a number of things to fix this but have been unsuccessful.
> 
> Part of my problem may be that I don't really completely understand what goes 
> on in hal.  When I "addf hm2_5i20.0.pet_watchdog servo-thread" when does this 
> actually start running periodically?  I am assuming after the "start" in hal, 
> but even though I "setp hm2_5i20.0.watchdog.has_bit FALSE" just before the 
> start, it still doesn't seem to work correctly.
> 
> I have placed the m5i20.ini at http://pastebin.ca/1546296
> bridgeportS2I2.hal + dmesg output is http://www.pastebin.ca/1546441

Here's how the hostmot2 watchdog currently works.  When the hm2_pci 
driver is first loaded, the card and firmware are reset to a sane 
starting state, the watchdog timeout is initialized to 1 second, and the 
watchdog timer starts ticking.  If the pet-watchdog function is not run 
before the timer expires, the watchdog bites.  The only way that the 
pet-watchdog function can run is if you add it to a thread (with "addf") 
and start the threads running (with "start").

In your bridgeport hal file, you load the hm2_pci driver (which starts 
the watchdog timer).  You add the pet-watchdog function to the servo 
thread, but you dont start it running.  You then load a bunch of other 
stuff, including slow userspace things, and down at the bottom there's a 
commented-out "start".

With that hal file i'd expect a watchdog bite every time.  I assume you 
manually run start after loading that HAL file, and then manually clear 
the bite.  I dont see how you could ever not get a watchdog bite right 
away with that setup (and the current driver).

If you dont comment out the start in bridgeport.hal, i bet it'll work 
better.  Unless the userspace things are so slow that it takes more than 
a second to get from the loadrt "hm2_pci" to the "start".  In which case 
you might run "start" first, then load the other things.


It might be nice if the driver didnt set the watchdog timer until the 
realtime subsystem was started...  And then set it to something nice and 
short, like a small multiple of the servo period.


-- 
Sebastian Kuzminsky
any sufficiently analyzed magic is indistinguishable from science

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to