Carousel with step motor
- Serg452
- Offline
- Senior Member
Less
More
- Posts: 61
- Thank you received: 5
16 Jun 2023 16:04 - 18 Jun 2023 23:17 #273704
by Serg452
Carousel with step motor was created by Serg452
I use 2.8 and gmoccapy, I looked at configuration examples for a long time, but I didn't understand anything. Now I ask for help.In the attached ATC file fragment. First, I want it to just find an index, and then I will add ARM and other settings.Of the sensors so far only HOME. A component of the latest version from an adjacent theme.
I cannot understand what the following signals should be connected to, especially the first 3 (driver outputs counts-target):
net carstep parport.0.pin-02-out stepgen.0.step ???
net cardir parport.0.pin-03-out stepgen.0.dir ???
net car-motor-counts carousel.0.counts-target
net car-motor-fwd carousel.0.motor-fwd
net car-motor-rev carousel.0.motor-rev
I cannot understand what the following signals should be connected to, especially the first 3 (driver outputs counts-target):
net carstep parport.0.pin-02-out stepgen.0.step ???
net cardir parport.0.pin-03-out stepgen.0.dir ???
net car-motor-counts carousel.0.counts-target
net car-motor-fwd carousel.0.motor-fwd
net car-motor-rev carousel.0.motor-rev
Last edit: 18 Jun 2023 23:17 by Serg452.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4860
20 Jun 2023 13:39 #273931
by andypugh
Replied by andypugh on topic Carousel with step motor
With your current configuration, I would expect the carousel to search for an index when activated by motion.digital-out-02 (which would be an M64 command from the G-code)
You seem to be using the stepgen in velocity mode, which is certainly possible, and is the only way to do it with the older version of carousel in the 2.8 version.
However, you might want to consider installing the version from 2.9 which can be used with a position-mode stepgen.
You seem to be using the stepgen in velocity mode, which is certainly possible, and is the only way to do it with the older version of carousel in the 2.8 version.
However, you might want to consider installing the version from 2.9 which can be used with a position-mode stepgen.
Please Log in or Create an account to join the conversation.
- xenon-alien
- Away
- Premium Member
Less
More
- Posts: 136
- Thank you received: 3
16 Jan 2025 14:04 - 16 Jan 2025 19:22 #319122
by xenon-alien
Replied by xenon-alien on topic Carousel with step motor
Hello!
Which pins I have to use in the carousel comp. to make move the stepper motor with one homing sensor? (there will be pulses between home and first tool; and pulses between tools)
I have a stepper motor and a sensor for "homing". (The belt drive DC motor just opens the door of the magazine and the other 2 sensors used for check the door position open/close)
The LinuxCNC will be the 2.9.3 v (and a Mesa 7i96s+7i84 board)
Which pins I have to use in the carousel comp. to make move the stepper motor with one homing sensor? (there will be pulses between home and first tool; and pulses between tools)
I have a stepper motor and a sensor for "homing". (The belt drive DC motor just opens the door of the magazine and the other 2 sensors used for check the door position open/close)
The LinuxCNC will be the 2.9.3 v (and a Mesa 7i96s+7i84 board)
Attachments:
Last edit: 16 Jan 2025 19:22 by xenon-alien.
Please Log in or Create an account to join the conversation.
- xenon-alien
- Away
- Premium Member
Less
More
- Posts: 136
- Thank you received: 3
16 Jan 2025 19:09 - 16 Jan 2025 19:18 #319136
by xenon-alien
Replied by xenon-alien on topic Carousel with step motor
Is there any documentation which is explaining all type of connections?
Like e.g.:
encoding - The position encoding. ( Default = ’gray’)
1) gray - ... (needed pins in the component, scheme, a picture how it looks, hal file example maybe)
2) binary - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
3) bcd - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
4) index - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
5) edge - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
6) counts - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
7) single - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
8) Saw somewhere positioning by an encoder feedback - (needed pins in the component, scheme, a picture how it looks, hal file example maybe)
Driver control mode:
1) step/dir (Stepper/servo motor - needed pins in the component, scheme, a picture how it looks, hal file example maybe)
2) analog (Servo morotr/ VFD - needed pins in the component, scheme, a picture how it looks, hal file example maybe)
3) Forward/Reverse - 2 pin control (DC/ AC motors - needed pins in the component, scheme, a picture how it looks, hal file example maybe)
Like e.g.:
encoding - The position encoding. ( Default = ’gray’)
1) gray - ... (needed pins in the component, scheme, a picture how it looks, hal file example maybe)
2) binary - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
3) bcd - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
4) index - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
5) edge - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
6) counts - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
7) single - ...(needed pins in the component, scheme, a picture how it looks, hal file example maybe)
8) Saw somewhere positioning by an encoder feedback - (needed pins in the component, scheme, a picture how it looks, hal file example maybe)
Driver control mode:
1) step/dir (Stepper/servo motor - needed pins in the component, scheme, a picture how it looks, hal file example maybe)
2) analog (Servo morotr/ VFD - needed pins in the component, scheme, a picture how it looks, hal file example maybe)
3) Forward/Reverse - 2 pin control (DC/ AC motors - needed pins in the component, scheme, a picture how it looks, hal file example maybe)
Last edit: 16 Jan 2025 19:18 by xenon-alien.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
Less
More
- Posts: 1837
- Thank you received: 743
16 Jan 2025 21:08 #319147
by spumco
Replied by spumco on topic Carousel with step motor
There is documentation for carousel.comp which explains what all the pins are as well as encoder schemes. I'll admit that without some context or experience not everything is obvious.
In your case, I suggest using encoder mode INDEX. As long as your proximity sensors & flags provide a tight, repeatable location that should be fine.
Note that the home and pocket signals must be at the pocket center, not between the pockets (as mentioned in your first post). There can be some offset between the home and pockets, manageable with pin carousel.N.home-offset... but I'd suggest aligning everything as close a possible mechanically.
I've attached my ATC-specific HAL and INI files. The INDEX encoder scheme does not require carousel.N.scale or stepgen.N.position-scale - those are just for COUNTS mode - but I haven't removed them yet from my config. You won't need them.
The basic arrangement looks like this:
Please let me know if you need some help deciphering the files I sent - there may be a couple signals connected in other HAL files not included here.
In your case, I suggest using encoder mode INDEX. As long as your proximity sensors & flags provide a tight, repeatable location that should be fine.
Note that the home and pocket signals must be at the pocket center, not between the pockets (as mentioned in your first post). There can be some offset between the home and pockets, manageable with pin carousel.N.home-offset... but I'd suggest aligning everything as close a possible mechanically.
I've attached my ATC-specific HAL and INI files. The INDEX encoder scheme does not require carousel.N.scale or stepgen.N.position-scale - those are just for COUNTS mode - but I haven't removed them yet from my config. You won't need them.
The basic arrangement looks like this:
- Stepper drive commanded via Mesa stepgen
- Stepgen in velocity mode
- Carousel.comp
- carousel.N.motor-vel connected to stepgen.N.velocity-cmd
- enable pin connected to a motion.digital-out pin (triggered via g-code subroutine)
- destination pocket connected to motion.analog-out pin (also set via g-code subroutine)
- this requires an intermediate conversion from float to s32 (analog-out is float, carousel.N.pocket-number is s32)
- homed & ready pins connected to motion.digital-in pins (for safety checks during g-code)
- sense-0 & sense-1 connected to home & per-pocket sensors
- fwd-dc and rev-dc control rotational speed (along with stepgen.N.maxvel & maxaccel)
- align-dc & decel-time control the fine-alignment speed
Please let me know if you need some help deciphering the files I sent - there may be a couple signals connected in other HAL files not included here.
The following user(s) said Thank You: xenon-alien
Please Log in or Create an account to join the conversation.
- xenon-alien
- Away
- Premium Member
Less
More
- Posts: 136
- Thank you received: 3
17 Jan 2025 06:21 - 17 Jan 2025 07:02 #319157
by xenon-alien
Replied by xenon-alien on topic Carousel with step motor
@spumco
Thanks for the information and the files!
But now i have just 1 sensor - the index (sense-0).
There are no pocket sensor for sense-1.
Need i put one more sensor for pocket?
I thought 1 sensor enough for a stepper type control mode to home the "axis" and the position of each tool is known.
Before there was a KFLOP system with tool change in the config file[/code]
[/code]
[/code][/code]
Thanks for the information and the files!
But now i have just 1 sensor - the index (sense-0).
There are no pocket sensor for sense-1.
Need i put one more sensor for pocket?
I thought 1 sensor enough for a stepper type control mode to home the "axis" and the position of each tool is known.
Before there was a KFLOP system with tool change in the config file
[code][code]#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "C:\KMotion434j\C Programs\KflopToKMotionCNCFunctions.c"
//-----------------------------------------
// LINEAR TOOL CHANGING
//-----------------------------------------
#define AXISX 0
#define AXISY 1
#define AXISZ 2
#define AXISB 4
//---------Absolute position of tool holders
#define HOLDER_B_1 18.28
#define HOLDER_B_2 48.28
#define HOLDER_B_3 78.28
#define HOLDER_B_4 108.28
#define HOLDER_B_5 138.28
#define HOLDER_B_6 168.28
#define HOLDER_B_7 198.28
#define HOLDER_B_8 228.28
#define HOLDER_B_9 258.28
#define HOLDER_B_10 288.28
#define HOLDER_B_11 318.28
#define HOLDER_B_12 348.28
#define HOLDER_Y -151
#define HOLDER_Z -147.68
// absolute position of the tool height setting plate
#define SOFT_LIMIT_X_SHIFT_POS 700
#define SOFT_LIMIT_Y_SHIFT_POS -151
// absolute position to move to that is permanently unobstructed, and safe to move down in Z
#define TOOL_CHANGE_SAFE_POS_X 753
#define TOOL_CHANGE_SAFE_POS_Y -151
#define TOOL_CHANGE_POS_X 819.34
#define TOOL_CHANGE_POS_Y -151
#define AXIS_SAFE_DISTANCE_X 600 // distance in mm to approach tool holder
#define Z_1 -1
//---------
//--------- Spindle IO bits
#define CLAW_EJECT 52 // IO bit to eject tool from spindle (KONNECT OUTPUT 10)
#define SPINDLE_CLEAN 51 // IO bit to blow air out of spindle taper (KONNECT OUTPUT 11)
#define CLAW_LOOSE 1041 // IO bit to sense whether the claw has ejected (KONNECT INPUT 24)
#define TOOL_SENSE 1040
#define CHENGER_OPENED 1042
#define CHENGER_CLOSED 1043
#define OPEN_CHENGER 58
#define CLOSE_CHENGER 59
// IO bit to sense whether the a tool is in the spindle (KONNECT INPUT 24)
//---------
#define TOOL_VAR 9 // Tool changer desired new tool Var
// Tool changer Last tool loaded is saved globally in this Var
#define LAST_TOOL_VAR 8 // -1=Spindle empty, 0=unknown, 1-12 Tool Slot loaded into Spindle
#define TOOL_DISK_FILE "C:\\KMotion434j\\C Programs\\User\\temp\\ToolChangerData.txt"
#define CLAMP_TIME 2.0 // seconds to wait for the clamp/unclamp
#define CHANGER_OPENING_TIME 2.0 // seconds to wait for the OPEN/CLOSE CHANGER
#define TOOL_HEIGHT_BIT 1055 //bit to read tool height plate (KONNECT INPUT 31)
#define SAFE_HEIGHT_Z 10
#define SAFE_HEIGHT_Z1 100 // relative distance in mm to move to clear the top of the tool taper
#define TOOL_RETRACT_SPEED_Z 45.0 //speed in mm/second to move spindle up after tool has been ejected
#define SlowSpeed 150.0 //mm/sec
#define SlowSpeedB 80 //deg/sec
#define Time_to_open 2
float S=0;
[/code]
[code][code]I hope the home-offset will be fine in my case
P.S.: My native language is not English and I'm a building engineer. So, the coding part a little difficult for me to understand. Never used those concepts such as velocity mode or position mode and how they differ, or other stuff.
But if there is an example, or description with images, schemes, it much more easier for me. (simple text reading is difficult to understand for me)
Last edit: 17 Jan 2025 07:02 by xenon-alien.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
Less
More
- Posts: 1837
- Thank you received: 743
17 Jan 2025 18:01 #319198
by spumco
My apologies - I misunderstood your earlier post and thought you had multiple sensors.
With just a home sensor, you can use COUNTS mode. In COUNTS mode, carousel homes to the sensor at first enable. From then on all moves are based on the number of steps between pockets.
Which means there is no feedback between the ATC and LCNC. If you use this mode I strongly recommend using a closed-loop stepper or a servo and connecting the drive fault output to an input on LCNC so LCNC will 'trip' in the case of a drive fault. Otherwise, if the motor misses steps LCNC does not know it and the tool changer will continue... likely leading to a crash.
Pins/parameters used in COUNTS mode are slightly different than what I posted earlier for INDEX mode. I will look through my older test configs and see if I can find a copy when I tried COUNTS mode. Be aware that I couldn't get it working reliably, but there may have been changes in the carousel.comp code calcs which result in reliable operation.
Replied by spumco on topic Carousel with step motor
@spumco
Thanks for the information and the files!
But now i have just 1 sensor - the index (sense-0).
There are no pocket sensor for sense-1.
Need i put one more sensor for pocket?
I thought 1 sensor enough for a stepper type control mode to home the "axis" and the position of each tool is known.
My apologies - I misunderstood your earlier post and thought you had multiple sensors.
With just a home sensor, you can use COUNTS mode. In COUNTS mode, carousel homes to the sensor at first enable. From then on all moves are based on the number of steps between pockets.
Which means there is no feedback between the ATC and LCNC. If you use this mode I strongly recommend using a closed-loop stepper or a servo and connecting the drive fault output to an input on LCNC so LCNC will 'trip' in the case of a drive fault. Otherwise, if the motor misses steps LCNC does not know it and the tool changer will continue... likely leading to a crash.
Pins/parameters used in COUNTS mode are slightly different than what I posted earlier for INDEX mode. I will look through my older test configs and see if I can find a copy when I tried COUNTS mode. Be aware that I couldn't get it working reliably, but there may have been changes in the carousel.comp code calcs which result in reliable operation.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
Less
More
- Posts: 1837
- Thank you received: 743
17 Jan 2025 19:41 #319216
by spumco
Replied by spumco on topic Carousel with step motor
One of my older HAL files using COUNTS mode is attached.
Some differences from my earlier INDEX mode summary:
The section on Mesa card stepgens is here:
linuxcnc.org/docs/devel/html/man/man9/hostmot2.9.html#stepgen
But I think the generic stepgen component description is a little easier to understand.
Some differences from my earlier INDEX mode summary:
- Stepgen is in position mode
- carousel.N.scale is stepgen pulses per pocket
- carousel.N.counts is connected to stepgen.N.counts
- carousel.N.counts-target is connected to stepgen.N.position-cmd
[b]stepgen[/b] has two control modes, which can be selected on a channel by channel basis using [b]ctrl_type[/b]. Possible values are "[b]p[/b]" for position control, and "[b]v[/b]" for velocity control. The default is position control, which drives the motor to a commanded position, subject to acceleration and velocity limits. Velocity control drives the motor at a commanded speed, again subject to accel and velocity limits. Usually, position mode is used for machine axes. Velocity mode is reserved for unusual applications where continuous movement at some speed is desired, instead of movement to a specific position.
The section on Mesa card stepgens is here:
linuxcnc.org/docs/devel/html/man/man9/hostmot2.9.html#stepgen
But I think the generic stepgen component description is a little easier to understand.
Please Log in or Create an account to join the conversation.
Time to create page: 0.092 seconds