How to treat Stepgens

More
19 Jun 2022 20:08 #245446 by drummond
This question covers both HAL as well as Mesa Boards, so please move it wherever appropriate.

A couple of basic questions from a HAL nubie:

Once you get out of the bounds of the first connector on a Mesa board which has a x2 setup like G540x2, which has 5 stepgens-XYZA plus charge pump, is it sufficient to declare stepgen 5 (which is on connector 2) like this:

setp   [HMOT](CARD0).stepgen.05.dirsetup        [JOINT_0]DIRSETUP

or does there need to be some kind of preamble about ports/pins to make sure that stepgen.05 gets loaded without error?

additionally for general purpose i/o what is the preamble to set the gpio pins correctly?

Thanks!

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

More
19 Jun 2022 21:11 - 19 Jun 2022 21:12 #245451 by PCW
Replied by PCW on topic How to treat Stepgens
You can do that ( re-use joint 0 constants for another joint ) with timing setup
if the stepgen 5 hardware is identical, but since the joint for stepgen 5 will likely
have different speeds and min and max limits, it probably makes more sense to
copy paste the joint0/axisX section of the ini file to a joint and use a different set
of constants for the joint that drives stepgen5
Last edit: 19 Jun 2022 21:12 by PCW.

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

More
19 Jun 2022 22:01 #245454 by drummond
Replied by drummond on topic How to treat Stepgens
What I am actually trying to do as a test is to set up a dummy lathe by copying my original lathe setup on connector 1 (which works) to another folder for motor tests. The HAL and ini files were copied and renamed as was the folder.

I wanted to create an XZ lathe but connected to the stepgens I see on P2-03 P2-05 and P2-07 P2-09 to test if my C10 board is working correctly. Having renamed the stepgens to 05 and 06, I started linuxcnc from terminal and got the error "stepgen.05.dirsetup" not found. I'm about to look through and check that I didn't make a typo.

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

More
19 Jun 2022 22:28 - 19 Jun 2022 22:32 #245456 by drummond
Replied by drummond on topic How to treat Stepgens
The error message:

./motor.hal:67: parameter or pin 'hm2_7c81.0.stepgen.05.dirsetup' not found

HAL and ini attached 

How it looks:
hm2/hm2_7c81.0: 57 I/O Pins used:
hm2/hm2_7c81.0: IO Pin 000 (P1-01): IOPort
hm2/hm2_7c81.0: IO Pin 001 (P1-02): PWMGen #0, pin Out0 (PWM or Up) (Output)
hm2/hm2_7c81.0: IO Pin 002 (P1-03): StepGen #0, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 003 (P1-04): IOPort
hm2/hm2_7c81.0: IO Pin 004 (P1-05): StepGen #0, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 005 (P1-06): StepGen #4, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 006 (P1-07): StepGen #1, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 007 (P1-08): IOPort
hm2/hm2_7c81.0: IO Pin 008 (P1-09): StepGen #1, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 009 (P1-11): StepGen #2, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 010 (P1-13): StepGen #2, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 011 (P1-15): StepGen #3, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 012 (P1-17): StepGen #3, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 013 (P1-19): Encoder #0, pin A (Input)
hm2/hm2_7c81.0: IO Pin 014 (P1-21): Encoder #0, pin B (Input)
hm2/hm2_7c81.0: IO Pin 015 (P1-23): Encoder #0, pin Index (Input)
hm2/hm2_7c81.0: IO Pin 016 (P1-25): IOPort
hm2/hm2_7c81.0: IO Pin 017 (J5-TX0): IOPort
hm2/hm2_7c81.0: IO Pin 018 (J6-TX1): IOPort
hm2/hm2_7c81.0: IO Pin 019 (P2-01): IOPort
hm2/hm2_7c81.0: IO Pin 020 (P2-02): PWMGen #1, pin Out0 (PWM or Up) (Output)
hm2/hm2_7c81.0: IO Pin 021 (P2-03): StepGen #5, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 022 (P2-04): IOPort
hm2/hm2_7c81.0: IO Pin 023 (P2-05): StepGen #5, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 024 (P2-06): StepGen #9, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 025 (P2-07): StepGen #6, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 026 (P2-08): IOPort
hm2/hm2_7c81.0: IO Pin 027 (P2-09): StepGen #6, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 028 (P2-11): StepGen #7, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 029 (P2-13): StepGen #7, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 030 (P2-15): StepGen #8, pin Step (Output)
hm2/hm2_7c81.0: IO Pin 031 (P2-17): StepGen #8, pin Direction (Output)
hm2/hm2_7c81.0: IO Pin 032 (P2-19): Encoder #1, pin A (Input)
hm2/hm2_7c81.0: IO Pin 033 (P2-21): Encoder #1, pin B (Input)
hm2/hm2_7c81.0: IO Pin 034 (P2-23): Encoder #1, pin Index (Input)
hm2/hm2_7c81.0: IO Pin 035 (P2-25): IOPort
hm2/hm2_7c81.0: IO Pin 036 (J5-TXEN0): IOPort
hm2/hm2_7c81.0: IO Pin 037 (J6-TXEN1): IOPort
hm2/hm2_7c81.0: IO Pin 038 (P7-01): IOPort
hm2/hm2_7c81.0: IO Pin 039 (P7-02): IOPort
hm2/hm2_7c81.0: IO Pin 040 (P7-03): IOPort
hm2/hm2_7c81.0: IO Pin 041 (P7-04): IOPort
hm2/hm2_7c81.0: IO Pin 042 (P7-05): IOPort
hm2/hm2_7c81.0: IO Pin 043 (P7-06): IOPort
hm2/hm2_7c81.0: IO Pin 044 (P7-07): IOPort
hm2/hm2_7c81.0: IO Pin 045 (P7-08): IOPort
hm2/hm2_7c81.0: IO Pin 046 (P7-09): IOPort
hm2/hm2_7c81.0: IO Pin 047 (P7-11): IOPort
hm2/hm2_7c81.0: IO Pin 048 (P7-13): IOPort
hm2/hm2_7c81.0: IO Pin 049 (P7-15): IOPort
hm2/hm2_7c81.0: IO Pin 050 (P7-17): IOPort
hm2/hm2_7c81.0: IO Pin 051 (P7-19): IOPort
hm2/hm2_7c81.0: IO Pin 052 (P7-21): IOPort
hm2/hm2_7c81.0: IO Pin 053 (P7-23): IOPort
hm2/hm2_7c81.0: IO Pin 054 (P7-25): IOPort
hm2/hm2_7c81.0: IO Pin 055 (P5-RX0): IOPort
hm2/hm2_7c81.0: IO Pin 056 (P6-RX1): IOPort
Attachments:
Last edit: 19 Jun 2022 22:32 by drummond. Reason: add Hal

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

More
19 Jun 2022 22:35 #245457 by drummond
Replied by drummond on topic How to treat Stepgens
Hal and Ini

File Attachment:

File Name: motor_2022-06-19.ini
File Size:3 KB

File Attachment:

File Name: motor_2022-06-19.hal
File Size:7 KB
Attachments:

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

More
20 Jun 2022 00:36 #245461 by PCW
Replied by PCW on topic How to treat Stepgens
loadrt hm2_rpspi config=" num_encoders=0 num_pwmgens=0 num_stepgens=5"

num_stepgens=5 means only stepgens 0..4 are enabled
The following user(s) said Thank You: drummond, rdtsc

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

More
20 Jun 2022 01:02 #245462 by drummond
Replied by drummond on topic How to treat Stepgens
Thank you so much, I feel like a muppet for missing that.

I have increased stepgens to 7 and tested, loaded without a hitch.
Test it on the actual machine tomorrow.

Thanks again.

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

Time to create page: 0.140 seconds
Powered by Kunena Forum