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

Brushless ESC #2

Open
infernos90 opened this issue May 26, 2023 · 34 comments
Open

Brushless ESC #2

infernos90 opened this issue May 26, 2023 · 34 comments

Comments

@infernos90
Copy link

Hello again. This work with brushless ESC?

@meltoner
Copy link
Owner

yep

@infernos90
Copy link
Author

I was unable to arm the motor.

@meltoner
Copy link
Owner

can you send me a picture of what you have done?

@meltoner
Copy link
Owner

I would guess that maybe your connections are wrong, or the pin was set incorrectly.
For your info, the arm command is visible within the Throttle::setup(Context &_context) function see lines 18 and 19.
If you still have issues the best approach is to make a hello world example that only arms the motor and then spins it. once you achieve that you ll be able to see what was out of place in your code currently.

@infernos90
Copy link
Author

infernos90 commented May 26, 2023

I assambled everything to a testing board. Tomorrow i will soldering everything and testing again. This part " (byte pin){
_pin = pin;" from the code, is attributing automatically adress pin for every components?

@meltoner
Copy link
Owner

yes Throttle is parametrised on its pin, on UAVRC_MEGA.ino on line 33 you see Throttle throttle(2); this means that the esc should be put on D2

@infernos90
Copy link
Author

Ok, i understand.
What is the role of the "hook" in this project?

@meltoner
Copy link
Owner

for fishing, drops the hook

@infernos90
Copy link
Author

infernos90 commented May 26, 2023 via email

@meltoner
Copy link
Owner

give it a try to find it on your own, you would search where the object hook is used.
if you can't find it, ill check it out for you

@infernos90
Copy link
Author

Switch B!

@meltoner
Copy link
Owner

bravo inferno90 !

@infernos90
Copy link
Author

Look at this video. Only beeping from ESC and not arming.

https://youtu.be/g7Y91y6uPNA

IMG20230527180852
IMG20230527180847
IMG20230527180851
IMG20230527180830
IMG20230527180844

@meltoner
Copy link
Owner

nice work !!

i noticed that you haven't actually connected the esc to the board. it should be connected to the arduino instead of the flysky receiver have a look at some more detailed photos of the fabrication in the attached pdf.

its flysky -> arduino -> esc, servo
(see the horizontal ibus cable (in,out) do slot them in the vertical slots)

phase2_prototype_fabrication.pdf

In case its helpful i had also made a board like a shield so you can detach the whole thing. Although it may not be that obvious the first image in the repository shows the "board".

I also understand that you have went to assemble everything in one go, which is also what i usually do and then get a hell of debugging in view of one just error. the proper way to do it is incrementally, i.e. first verify X then verify y and etc. i also noticed that you are using a regular led instead of an rgb. off course its not mandatory.

just take it step by step and it would also be very helpfull to also use the serial cable to print out on terminal the various phases the board undergoes during initialization.

since you have made this progress i am confident you with few careful iterations you reach the desired goal.

insane work! bravo

@infernos90
Copy link
Author

Maybe you didn't see correctly, but ESC is connected to pin D2. In the video i changed ESC connection to pin D2, D4 și D6 and not arming....

@meltoner
Copy link
Owner

meltoner commented May 28, 2023

mmm yes, i see in the video its different from the photos.

  1. note that the arm can happen if the motor takes power and the arduino takes power simultaneously. arming happens within the first power up.

  2. what about the other stuff, does the servo (steer) move while connected to d4, i didn't see a movement in the video ?

  3. how about if you connect a usb to read up the serial? context.apply(); prints out almost all internal details, so you can see can checkout what work and what doesn't work.

  4. having done 3 you can also add in the setup function of each module a print like Serial.print("setting up mpu"); so you can see if something fails which would pauses the boot up sequence all together. for example the mpu might say while(mpuIsNotAvailable); wait until it is.

@infernos90
Copy link
Author

I have fs-ia6b receiver and in your project is fs-ia10b receiver. Maybe it is a problem?

@meltoner
Copy link
Owner

probably not, since it has an ibus slots..

do you know how to see the serial print out of the board ? to see whats is happening? as you after you upload the firmware just open up serial from arduino cli

@infernos90
Copy link
Author

infernos90 commented May 28, 2023

IMG20230528130155

@infernos90
Copy link
Author

16852686074633511180862840240795

@meltoner
Copy link
Owner

ok its should print more after the mpu so something is interrupted, though mpu is after the throttle. in any case

after the mpu its the mag, i see no printout there in its setup, next is hook, ok next is gps. the gps setup function does print Serial.print("setup"); so since i do not see it in the print i understand that something before it fails. this apears to be the mag.

  mpu.setup(context);           rgb.apply_color(3);  delay(500); // yellow
  mag.setup(context);           rgb.apply_color(4);  delay(500); 
  hook.setup(context);          
  gps.setup(context);           rgb.apply_color(5);  delay(500);
  steer.setup(context);         
  battery.setup(context);       
  home.setup(context);          rgb.apply_color(6);  delay(500);
  invoker.setup(context);
  relayA.setup(context);
  relayB.setup(context);        context.color = 3;  delay(500);
  remote.setup(context);        
  telemetry.setup(context);

Add there in mag more print out to see if it passes from that place. although these are after the throttle pass over everything to ensure all components are setuped properly. At the end of the program setup sequence, its should enter in the loop sequence and every 1 second it should reflect all sensors readings via the context.apply()

@infernos90
Copy link
Author

I connected SCL and SDA from mpu and mag to same pin. It is correct?

@meltoner
Copy link
Owner

i think its not. According to the diagram , https://github.com/meltoner/NEM_UAVRC_MEGA/blob/main/pcb/NEM_UAVRC_MEGA_CONNECTIONS.png i see in the green area, that the magnetometer/compass is assigned to an RX pin.

@meltoner
Copy link
Owner

the 15th outer pin counting from the left as i see the diagram

@infernos90
Copy link
Author

According to your diagram, SDA from mpu and mag is connected both to pin 20 and SCL from mag and mpu connected both to pin 21

@infernos90
Copy link
Author

the 15th outer pin counting from the left as i see the diagram

This pin is for gps module according to your diagram.

@meltoner
Copy link
Owner

meltoner commented May 28, 2023

my gps has a magnetometer embedded. that is why the look as the same module.
one of the uses the sda and the other the tx/rx

@meltoner
Copy link
Owner

Yes you are correct, as you stated above. gps uses the serial the mpu and mag use sda and scl. checked it out in haste
About how to debug the remedy is to add Serial.print and see where the execution stops to determine where is the problem.
for example you have to find out which was the last module starting to initialize but didn't complete.

@infernos90
Copy link
Author

infernos90 commented May 28, 2023

I found a problem: it shows "begin mpu, do not move, succes" without mpu and mag connected. Only module connected is gps.
Maybe is a problem with pins address attribution

@meltoner
Copy link
Owner

strange i would expect it to fail without them connected. ..

@infernos90
Copy link
Author

I tried with a simple servo motor. Not working. Maybe is not something correct in code.

@meltoner
Copy link
Owner

no everything has been fabricated and tested multiple times with videos. i can't project what is off could be just a wire missed, but one would have to test each thing carefully until discovers what is off. In theory i would test each component you have on its own one by one.

@meltoner
Copy link
Owner

inferno it just happens that i will be reproducing a 3rd time the project within the next month, nearly identical setup, so i will be re-passing the same steps you have and in case i find any deviation in the plans ill let you know.

@infernos90
Copy link
Author

Ok. Thank you.

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

No branches or pull requests

2 participants