HAL hand holding please

More
15 Jul 2010 09:08 - 15 Jul 2010 09:09 #3356 by Zig
HAL hand holding please was created by Zig
Hello board,

In another topic I was told to learn up HAL and may be my hardware solution could be dropped.

OK.. so here it is ( the problem):

My gantry is operating a laser.
G-code is derived from a 21/2 D ( milling/ engraving software).

It contains the usual XY set of data aqs well as a notional Z axis data.
I use Z axis down stroke to activate the laser which is modulated by the speed ( not velocity ) of X and Y axes.

All this happens with the aid of a MESA 5I20 ( God bless Mesa) motion control.

Attached is a schematic diagram of a proposed HAL solution. PLEASE CRITIQUE the proposal.


Aadd , subtract and modify but dont call me ignorant !@#$ i need to learn and seeing as how I am a sensitive soul I will *&%( back at You. ;)

Did I say God bless mesa?

Cheers


EDIT: will have to find a way to post the JPEG
Last edit: 15 Jul 2010 09:09 by Zig.

Please Log in or Create an account to join the conversation.

More
15 Jul 2010 09:23 - 15 Jul 2010 09:31 #3357 by Zig
Replied by Zig on topic Re:HAL hand holding please
May be this time.. had to crop the image in order to upload



hmmm... Next time for sure
Bulwinkle
Attachments:
Last edit: 15 Jul 2010 09:31 by Zig.

Please Log in or Create an account to join the conversation.

More
16 Jul 2010 13:20 #3364 by andypugh
Replied by andypugh on topic Re:HAL hand holding please
I am afraid it is not entirely clear to me what you are trying to do with that network of HAL functions.

Can you explain in short words? :-)

Please Log in or Create an account to join the conversation.

More
16 Jul 2010 23:26 #3378 by Zig
Replied by Zig on topic Re:HAL hand holding please
Thanks for taking time and interest.

ONESHOT and OR gates are to be connected to X and Y axis inphase and quadrature encoder signals to generate a pulse stream of constant pulse width.

Mesa 5I20steppermotor frequency generator has STEP and DIRECTION outputs.

DIRECTION flag does not remember current state until next change in direction ( within the G code file). In other words the flag will go high while the Z axis moves in negative direction and will go low as soon as the move is effected.

My requirement is a for a flag whihc will go high and remain high untill the move in opposite direction is actually called for.

D type flipflop will take Z axis DIRECTION flag on data input and latch it high untill the next Z axis physical move is called for by the virtue of positive edge presence on Zaxis STEP signal.

The AND gate will then VALIDATE the pulse stream in sympathy with Z axis extended flag such that the pulse stream is present on the output only during coordinated XY movements.

This is based on the correct form of G code file where the XY movement are on one line and Z movement is on a separate line of code.

By the way the above approach functions in hardware.

Please Log in or Create an account to join the conversation.

More
16 Jul 2010 23:28 #3379 by Zig
Replied by Zig on topic Re:HAL hand holding please
My question is do I setup a new thread or tack this onto servo thread?

How do i actually identify the input nets and connect the above to those nets ?

Please Log in or Create an account to join the conversation.

More
17 Jul 2010 01:01 #3384 by andypugh
Replied by andypugh on topic Re:HAL hand holding please
Zig wrote:

ONESHOT and OR gates are to be connected to X and Y axis inphase and quadrature encoder signals to generate a pulse stream of constant pulse width.


That might not work. With a Mesa card config your servo thread typically runs every millisecond. There may well be very many steps in that time period, and you will miss them. You could add a faster base thread to track the step pulses, but that seems silly.

D type flipflop will take Z axis DIRECTION flag on data input and latch it high untill the next Z axis physical move is called for by the virtue of positive edge presence on Zaxis STEP signal.


That seems like it should work.
(combining posts)

My question is do I setup a new thread or tack this onto servo thread?

You either addf the new functions to the servo thread, or add a base thread and add them to that, depending on how frequently you want to call them.

How do i actually identify the input nets and connect the above to those nets ?


You identify the pins either by poring through the docs (www.linuxcnc.org/docview/html/) or by looking in the HAL config window in EMC. You can also put a "show all" line in the HAL file just after the addf block, and that will print out all the pins and threads to the terminal (only any good if you start emc from the terminal though)

Personally I think that exactly copying the hardware solution in software might not be the best plan. As I understand it you want to adjust the laser power according to current velocity. I would do that by adding a pwmgen to the Mesa card, then passing the axis velocities to a hypot hal function (hypotenuse, just sqrt(a^2 + b^2 +c^2) ) and setting the PWM value to that velocity (with the pwm scale value set accordingly)
HAL can cope perfectly happily with analogue values, you might as well use that.

Please Log in or Create an account to join the conversation.

More
17 Jul 2010 01:32 #3385 by Zig
Replied by Zig on topic Re:HAL hand holding please
Thanks for Your comments

ONESHOT input pulse rate would be anything up to 5000pulses per second.

A base rate of 0.1ms? is it feasible?

I might remain with the hardware solution in this are for the time being.. but i shall take the Z axis flag further.

In the mean time i shall also have a look the combination of hypotenuse and a pulse genny components.

Hope this does not take me months to resolve ( again).

Please Log in or Create an account to join the conversation.

More
17 Jul 2010 04:52 #3387 by cmorley
Replied by cmorley on topic Re:HAL hand holding please
one warning about adding a base thread. there seems to be a bad interaction with mesa stepgens and using a base thread.
If you get following errors immediately after adding a base thread then you have to remove the base thread.

Please Log in or Create an account to join the conversation.

More
17 Jul 2010 10:16 #3389 by andypugh
Replied by andypugh on topic Re:HAL hand holding please
A base thread of 0.1ms is perfectly feasible, in fact .05mS is common and low-latency machines can go down to 0.02mS

Please Log in or Create an account to join the conversation.

Time to create page: 0.105 seconds
Powered by Kunena Forum