Il giorno giovedì 13 settembre 2018 10:52:53 UTC+2, Schooner ha scritto: > > > On 11/09/18 22:58, mngr wrote: > > Hi, > > I have to declare some new HAL modules, which is the best way to do it? > > First one: when a security switch gets pressed I have to pause the > printing and override actual temperature and position (move up of a cm), > before resuming printing I need to wait for the temperature to be on point. > My idea: defining a new "pause" button, outside of axis, and show it in a > glade panel. this module will know the switch state and pause axis, and > know temperature so it will resume axis only when it is possible. > I looked in the guide, I guess I should do it in icomp, is it suited? or > is there a better way? > > > I have just included a 'watch' instantiated component into machinekit, > along with a demo sim > > > https://github.com/machinekit/machinekit/blob/master/src/hal/user_icomps/watch.c > > https://github.com/machinekit/machinekit/tree/master/configs/sim/axis/watch-demo-sim > > You may find it of use, in itself or as a guide, as I wrote it to get over > the problem of monitoring a pin value without constantly calling halcmd and > trying to parse the output. > (which is what M109 in FDM does) > > The sim demo shows how to use it in a dummy FDM printer heater scenario, > setting a pin or signal to the target value (eg. heater component) > monitoring a pin value and setting an output pin and triggering a message > in a pyvcp panel when it reaches a target value. > > Thanks! Will look on that!
> > Second one: this is more like a driver, I have to take the commanded > position from axis, do some stepgen-magic things and send the velocity to > the stepper controller via spi. (the point is sending something via spi, > from a raspberry) > What should I use to write this? > Here ( > https://forum.linuxcnc.org/27-driver-boards/29742-pidicnc-control-system?start=50#115691) > > I have something very similar to what I want to do,after line 2300 ( > https://github.com/mngr0/stepgenspi/blob/master/pidi.c#L2306) there is > the code to write directly on the registers for spi (code made for the > raspberry). > I guess that lot of common libraries for rpi-spi cannot work in real-time > environment, what can be a clean way to implement that? > > > I'll leave bit twiddling on a Pi to someone else to answer :) > I have found a hal module called hal_spi.h <https://github.com/machinekit/machinekit/blob/master/src/hal/drivers/hal_spi.h>, I am hoping it works, cause it is maybe exactly what I need > > > by the way, in the guide > http://www.machinekit.io/docs/developing/writing-components/ there is a > dead link at "Further info here > <http://www.machinekit.io/docs/hal/new-instantiated-components>" > > > Looks like an old doc ref, I'll check later > > Probably see > http://www.machinekit.io/docs/hal/instcomp_writing_a_component > for a tutorial I wrote regards instcomp specifically > > mngr > -- > website: http://www.machinekit.io blog: http://blog.machinekit.io github: > https://github.com/machinekit > --- > You received this message because you are subscribed to the Google Groups > "Machinekit" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > Visit this group at https://groups.google.com/group/machinekit. > For more options, visit https://groups.google.com/d/optout. > > > -- website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit --- You received this message because you are subscribed to the Google Groups "Machinekit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/machinekit. For more options, visit https://groups.google.com/d/optout.
