Reset machine coordinates on special machine.

More
4 years 3 months ago - 4 years 3 months ago #246623 by cakeslob

I think it must be an axis because it needs trajectory planning between x y z and a.

Keeping this in mind
I dont know how the lengths are sent to the machine or how the programs look, but the machine feeds pizza in one direction (x), of variable lenghts, from a giant 1km long spool of pizza, and then a axis pizza cutter cuts it. With a 1 pizza per minute cycle time, and several other servos that I will assume are for things like cheese control, sauce spreading and anchovy distribution, but you have these axis under control.

Does the 1km pizza spool need to be X axis?

Could it be like an external stepgen in hal (synced with tc comp?) with a remapped letter code like E and commanded incrementally? Or something in classic ladder?

If you only need it to feed an variable incremental amount of pizza every cycle, does that feed roller need to be X axis or can it be something else, like how paste extruders, or 3d printers, or like a bar stock cnc lathe?
Last edit: 4 years 3 months ago by cakeslob.

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

More
4 years 3 months ago #246735 by BigGray
The Pizza cutter cuts shapes in the "pizza", like a star for example.

The A axis calculates the amount of turns of the cutter wheel needs to make it travels from current to commanded position.
An extruder is similar, I just don't need to store the amount of turns the cutter made as it needs to be reset for the following piece.

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

More
4 years 3 months ago #246751 by BigGray
Thanks Andy I had a quick look at it.
Did not see a function which would do what I wanted.
CANON_POSITION GET_EXTERNAL_POSITION just finds the current positon.


Looking trough the code, homing.c has the homing functions.

HOME_SET_SWITCH_POSITION sets the joint offset on the final move.
joint->pos_cmd+=offset;
joint->pos_fb+=offset;
joint->free_tp.curr_pos+=offset;
joint->motor_offset-=offset;

Those are defined in motion.h
double pos_cmd //commanded joint position
double pos_fb //position feedback ; comp removed
double motor_offset /* diff between internal and motor pos, used to set position to zero during homing*/

I suspect I cannot access those variables while running gcode;

In EMC_NML.hh I found;

EmcPose postion //current commanded position
EmcPose actualPostion //current actual postion ; from forward kins

Trajectory planner (tp.c) has tp-> currentPos
hmm maybe i could reset A in
int tpCompleteSegment(....) //cleanup after a trajectory segment is complete

Looking at it trajectory planner tp-> currentPos looks like the right var to reset for A
could hardcode that.

X needs to be reset at every cutoff, seems a bit weird to have to access trajectory planner for that.

Or am I completely wrong and is the current positon not in tp->currentPos?


Well yea seems to be in motion.h
emcmot_internal_t struct has a member called coord_tp which contains currentPos.

Can I just update currentPos like that or will that result in something weird?

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

More
4 years 3 months ago #246757 by chris@cnc
Did we have the G91 option? It's possible to use program in incremental mode?
Another idea is to use external encoder and the "encoder.N.reset bit".
I think two simple sensors count and one proxy reset. 
linuxcnc.org/docs/stable/html/man/man9/encoder.9.html
The following user(s) said Thank You: BigGray

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

More
4 years 3 months ago #246946 by BigGray
G91 would make programming too difficult.

encoder.N.reset bit indeed works, also works while running g-code.

Unfortunately it causes a following error which disables the drives.
If i reenable the drives the reset indeed has completed.

I tried disabling the pid loop but still got the following error.

using hal configuration both pos_cmd and pos_fb are reset to zero as well.

Any ideas how to fix the following error?

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

More
4 years 3 months ago #247329 by andypugh
Can you explain why having very large numbers in the machine absolute coordinates is a problem?
If you display the working coordinates you won't see them.

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

Time to create page: 0.074 seconds
Powered by Kunena Forum