Re: [Emc-users] Changing the scale factor of an axis

2012-01-20 Thread Lars Andersson
This is how I did it. 

## Before with position mode stepgen
#net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
#net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb

## Velocity mode stepgen
net apos-cmd axis.3.motor-pos-cmd => ddt.0.in
net apos-cmd axis.3.motor-pos-fb
net avel-cmd ddt.0.out => mult2.0.in1
net fillrate input.0.abs-rx-position => mult2.0.in0
net scaled-avel mult2.0.out => stepgen.3.velocity-cmd

"input.0.abs-rx-position" is scaled to the interval 0.5 -- 1.5

Andy, if I understand you correctly there is already an "
axis.3.joint-vel-cmd " so there is no need for the ddt step. I will try
that.

// Lars


> -Original Message-
> From: andy pugh [mailto:bodge...@gmail.com]
> Sent: den 19 januari 2012 22:04
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Changing the scale factor of an axis
> 
> On 19 January 2012 20:43, Lars Andersson 
> wrote:
> 
> > I think I will try to change the A-axis to velocity mode and put a
> HAL
> > component in series that takes the derivative of commanded position
> 
> That might not be necessary, you can probably use the existing axis
> velocity pin.
> (axis.3.join-vel-cmd) connected to a velocity-mode stepgen.
> You need to
> net fb-shortcircuit axis.3.motor-pos-cmd axis.3.motor-pos-fb
> To stop it complaining about following errors, I suspect.
> 
> --
> atp
> The idea that there is no such thing as objective truth is, quite
> simply, wrong.
> 
> ---
> ---
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-19 Thread andy pugh
On 19 January 2012 20:43, Lars Andersson  wrote:

> I think I will try to change the A-axis to velocity mode and put a HAL
> component in series that takes the derivative of commanded position

That might not be necessary, you can probably use the existing axis
velocity pin.
(axis.3.join-vel-cmd) connected to a velocity-mode stepgen.
You need to
net fb-shortcircuit axis.3.motor-pos-cmd axis.3.motor-pos-fb
To stop it complaining about following errors, I suspect.

-- 
atp
The idea that there is no such thing as objective truth is, quite simply, wrong.

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-19 Thread Lars Andersson
Thank you all for considering my problem. It made the situation clearer for
me.
I already have feed override from a pot in place. This changes extrusion
rate proportional to x-y travel so it does not affect the "fill factor"

I think I will try to change the A-axis to velocity mode and put a HAL
component in series that takes the derivative of commanded position and
multiplies it with a controllable scale factor, this vill be velocity
command for A. 

// Lars

> -Original Message-
> From: Karl Cunningham [mailto:ka...@keckec.com]
> Sent: den 19 januari 2012 06:15
> To: emc-users@lists.sourceforge.net
> Subject: Re: [Emc-users] Changing the scale factor of an axis
> 
> On 01/18/2012 12:41 PM, Lars Andersson wrote:
> > This immediately gives a "joint 3 following error" even for a very
> small
> > change.
> >
> > Can I work around this?
> 
> The problem appears to be, as someone pointed out, that changing the
> scale factor also causes a step in the output due to a multiplying the
> (possibly large) position by a different scale.
> 
> One answer would be to create a real-time hal component, into which you
> would feed the position and the desired scale factor. I'd have to think
> about this to be sure but this is probably close: when the scale factor
> changes, the component would (from then on) subtract from the output
> the
> value of
> -current_output * (new_scale_factor - old_scale_factor)
> so there is never a step in the output when changing scale.
> 
> Karl
> 
> ---
> ---
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-18 Thread Karl Cunningham
On 01/18/2012 12:41 PM, Lars Andersson wrote:
> This immediately gives a "joint 3 following error" even for a very small
> change.
>
> Can I work around this?

The problem appears to be, as someone pointed out, that changing the 
scale factor also causes a step in the output due to a multiplying the 
(possibly large) position by a different scale.

One answer would be to create a real-time hal component, into which you 
would feed the position and the desired scale factor. I'd have to think 
about this to be sure but this is probably close: when the scale factor 
changes, the component would (from then on) subtract from the output the 
value of
-current_output * (new_scale_factor - old_scale_factor)
so there is never a step in the output when changing scale.

Karl

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-18 Thread andy pugh
On 18 January 2012 20:41, Lars Andersson  wrote:

> This is not allowed, "stepgen.3.position-scale" is a parameter, not a pin

You could put a "scale" component between the axis and the stepgen.
I think, though, that you might have more luck putting the A stepgen
into velocity mode, and linking to A-velocity.

f-error makes no sense on this "axis" so just short-circuit the
pos-comd to the pos-fb.

-- 
atp
The idea that there is no such thing as objective truth is, quite simply, wrong.

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-18 Thread John Thornton
Lars,

Take a look at the THC comp to see how I hijacked the position commanded 
for Z and lied about the position feedback.

John

On 1/18/2012 2:53 PM, Ben Jackson wrote:
> On Wed, Jan 18, 2012 at 09:41:12PM +0100, Lars Andersson wrote:
>> I try manually while running:
>>
>> setp stepgen.3.position-scale  210   (it was was 200 before)
>>
>> This immediately gives a "joint 3 following error" even for a very small
>> change.
> That's because the absolute position of A just moved by a lot.  Let's
> say you've extruded for 1000 A units.  The motor is at 1000*200.  When
> you change the scale it suddenly wants to be at 1000*210.  If you didn't
> get the following error you would have instead gotten 1 stepper units
> of extrusion instantly to "catch up".
>
>> Can I work around this?
> You could put a gasket between the axis and stepgen to cancel out the
> error.  I'm not sure how tricky that would be in practice.
>

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-18 Thread Sebastian Kuzminsky
I think as long as you're modeling your extruder as an axis, you can't change 
it's speed without also changing the speed of all the other axes (by using the 
feed override knob on the motion controller).

Also, as long as your extruder's position is controlled by the motion 
controller, you won't be able to change its scale factor without causing a 
following error.

You might be able to short-circuit the motion controller's notion of the A axis 
by netting the motor-pos-cmd back in to motor-pos-fb, then eavesdrop on what 
the G-code says the extruder should be doing by connecting the motor-pos-cmd 
net to some more hal circuitry.  For example, you could run it into a ddt 
component (to get the g-code's commanded extruder speed), run that into a scale 
component, and finally run the output of scale to your extruder's stepgen's 
velocity command input.  Then by tweaking the scale.gain pin you would tweak 
the actual extrusion rate.

It might work!


On Jan 18, 2012, at 13:41 , Lars Andersson wrote:

> I would like to dynamically change the flow rate of material feed of my
> plastic rapid prototyper. The material is dispensed by a step motor on the
> A-axis. A is running proportional to the combined speed of X and Y (always
> counting up) . The scale factor for A is set at the G-code generation, it is
> almost on target but I would like to tweak it slightly. So I try to change
> stepgen.3.position-scale with a potentiometer. 
> 
> 
> 
> net flowrate stepgen.3.position-scale <=  input.0.abs-rx-position
> 
> This is not allowed, "stepgen.3.position-scale" is a parameter, not a pin
> 
> 
> 
> I try manually while running:
> 
> setp stepgen.3.position-scale  210   (it was was 200 before)
> 
> This immediately gives a "joint 3 following error" even for a very small
> change.
> 
> 
> 
> Can I work around this?
> 
> 
> 
> Is there a better way to do what I want to do? (Hope so!)
> 
> 
> 
> --
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

-- 
Sebastian Kuzminsky


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-18 Thread Ben Jackson
On Wed, Jan 18, 2012 at 09:41:12PM +0100, Lars Andersson wrote:
> I try manually while running:
> 
> setp stepgen.3.position-scale  210   (it was was 200 before)
> 
> This immediately gives a "joint 3 following error" even for a very small
> change.

That's because the absolute position of A just moved by a lot.  Let's
say you've extruded for 1000 A units.  The motor is at 1000*200.  When
you change the scale it suddenly wants to be at 1000*210.  If you didn't
get the following error you would have instead gotten 1 stepper units
of extrusion instantly to "catch up".

> Can I work around this?

You could put a gasket between the axis and stepgen to cancel out the
error.  I'm not sure how tricky that would be in practice.

-- 
Ben Jackson AD7GD

http://www.ben.com/

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Changing the scale factor of an axis

2012-01-18 Thread Viesturs Lācis
2012/1/18 Lars Andersson :
>
> net flowrate stepgen.3.position-scale <=  input.0.abs-rx-position
>
> This is not allowed, "stepgen.3.position-scale" is a parameter, not a pin

Then You can solve the cause of the problem - change it from parameter to pin.
In simple HAL module it would require changing a single line.
Unfortunately, I have no idea, which source file creates this
parameter, so cannot advice, where to look.

Viesturs

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users