AX58100 IN OUT PINES
- COFHAL
- Offline
- Platinum Member
Less
More
- Posts: 334
- Thank you received: 37
15 Dec 2024 00:29 #316681
by COFHAL
Replied by COFHAL on topic Step scale
Thanks for the information.
How do you set the lcec.0.D1.stepspermm1 command to control the stepper motor driver, for example, if it is set to 1600?
What relationship should it have with respect to the screw pitch if it has a pitch of 5 mm per turn?
How do you set the lcec.0.D1.stepspermm1 command to control the stepper motor driver, for example, if it is set to 1600?
What relationship should it have with respect to the screw pitch if it has a pitch of 5 mm per turn?
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 489
- Thank you received: 155
15 Dec 2024 09:23 #316697
by Hakan
Replied by Hakan on topic Step scale
Just to divide 1600 by 5 = 320 steps/mm.
Do you have the steppers running? I am curious if that voltage level shifter works. I mean, it should work but I never came that far in my build.
Do you have the steppers running? I am curious if that voltage level shifter works. I mean, it should work but I never came that far in my build.
The following user(s) said Thank You: COFHAL
Please Log in or Create an account to join the conversation.
- COFHAL
- Offline
- Platinum Member
Less
More
- Posts: 334
- Thank you received: 37
15 Dec 2024 14:56 #316708
by COFHAL
Replied by COFHAL on topic Step scale
I have not been able to test it yet, but with a multimeter I have verified that when I change the direction of a motor the DIR pin changes from 0 to 5 volts.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 489
- Thank you received: 155
15 Dec 2024 15:13 #316709
by Hakan
Replied by Hakan on topic Step scale
Then it seems to work. Good luck with the steppers.
Please Log in or Create an account to join the conversation.
- COFHAL
- Offline
- Platinum Member
Less
More
- Posts: 334
- Thank you received: 37
15 Dec 2024 22:56 #316721
by COFHAL
Replied by COFHAL on topic Step scale
I still don't understand, what do I use the lcec.0.D1.stepspermm pins for?
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 489
- Thank you received: 155
16 Dec 2024 00:27 #316723
by Hakan
Replied by Hakan on topic Step scale
The thing that updates every millisecond is CommandedPosition, linuxcnc calculates a new position value every millisecond which goes to the MCU on the card. How many steps does the step generator need to make to go to that new position?
There is the scaling parameter 320 steps/mm. Say it needs to go 0.1 mm in one millisecond which is awfully fast but just an example. 0.1 *320 = 32 steps to make during that millisecond.
Another way could be to calculate number of steps to move in hal, in linuxcnc. It is not done that way. The new position, commanded positition, in machine units, is fed to the stepper driver, be it Ethercat, parallel port or Mesa card.
If you change the microstep setting on the driver itself you need to change stepspermm accordingly.
There is the scaling parameter 320 steps/mm. Say it needs to go 0.1 mm in one millisecond which is awfully fast but just an example. 0.1 *320 = 32 steps to make during that millisecond.
Another way could be to calculate number of steps to move in hal, in linuxcnc. It is not done that way. The new position, commanded positition, in machine units, is fed to the stepper driver, be it Ethercat, parallel port or Mesa card.
If you change the microstep setting on the driver itself you need to change stepspermm accordingly.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 489
- Thank you received: 155
16 Dec 2024 09:28 - 16 Dec 2024 09:31 #316734
by Hakan
Replied by Hakan on topic Step scale
As a comment, and room for improvements, if one so wishes.
The stepspermm variable is set up as a pdos. Meaning that this value
will be updated every servo cycle (miilisecond). That is not very optimal,
the steps per mm scaling factor is a constant. Set it once and it stays there.
It is not like one will change the scaling value during operation.
The options I saw when I put it as a pdos was to either make it a sdos or a constant in the MCU program.
As a constant in the MCU program it becomes kind of inaccessible, but apart from that it will work fine.
Making it a sdos adds a bit of complexity when giving it a value. There is no interface for sdos to hal
that I know about. One can give a value to a sdos in the ethercat-conf.xml config file, but that brings
its own unnecessary complexity. One need to enter a line like the last line below
To end up with "40 06" one brings up a decimal to hex converter and converts 1600 which gives 640.
Shift place on the two bytes 06 40 => 40 06 which one then enters in ethercat-conf.xml.
The code in the MCU stays the same, still Obj.StepsPerMM1 (or what is is called). It is just not updated
every serocycle but once in the beginning.
Just a bit of background and rambling.
The stepspermm variable is set up as a pdos. Meaning that this value
will be updated every servo cycle (miilisecond). That is not very optimal,
the steps per mm scaling factor is a constant. Set it once and it stays there.
It is not like one will change the scaling value during operation.
The options I saw when I put it as a pdos was to either make it a sdos or a constant in the MCU program.
As a constant in the MCU program it becomes kind of inaccessible, but apart from that it will work fine.
Making it a sdos adds a bit of complexity when giving it a value. There is no interface for sdos to hal
that I know about. One can give a value to a sdos in the ethercat-conf.xml config file, but that brings
its own unnecessary complexity. One need to enter a line like the last line below
<slave idx="4" type="generic" vid="00000a88" pid="0a880002" configPdos="true">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
<sdoConfig idx="2000" subIdx="0"><sdoDataRaw data ="40 06"/></sdoConfig> <!-- Steps per mm axis 1: 1600 -->
To end up with "40 06" one brings up a decimal to hex converter and converts 1600 which gives 640.
Shift place on the two bytes 06 40 => 40 06 which one then enters in ethercat-conf.xml.
The code in the MCU stays the same, still Obj.StepsPerMM1 (or what is is called). It is just not updated
every serocycle but once in the beginning.
Just a bit of background and rambling.
Last edit: 16 Dec 2024 09:31 by Hakan.
The following user(s) said Thank You: COFHAL
Please Log in or Create an account to join the conversation.
- COFHAL
- Offline
- Platinum Member
Less
More
- Posts: 334
- Thank you received: 37
16 Dec 2024 14:27 #316759
by COFHAL
Replied by COFHAL on topic Step scale
I'm still lost. I'm used to using STEP SCALE in the ini to adjust the number of steps needed to move one mm. but now I don't know how to do it. For example if I need 320 steps/mm, how do I adjust the value lcec.0.D1.stepspermm?
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 489
- Thank you received: 155
16 Dec 2024 19:46 - 16 Dec 2024 19:49 #316800
by Hakan
Replied by Hakan on topic Step scale
Ok I see, the hal syntax isor for example
and that goes into the main hal file.
setp lcec.0.D1.stepspermm 320
setp lcec.0.D1.stepspermm [JOINT_1]STEP_SCALE
and that goes into the main hal file.
Last edit: 16 Dec 2024 19:49 by Hakan.
The following user(s) said Thank You: tommylight, COFHAL
Please Log in or Create an account to join the conversation.
- COFHAL
- Offline
- Platinum Member
Less
More
- Posts: 334
- Thank you received: 37
16 Dec 2024 22:53 #316816
by COFHAL
Replied by COFHAL on topic Step scale
Are these values in the xml file okay?
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="-1"> <!-- was "5" -->
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="1000000"/> <!-- was "0" -->
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="-1"> <!-- was "5" -->
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="1000000"/> <!-- was "0" -->
Please Log in or Create an account to join the conversation.
Time to create page: 0.104 seconds