Dynomotion

Group: DynoMotion Message: 451 From: Ross Ferguson Date: 6/15/2010
Subject: Re: Handwheel connecting
Tom,
I thought I meant -
On the four position switch -
#30 enabled then X1 is selected
#31 enabled then X10 is selected
#32 enabled then X100 is selected
With none of the above enabled (switch in off position) then the
encoders are disabled.
But if that is not what I would achieve then let's just leave it :)
It is working very well, with the code you edited, and it may be best to
let sleeping dogs lie.

Ross

On 16/06/2010 2:29 p.m., Tom Kerekes wrote:
> Ross,
> Sorry don't follow that. Maybe you meant:
>
> if (ReadBit(30)) // Are we disabled?
> Factor = 0.0;
> else if (ReadBit(31)) // is X10 selected?
> Factor = 10.0;
> else if (ReadBit(32)) // is X100 selected
> Factor = 75.0;
>
> TK
>
> ------------------------------------------------------------------------
> *From:* fermanz <ferman@...>
> *To:* DynoMotion@yahoogroups.com
> *Sent:* Tue, June 15, 2010 6:31:49 PM
> *Subject:* [DynoMotion] Re: Handwheel connecting - formerly Collision
> or not?
>
> Hi Tom,
> The updated Init file worked perfectly, although I did have to include
> the ! - thus
> if (!ReadBit(30))
> {
> // this is only executed if handwheels are enabled
> // bit #30 is disabled
>
> However, upon reflection, and as we have wires to spare, could we not
> have done this -
>
> // Read Speed Selector
>
> if (ReadBit(30)) // is X1 selected?
> Factor = 1.0;
> else if (ReadBit(31)) // is X10 selected?
> Factor = 10.0;
> else if (ReadBit(32)) // is X100 selected
> Factor = 75.0;
>
>
>
> ch0->Dest += Change1 * Factor;
> ch1->Dest += Change1_2 * Factor;
>
> In the off position nothing is connected/enabled.
> Any problems with that?
>
> Ross
>
> --- In DynoMotion@yahoogroups.com
> <mailto:DynoMotion%40yahoogroups.com>, "fermanz" <ferman@...> wrote:
> >
> > I hope I never get tired of saying you were right again Tom!
> > The outputs did glitch - but at least we now have the handwheels
> working, although not able to disable them.
> > We have reset the off position to enable bit#30 and I have tried the
> "if" statement but clearly I have not got it right as we are still
> getting movement as if the switch is on the X10 position, which we
> don't have connected at all - as your clever C file setup requires
> > We are also getting a Dynomotion status message, in Mach3, saying
> that the Z axis is disabled.
> > I have attached the Hankook Init.c file for your perusal so that you
> can give me another lesson in c, hopefully :)
> > Ross
> >
> > --- In DynoMotion@yahoogroups.com
> <mailto:DynoMotion%40yahoogroups.com>, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ross,
> > >
> > > I'm not sure I understand what you mean by "cut the 5V". Turning
> off the power to the encoders probably isn't a good idea as that is
> likely to cause the A/B outputs to glitch during power down.
> > >
> > > Better to just run the enable switch into an input and use that
> input as an "if" condition to allow the destinations to be changed.Â
> The format for an "if" statement to skip stuff based on an input bit is:
> > >
> > >
> > > if (ReadBit(xx))
> > > {
> > > Â Â Â // this is only executed if bit xx is 1
> > > }
> > >
> > > TK
> > >
> > >
> > > Â
> > >
> > > ________________________________
> > > From: fermanz <ferman@>
> > > To: DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>
> > > Sent: Mon, June 14, 2010 2:41:32 PM
> > > Subject: [DynoMotion] Re: Handwheel connecting - formerly
> Collision or not?
> > >
> > > Â
> > > Thanks Tom,
> > > We are going to use a four way switch for the speed control and
> cut the 5V to disable the encoders in the switch "Off" position.
> > >
> > > Correct on the second point with axes 0 and 1.
> > >
> > > You may have to clarify the implementation of the "if" condition :)
> > > I can figure that you mean just around the section of code,
> relating to the handwheels, in the init.c file.
> > > Just give me an example of the "if" format please.
> > >
> > > I am a proponent of the "give it a go" philosophy so let's try it
> and find out what happens.
> > >
> > > Ross
> > >
> > > --- In DynoMotion@yahoogroups.com
> <mailto:DynoMotion%40yahoogroups.com>, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ross,
> > > >
> > > > Yes the code to do the speed selection is left in. You can
> delete it (and set a fixed speed Factor) if you don't have a speed switch.
> > > >
> > > > Yes the two hand wheels are fixed to axis0 and axis1. I
> assume that is what you want.
> > > >
> > > > No - there is no enable switch, but disabling the handwheels
> would be easy. Just put a "if" condition around the whole block of
> code. But I'm not sure how to disable Mach3's keyboard. It
> seems to me unlikely that an operator would type something while
> turning the handwheels. But I do think it would be possible for
> someone to bump a handwheel while GCode is running. I think this
> might be protected already because a motion trajectory controlling the
> commanded destination will overwrite any changes a User program tries
> to make to the commanded destinations.
> > > >
> > > > Another approach would be to use the Mach3 Offline mode to
> enable the handwheels. Does that sound like a good idea?
> > > >
> > > > But let's get it all working first, then we can work on the more
> subtle details.ÂÂ
> > > >
> > > > TK
> > > >
> > > > ÂÂ
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: fermanz <ferman@>
> > > > To: DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>
> > > > Sent: Sun, June 13, 2010 12:48:12 PM
> > > > Subject: [DynoMotion] Re: Collision or not?
> > > >
> > > > ÂÂ
> > > > Thanks Tom,
> > > > I knew there would be some simple parts to the answer :)
> > > > I see that we retain the speed selection of x, x10, and x100.
> > > > I take it we no longer select an axis?
> > > > And we enable both handwheels with one on/off switch.
> > > > Is there something in the code that disables all other inputs,
> such as keyboard, or MDI, etc. as soon as the handwheels are enabled?
> > > >
> > > > Ross
> > > >
> > > > P.S. I can't find the Init3AnalogPlusTwoMPGs.c file attached,
> although I can just copy and paste it from here.
> > > >
> > > > --- In DynoMotion@yahoogroups.com
> <mailto:DynoMotion%40yahoogroups.com>, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ross/Bengt
> > > > >
> > > > > Regarding PoKeys: Yes as far as I know it should work with
> KFlop and/or in parallel with some other MPG as it basically issues
> commands to Mach3, so from KFlop's standpoint it is no different then
> pushing buttons directly on the screen to cause movement and
> events. I think both can be "active" at the same time (use
> one then
> > > >
> > > > <<<<clipped>>>>>
> > > > >
> > > >
> > >
> >
>
>

--
Ferguson Windmills Company,
www.windmills.co.nz
Ph. 64 9 412 8655
027 282 7689