Share:
Notifications
Clear all

ROBOT_AXIS_DEFINITION and changing origin point of Robot


6fdbb42c8cff88acf2cc1e85b2cc9e02?s=80&d=mm&r=g
(@dsgbros)
Active Member
Joined: 2 months ago
Posts: 6
Topic starter  

Hello Everyone,

Can someone explain me about “ROBOT_AXIS_DEFINITION -90*GRAD2RAD” Variable? How did we decide to use -90 multiplier?

Can I change origin of robot to some other position instead of both link extending straight?


Quote
1749da22343b0d85c39164b5c6f52fed?s=80&d=mm&r=g
(@mappler)
Eminent Member
Joined: 4 months ago
Posts: 23
 
Posted by: @dsgbros

Hello Everyone,

Can someone explain me about “ROBOT_AXIS_DEFINITION -90*GRAD2RAD” Variable? How did we decide to use -90 multiplier?

Can I change origin of robot to some other position instead of both link extending straight?

I think that section of the code is not used for initial position.  That is only used for Kinematic movement.  Note: This code is not particularly easy to read.

I think the code you want to modify if you want a different “starting” position is in the function “motorsCalibration”.

This function runs the two motors to their extreme position, forces them to skip steps (which is being used as an ‘endstop’).   Once done, it then runs this code to center the robot:

// Force the robot to its initial centered position
target_angleA1 = ROBOT_INITIAL_POSITION_M1; // Force the robot to loose steps (if necessary) and reach the final position
target_angleA2 = ROBOT_INITIAL_POSITION_M2 + ROBOT_INITIAL_POSITION_M1 * AXIS2_AXIS1_correction;
target_position_M1 = target_angleA1 * M1_AXIS_STEPS_PER_UNIT;
target_position_M2 = target_angleA2 * M2_AXIS_STEPS_PER_UNIT;
working = true;
digitalWrite(11, LOW); // Enable motors
while (working) {
positionControl(1000);
delay(1); // 1Khz loop
}

I think this is where you want to change if you want a different initial position.

Looking further, I think you can actually just modify these global variables located in Configuration.h :

#define ROBOT_INITIAL_POSITION_M1 0
#define ROBOT_INITIAL_POSITION_M2 0
#define ROBOT_INITIAL_POSITION_M3 0

 -Matt


DSgbros liked
ReplyQuote
6fdbb42c8cff88acf2cc1e85b2cc9e02?s=80&d=mm&r=g
(@dsgbros)
Active Member
Joined: 2 months ago
Posts: 6
Topic starter  

@mappler Thanks alot for reply.

Posted by: @mappler

#define ROBOT_INITIAL_POSITION_M1 0
#define ROBOT_INITIAL_POSITION_M2 0
#define ROBOT_INITIAL_POSITION_M3 0

I will change these variables and try.

Posted by: @dsgbros

“ROBOT_AXIS_DEFINITION -90*GRAD2RAD”

Since this was used in inverseKinematics function, I was wondering if there will be any change in this variable with origin change. Because if origin changes, then calculation in inverse kinematics function will also change, because all the coordinates are calculated with respect to origin maybe.

Let me try this and update you.


mappler liked
ReplyQuote
6fdbb42c8cff88acf2cc1e85b2cc9e02?s=80&d=mm&r=g
(@dsgbros)
Active Member
Joined: 2 months ago
Posts: 6
Topic starter  

Hello,

One more question. I want to change the initial position in the software which is provided to control the robot as well. I am using mac. Can you please suggest change in the python code as well?

This post was modified 4 weeks ago by DSgbros

ReplyQuote
1749da22343b0d85c39164b5c6f52fed?s=80&d=mm&r=g
(@mappler)
Eminent Member
Joined: 4 months ago
Posts: 23
 

@dsgbros

I haven’t done anything with the python app yet unfortunately (other than run the executable).

I need to focus a little. 🙂  I’ve got 3 different robotics projects going on and I keep bouncing between them!

 -Matt


DSgbros liked
ReplyQuote
6fdbb42c8cff88acf2cc1e85b2cc9e02?s=80&d=mm&r=g
(@dsgbros)
Active Member
Joined: 2 months ago
Posts: 6
Topic starter  

@mappler Thank you for the reply 🙂

I will do some trial and error in the python code to see if I can change the origin position.


ReplyQuote
Share: