Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test joint encoder #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Test joint encoder #4

wants to merge 3 commits into from

Conversation

MartinLocker
Copy link
Collaborator

Create code for test joint encoder.
Calibration joint:

  1. In file main.cpp on row 4 set "AS5600 as5600(0);"
  2. Connect joint encoder to esp board and upload test.
  3. The terminal should display the current value of the joint position.
  4. Position the robot in a straight line and read the value.
  5. In file main.cpp on row 4 in "AS5600 as5600(?);" write the determined value
  6. Upload to esp board and test it.

@@ -0,0 +1,20 @@
#ifndef AS5600_H
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this your file or some official library? If your, can you please add extra comment what "AS5600" is? I guess some hall sensor(?) and the class provides info about conversion to degrees? I would maybe mention it with angle() function too as other may expect radians ;). Thanks

*/

/*
bool cap_ISR_cb(mcpwm_unit_t mcpwm, mcpwm_capture_channel_id_t cap_channel, const cap_event_data_t *edata,void *user_data){ //this function need to be in that format to be recognized as cap_isr_cb_t type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this code commented out?

int z = as5600.angle();
Serial.printf("Width: %5d Angle: %3d.%02d\n\r", x, z/100, abs(z%100));
delay(100);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add EOLN?

platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
upload_port = COM8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like specification of upload_port makes some troubles - in my case I need /dev/ttyUSB0 ... but when I used the Communication (?) project this was commented out and autodetect (?) worked fine

@m3d
Copy link
Member

m3d commented Jan 11, 2025

In the terminal I see:

Width:  2113 Angle: 172.42
Width:  2109 Angle: 172.42
Width:  2113 Angle: 172.51
Width:  2113 Angle: 172.51
Width:  2113 Angle: 172.51
Width:  2113 Angle: 172.51
Width:  2113 Angle: 172.42
Width:  2114 Angle: 172.51

I guess the float number is the expected init value, correct?

@m3d
Copy link
Member

m3d commented Jan 11, 2025

p.s. nice :) - I used 185.52 for preliminary calibration and it works nice ... I am glad that we have the same angles (mathematical), i.e. positive angle to the left

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants