Cailbrating the servos

check servo motors positions, make first shots. If needed, you will have to update BADDY code on PCB (changing configured speeds)

Moderator: BADDY Core

Post Reply
User avatar
Nihilo
Posts: 10
Joined: Fri Jan 26, 2018 6:53 pm

Cailbrating the servos

Post by Nihilo » Fri Apr 06, 2018 12:22 pm

Hi All,

I'm following step by step the guide on the forum.
After I tweaked the number how do I test all 4 positions of the retainer and switch?

I uploaded the BADDY_EMBEDDED_CODE_ARDUINO_V01_PROXSENSOR. Am i correctly using the right sketch for this step?

the code starts with:

void setup()
{
Serial.begin(9600);
Serial.println("BADDY Arduino is ready");

// Bluetooth default serial speed for communcation mode is 9600
BTserial.begin(9600);

//Attach motor pins
ShuttleSwitch.attach(SHUTTLE_SWITCH_PIN);
ShuttleSwitch.write(SWITCH_SHORT_POSITION);
ShuttleRetainer.attach(SHUTTLE_RETAINER_PIN);
ShuttleRetainer.write(RETAINER_DOWN_POSITION);
MotorRight.attach(MOTOR_RIGHT_PIN);
MotorLeft.attach(MOTOR_LEFT_PIN);
....

I might using the wrong code as the servos go to the initial position only.

Thanks

User avatar
baddyteam
Site Admin
Posts: 139
Joined: Thu Dec 14, 2017 10:03 am

Re: Cailbrating the servos

Post by baddyteam » Fri Apr 06, 2018 2:08 pm

Hi Nihi,

Please don't use the PROXENSOR version for now, you will be able to use it once everyone will activate the IR detector (detects that no more shuttle in the feeder and makes motor stop and sequence abort).

You shall find a section within the code that looks like that:

Code: Select all

//Switch movement and timers
int SWITCH_LONG_POSITION = 68;
int SWITCH_SHORT_POSITION = 140;
int SWITCH_WAIT_POSITION = 90;
int SWITCH_TIMER = 220; // value in millisecond to wait Switch to fetch its long position
int SWITCH_SPEED=600; // Special speed for slow motion movement (configuration)

// Shuttle retainer movemement and timers
int RETAINER_UP_POSITION = 119;
int RETAINER_DOWN_POSITION=190;
int RETAINER_TIMER=120;
If you need to adjust the position of your switch and retainer. This is where you shall have a look. When BADDY is waiting for shooting, the retainer is DOWN and the switch is SHORT.

Let's says that your Switch's SHORT's position needs to be put backward a little bit, to allow the shuttle cock to position accurately before shooting. Then you will have to change "140" into "145", maximum "150" - don't use deltas/steps of more than 10 units.

Configuring BADDY is the most complex part of the tuto. Don't hesitate to ask questions and support

User avatar
Nihilo
Posts: 10
Joined: Fri Jan 26, 2018 6:53 pm

Re: Cailbrating the servos

Post by Nihilo » Fri Apr 06, 2018 2:53 pm

Please don't use the PROXENSOR version for now, you will be able to use it once everyone will activate the IR detector (detects that no more shuttle in the feeder and makes motor stop and sequence abort).
I looked into "BADDY Arduino Embedded code" thread.

The first post leads to the PROXENSOR version only. I don't see other versions available for download, maybe it's just me. Can you post the link?

Modifying the values is clear, but when I turn on arduino I can only test and see the switch's short position and retainer's down position.
How can I test switch's long position and retainer's up position? in this step I should calibrate all 4 parameters according to the video, isn't it?

Many thanks!

User avatar
baddyteam
Site Admin
Posts: 139
Joined: Thu Dec 14, 2017 10:03 am

Re: Cailbrating the servos

Post by baddyteam » Fri Apr 06, 2018 4:04 pm

Hi Nihi,

You have to run the GO BADDY app, and click on "Configure". In the interface, ou have to click on "FIRE" in order to test both retainer and switch's positions - "FIRE" button makes everything move slomo, to let you time to check every positions' accurate.

Bizarre that you can't access the V1 Arduino code file. See the picture below:
You do not have the required permissions to view the files attached to this post.

User avatar
Nihilo
Posts: 10
Joined: Fri Jan 26, 2018 6:53 pm

Re: Cailbrating the servos

Post by Nihilo » Mon Apr 09, 2018 10:07 pm

Hi all

I'm still calibrating the servos. I am testing the fire process and I noticed that sometimes the shuttlecock get stock while the retainer just moved to down position. I need to set the retainer down position a bit more lower so that the shuttle can fully drop into the switch.
The problem is that values over 200~ have no effect. I started from 170 all the way up to 200. 200 seems the limit. I can manually move down the retainer so it means there is still room for travelling but somehow it gets stock at that position.

Code: Select all

//Switch movement and timers
int SWITCH_LONG_POSITION = 95; //was 60. small value = close to motor
int SWITCH_SHORT_POSITION = 127;
int SWITCH_WAIT_POSITION = 90;
int SWITCH_TIMER = 220; // value in millisecond to wait Switch to fetch its long position
int SWITCH_SPEED=600; // Special speed for slow motion movement (configuration)

// Shuttle retainer movemement and timers
int RETAINER_UP_POSITION = 130; //was 105  //small value = close to top
int RETAINER_DOWN_POSITION = 220; //was 175
int RETAINER_TIMER=120;
As you see the images below I need to set the retainer a bit lower. But increasing value of RETAINER_DOWN_POSITION after 200 is not changing the position anymore.
Image
Image

What is the cause?

Thanks!
Last edited by Nihilo on Wed Apr 11, 2018 12:57 pm, edited 1 time in total.

User avatar
baddyteam
Site Admin
Posts: 139
Joined: Thu Dec 14, 2017 10:03 am

Re: Cailbrating the servos

Post by baddyteam » Tue Apr 10, 2018 1:00 pm

Hi Nihi,

That's due to servos properties, not understanding the PWM signals sent by Arduino above a certain limit.

Glad you have met this issue ;)

My 2 cent recommendations would be to:
- switch BADDY off
- Unmount your retainer from the servos's shaft
- In Arduino code, translate the retainer's positions' range with a 50 units' shift - 130/200 become 80/150
- Update your code on Arduino
- switch BADDY on (retainer servo gets the LOW's initial's position)
- Remount your retainer
- Test positions until you get what you want. Make sure that the retainer's UP position makes the retainer go as close as possible to the neck without any collision on the way up and down - that's the role of the retainer who has to retain the weight of 30 shuttlecocks above him

Good luck! You're almost done!

Cheers,

User avatar
Nihilo
Posts: 10
Joined: Fri Jan 26, 2018 6:53 pm

Re: Cailbrating the servos

Post by Nihilo » Sun Apr 15, 2018 2:07 pm

Sorry for the late reply.
I finally managed to configure the servo properly and successfully fire a shuttle in configuration mode. It seems working pretty neatly. Good job on the clever fireroom mechanism.

Something I don't understand in configuration is when the speed is set to 800 and press "set speed" (I don't remember the name of the button) the motors don't keep spinning, instead they spin for 1 sec and stop. if you set let's say 950 they keep spinning. Is that intended?

Question.
Can you let us know how the "speed" parameter is related to the actual rpm of the motors?

And what's the max rpm we can achieve? On the motor datasheet if I remember correctly it's said max rpm 4800. If I set to maximum speed I should reach the max rpm, is this correct?

I will be absent for 2 weeks but I promise I will share my thoughts, improvements once I tested it.
Thank you for the support!

Cheers,

- Nihilo

avidivaddi
Posts: 2
Joined: Tue Jan 07, 2020 4:45 pm

Re: Cailbrating the servos

Post by avidivaddi » Fri Jan 10, 2020 7:18 am

Hi Nihilo or baddy team,

Could you please help me with model name of the brushless motors ?

Or datasheet link please. I am trying to build it myself.


Thanks,

Post Reply