Run GladeVCP from halrun

More
17 Aug 2012 17:12 #23352 by wd5jwy
Replied by wd5jwy on topic Re:Run GladeVCP from halrun

If you look in the first Glade/Python tutorial at the destroy part and add the hal unload that should take care of that part.


Yes, I thought of trying that late last night - will try it later today.

net spool-step parport.0.pin-02-out <= stepgen.0.step


I can't find "spool-step" anywhere in the docs. Is this information documented anywhere? The Hal manual doesn't address the "parport" in any detail. The naming convention is there, but no examples. I'll go look in the Integrator Manual and see what I can find.

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

More
17 Aug 2012 17:50 #23357 by BigJohnT
The Integrator manual has the parallel port driver in it. A signal name can be almost anything you like... see this chapter from the Hal Manual.

John

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

More
17 Aug 2012 18:52 #23361 by wd5jwy
Replied by wd5jwy on topic Re:Run GladeVCP from halrun
Ok, so following the "net" command syntax in the Hal manual:

net <direction>* <signal-name> <direction>* <pin-name> (<pin-name>|<direction>)*

net both-home-y <= parport.0.pin-11-in


This is where I'm getting confused - in the above example:

"net" = hal command
"both-home-y" = direction and signal name? Or just signal name?

Or are they saying that <direction>* is just an option at that point in the command sequence?

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

More
17 Aug 2012 18:59 #23362 by andypugh
Directions are all optional. I have actually stopped using them in my own hand-crafted HAL.

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

More
17 Aug 2012 19:04 #23363 by wd5jwy
Replied by wd5jwy on topic Re:Run GladeVCP from halrun
Ah, ok, that's interesting - thanks for the info. I wish I could play with this right now, but the day job is getting in the way.

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

More
17 Aug 2012 19:19 - 17 Aug 2012 19:20 #23366 by BigJohnT
Where did you find that confusing description? Oh Never Mind, I found that...

John
Last edit: 17 Aug 2012 19:20 by BigJohnT.

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

More
17 Aug 2012 19:35 #23367 by wd5jwy
Replied by wd5jwy on topic Re:Run GladeVCP from halrun
So, I think I have it cleared up now. In the example:

net <direction>* <signal-name> <direction>* <pin-name> (<pin-name>|<direction>)*

net both-home-y <= parport.0.pin-11-in


<direction> would always be one of these "<=" or "=>". So, in the above example, "both-home-y" is the signal-name that receives an input from parport pin 11.

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

More
17 Aug 2012 19:48 #23369 by BigJohnT
Yep you have broken the confusing code in that bad example, I've already fixed that example and it should be online in an hour with a much better example and explication.

The signal name can only have one pin that changes it's state or value, but can have as many pins as you need that read that value.

For example
net start-button stepgen.0.enable <= parport.pin-11-in
net start-button stepgen.1.enable

The net start-button can be used more than once but only once with a Direction OUT pin like the parallel port physical in pin.

The same thing can be written as
net start-button stepgen.0.enable stepgen.1.enable parport.pin-11-in

and the direction indicators <=, =>, and <=> mean nothing to HAL and are only there for your visual pleasure.

John

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

More
18 Aug 2012 15:56 - 18 Aug 2012 15:58 #23383 by BigJohnT
wd5jwy,

Just for fun I created a component to work with the spooler that makes the stepper run to the max then reverse direction and run back to the min setting at the velocity set by the spin box. The green bar shows the current step count from the stepgen. So with this you don't need a mechanical reversing mechanism like a deep sea reel, just a guide on a screw...



File Attachment:

File Name: wd.zip
File Size:3 KB


John
Attachments:
Last edit: 18 Aug 2012 15:58 by BigJohnT.

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

More
18 Aug 2012 16:14 - 18 Aug 2012 16:15 #23384 by BigJohnT
This is an update to spooler.comp
component spooler;

pin in signed min_limit;
pin in signed max_limit;
pin in float vel_in;
pin in signed step_counts;

pin out float vel_out;

variable int direction;

function _;
license "GPLv2 or later";
;;

FUNCTION(_)
{
  if(step_counts <= min_limit){direction = 0;}
  if(step_counts >= max_limit){direction = 1;}

  if(direction) {vel_out = -vel_in;}
  else {vel_out = vel_in;}
}

This will update the velocity all the time so if you change it the effect will be immediate.

Thanks to bpuk on the IRC for the update.

John
Last edit: 18 Aug 2012 16:15 by BigJohnT.

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

Moderators: mhaberlerHansU
Time to create page: 0.145 seconds
Powered by Kunena Forum