Lichuan 4 axis stepper need help-

More
9 months 1 day ago #342230 by rodw
I've totally rewritten it anyway. I was able to move the state machine into a seperate procedure which has substantially streamlined the code. Now I just have to get it to compile image missing /media/kunena/emoticons/shocked.png

A lot of that does not need to be in the component because you are setting the pin externally. But we may need to scale or otherwise calculate data for them in which case they need to pass through the component. Get the basics first....

write all becomes something like
Code:
FUNCTION(writeall) { // Restart sequence on rising edge of enable if (enable && !data.prev_enable) data.control.raw = 0x0000; data.prev_enable = enable; if (enable) { int drive_ready = runCiA402StateMachine(&__comp_inst); if (drive_ready) { if (homing) { opmode_out = 6; // Homing Mode // Bit 4 starts homing; check for errors before commanding if (!data.status.bits.op_error) data.control.bits.op_specific = 1; } else { opmode_out = (s8)default_opmode; data.control.bits.op_specific = 0; // Clear Bit 4 // Normal Motion drive_target_position = (s32)(target_position * pos_scale); drive_target_velocity = (s32)(target_velocity * vel_scale); } } } else { data.control.raw = 0x0006; // Shutdown / Disable Voltage } controlword_out = data.control.raw; }
 
homing feedback is in the read command

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

More
8 months 4 weeks ago #342358 by rodw
Bear with me on this project.  multi axis slaves need to be managed from a single instance so the current cia402.comp will only service the first motor on the slave. I have spent a lot of time writing a new component for cia402 drives and I finally was able to try it on a drive and get movement today but it  was only on the first drive just like the current component. Now I know what I am doing I need to clean up all my debugging code and then refactor it using an array of drives in a single component. I was hoping to use a personality on the component to define the array count but not 100% sure how to set that up to define the pin array.

Its all very promising though!
The following user(s) said Thank You: NWE

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

More
8 months 4 weeks ago - 8 months 4 weeks ago #342359 by NWE
Looking forward to it... image missing /media/kunena/emoticons/smile.png
My 4 axis ethercat open loop steppers order status still "Preparing to ship" since Jan 23. I messaged them once lately and they acted like it will ship soon, even showed me photos of the packaged shipment. This is the same as my previous experience getting products halfway around the globe. No rush so far as I'm concerned, I got too many irons in the fire lately. image missing /media/kunena/emoticons/smile.png
Last edit: 8 months 4 weeks ago by NWE.
The following user(s) said Thank You: rodw

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

More
8 months 4 weeks ago #342360 by rodw
hmm, mine were in stock and I  had them in about 5 days for the drive only. So I can take my time then :)
The following user(s) said Thank You: NWE

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

More
8 months 4 weeks ago #342362 by NWE
Wow, I just discovered UPS tracking says I get them tomorrow! image missing /media/kunena/emoticons/smile.png
They say it is a 17LB package, the open loop drive + four Nema 23 motors.

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

More
8 months 4 weeks ago #342363 by Hakan
Now you are in the middle of your way of fixing it,
but did you try to go to op-enabled without the cia402 component?
Set controlword and watch statusword in halshow for the second drive?
I can not see why doing it in one component should be any different
than doing it in four separate components. I'll see what you come up with.
For personalities or configurable pins, check for example the sampler component.
 

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

Time to create page: 0.482 seconds
Powered by Kunena Forum