How to invert GPIO XDIR pin output on RPi5 parallel port
19 Jun 2024 00:04 #303311
by poptops
How to invert GPIO XDIR pin output on RPi5 parallel port was created by poptops
I could really use a leg-up on my rpi5 .hal. I try to be reserved and not overuse your talents but I am really at a dead-end. I have read countless threads on hal development but have seen nothing that will get through Axis launch w/o throwing an error. I have 10 years experience with emc2 on my homebrew 3 axis machine. The GPIO conversion is the difference.
My challange is to simply invert ydir. You can see some of my failed solutions in the "Stepper Outputs" section below. My hal file is based on the RPi5 file provided by Byte2Bot (I am using their parallel V. level conversion board) but they did not deal with GPIO output inversion. And I have not found one other indication that anyone else has either.. Advanced HAL doc. has about 4 lines on the setp command which are too obscur for me. I asked a couple AI bots with no help. Chatgpt4 suggested this:
loadusr -w hal_invert
addf hal_invert.0 servo-thread
net inverted_stepper_direction <= hal_invert.in
net original_stepper_direction motion.stepper.23.dir
net direction motion.stepper.0.dir => inverted_stepper_direction
....to be placed at the front of the Stepper Outputs section but it looks very foreign and posts errors on launch. This is the now defunct code in my old emc2 hal: setp parport.0.pin-03-out-invert 1
If anyone has any ideas of what to do or has seen a .hal example with a pin inverter command for RP5 parallel output please let know.
##########
My challange is to simply invert ydir. You can see some of my failed solutions in the "Stepper Outputs" section below. My hal file is based on the RPi5 file provided by Byte2Bot (I am using their parallel V. level conversion board) but they did not deal with GPIO output inversion. And I have not found one other indication that anyone else has either.. Advanced HAL doc. has about 4 lines on the setp command which are too obscur for me. I asked a couple AI bots with no help. Chatgpt4 suggested this:
loadusr -w hal_invert
addf hal_invert.0 servo-thread
net inverted_stepper_direction <= hal_invert.in
net original_stepper_direction motion.stepper.23.dir
net direction motion.stepper.0.dir => inverted_stepper_direction
....to be placed at the front of the Stepper Outputs section but it looks very foreign and posts errors on launch. This is the now defunct code in my old emc2 hal: setp parport.0.pin-03-out-invert 1
If anyone has any ideas of what to do or has seen a .hal example with a pin inverter command for RP5 parallel output please let know.
##########
Attachments:
Please Log in or Create an account to join the conversation.
19 Jun 2024 00:53 - 19 Jun 2024 01:01 #303313
by cornholio
Replied by cornholio on topic How to invert GPIO XDIR pin output on RPi5 parallel port
Put everything back to normal and in your ini file invert the scale for the x axis. See red text
[JOINT_0]
AXIS = X
MIN_LIMIT = -1
MAX_LIMIT = 486
MAX_VELOCITY = 80
MAX_ACCELERATION = 360
TYPE = LINEAR
SCALE = -320
[JOINT_0]
AXIS = X
MIN_LIMIT = -1
MAX_LIMIT = 486
MAX_VELOCITY = 80
MAX_ACCELERATION = 360
TYPE = LINEAR
SCALE = -320
Last edit: 19 Jun 2024 01:01 by cornholio.
Please Log in or Create an account to join the conversation.
19 Jun 2024 02:05 #303314
by poptops
Replied by poptops on topic How to invert GPIO XDIR pin output on RPi5 parallel port
That is very logical.
-Change the .ini file. (SCALE= -nnn)
-Keep the current working hal with no inversion.
I am greatly appreciative.
-Change the .ini file. (SCALE= -nnn)
-Keep the current working hal with no inversion.
I am greatly appreciative.
Please Log in or Create an account to join the conversation.
Time to create page: 0.077 seconds