The stepper that wasn't

More
30 Jun 2022 20:16 #246303 by drummond
Long story as short as possible:Hardware: RPI4, 7C81, ma860h stepper driver, Nema 34 stepper motor 34hs59-5004s7C81 is running G540X2   P1 is working with G540 no problems.  P2 connected to C10 board, Stepgen 5 being used to test above hardware.  The motor hasn't made a peep so far in testing.  I'm attaching ini and Hal so that people can spot any unforced errors, howlers etc.  Anyone have any ideas?
Attachments:

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

More
30 Jun 2022 20:31 #246306 by tommylight
Replied by tommylight on topic The stepper that wasn't
Since you already omitted everything in those files, check if X is working with stepgen 0, then change stepgen 0 to 5 and test again.
I would load all the stepgens during testing just to check if the stepgens output to the required pins on P1, then change back after testing.
The following user(s) said Thank You: drummond

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

More
30 Jun 2022 21:47 #246319 by drummond
Replied by drummond on topic The stepper that wasn't
First unforced error found, thanks Tommy.

I've reinstated stepgen 05 at the top. commented it out earlier because I was trying to run before I could walk. Gave it a quick test and now it's giving me following errors. Updated Hal and ini (which is the same) Testing will continue on the other stepgens, but how do I get rid of the following error?
Attachments:

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

More
30 Jun 2022 22:03 - 30 Jun 2022 22:12 #246320 by PCW
Replied by PCW on topic The stepper that wasn't
Stepgen 05 is not setup correctly:

This seems OK:
# Step Gen signals/setup

setp [HMOT](CARD0).stepgen.05.dirsetup [JOINT_0]DIRSETUP
setp [HMOT](CARD0).stepgen.05.dirhold [JOINT_0]DIRHOLD
setp [HMOT](CARD0).stepgen.05.steplen [JOINT_0]STEPLEN
setp [HMOT](CARD0).stepgen.05.stepspace [JOINT_0]STEPSPACE
setp [HMOT](CARD0).stepgen.05.position-scale [JOINT_0]STEP_SCALE
setp [HMOT](CARD0).stepgen.05.step_type 0
setp [HMOT](CARD0).stepgen.05.control-type 1
setp [HMOT](CARD0).stepgen.05.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp [HMOT](CARD0).stepgen.05.maxvel [JOINT_0]STEPGEN_MAXVEL

But this references Stepgen 00

# ---closedloop stepper signals---

net x-pos-cmd <= joint.0.motor-pos-cmd
net x-vel-cmd <= joint.0.vel-cmd
net x-output <= [HMOT](CARD0).stepgen.00.velocity-cmd
net x-pos-fb <= [HMOT](CARD0).stepgen.00.position-fb
net x-pos-fb => joint.0.motor-pos-fb
net x-enable <= joint.0.amp-enable-out
net x-enable => [HMOT](CARD0).stepgen.00.enable

#
Last edit: 30 Jun 2022 22:12 by PCW. Reason: sp
The following user(s) said Thank You: drummond

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

More
30 Jun 2022 22:33 #246322 by drummond
Replied by drummond on topic The stepper that wasn't
I've addressed that issue and the following errors have now disappeared, Thank you.

However the motor is still not responding, so testing on other C10 ports will resume later today or tomorrow,.

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

More
01 Jul 2022 17:30 #246384 by drummond
Replied by drummond on topic The stepper that wasn't
I was all ready to swap to stepgen 06 to see if that worked, but something was itching at my mind to try first. Was it in the manual?

DIR must be ahead of PUL effective edge by 5µs to ensure correct direction
Pulse width not less than 1.5µs
Low level width not less than 1.5µs

The first point is moot, I don't need to stop on a dime to change direction

The other 2 points there's nothing there, that's 1500 nanoseconds and I have alloted 2000

BUT why did the micro controller work? Then I remembered, the library I used for the micro controller:

luni64.github.io/TeensyStep/documentation/rotateControl/

defaults to step pulse width of 5µs and I never changed this because it "just works" (tm)

I decided to change only one parameter; steplen from 2000 to 5000 and try it. I nearly jumped out of my skin when the motor started moving because I wasn't expecting it.

So "Hello World"(!)

Next tasks will be to turn this into an angular axis velocity mode setup, maybe make it a spindle for ramp up ramp down? Then amalgamate this into the lathe setup thats running on the G540 on P1.

Lot's of opportunities for me to screw up yet again, so I'm sure I'll be back with more (stupid) questions.

Thanks Tommy and Peter for your help and patience so far.

I'm attaching the working Hal and ini, the latter has 2 changes the aforementioned steplen and I changed the step scale to positive.
Attachments:
The following user(s) said Thank You: tommylight

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

More
01 Jul 2022 19:49 #246395 by tommylight
Replied by tommylight on topic The stepper that wasn't
You are welcomed, always.
As one once said:
There are no stupid questions, there are stupid answers.
No idea who that was, should have aranged a meeting with a friend of mine, he does ask in statements, not normal questions. :)

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

More
02 Jul 2022 21:35 #246471 by elf
Replied by elf on topic The stepper that wasn't
How are you using the TeensyStep library on an RPI4?

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

More
03 Jul 2022 14:49 #246509 by drummond
Replied by drummond on topic The stepper that wasn't
I actually started this project a couple of years back with a view to making a standalone motor controller with a Teensy 3.2 board. Part of the reason for choosing a Teeensy was the excellent Teensystep library, it wasn't difficult to get the motor running and responding to commands. Then life intervened.

I'm just now getting back to the project and decided to get the Teensy out of the project and replace it with Linuxcnc running on the RPI4, I had forgotten some of what I had done in the past.

I couldn't understand why the Teensy could run this motor but Linuxcnc could not. Much of the reason was my sheer ineptitude (must get better) with Hal and Ini files, but a revisit to the the library I had used with the Teensy had a clue with step pulse width, I used the same pulse width in the steplen setting in the ini folder on Linuxcnc and that was enough to get the motor working, on linuxcnc no library required.

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

Time to create page: 0.072 seconds
Powered by Kunena Forum