dridri / bcflight

Raspberry Pi based drone flight controller and remote control
GNU General Public License v3.0
131 stars 22 forks source link

testing motor output #7

Open awright424 opened 1 year ago

awright424 commented 1 year ago

Is there any test/examples on how to test the motor output only? if I dont need the nrf modules will the board stil work without those populated?

dridri commented 1 year ago

Hello, if you let me a few days I can implement it. Generating pre-built images and giving some testing config files

awright424 commented 1 year ago

Thanks. the major thing I need to know is if the nrf modules aren't populated will it cause issues with the pcb. Where did you have the boards built as well. it looks like oshpark pcbs

dridri commented 1 year ago

None of the modules nor ICs are mandatory, as the software is fully configurable to choose what to use. You could even actually use a regular Raspberry Pi board and connect breakout boards to the pins header. I ordered my board from JLCPCB, cheaper here in Europe

awright424 commented 1 year ago

I have a cm4 sitting for the purpose of using it as a flight controller. the pcb would work for me for the most part. I would end up using elrs receivers hence me asking about the nrf modules.

On Sat, Apr 15, 2023, 6:09 PM drich @.***> wrote:

None of the modules nor ICs are mandatory, as the software is fully configurable to choose what to use. You could even actually use a regular Raspberry Pi board and connect breakout boards to the pins header. I ordered my board from JLCPCB, cheaper here in Europe

— Reply to this email directly, view it on GitHub https://github.com/dridri/bcflight/issues/7#issuecomment-1509987971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQNGPTED67ZJVYDDPLFJMTXBML7ZANCNFSM6AAAAAAW7LA6VU . You are receiving this because you authored the thread.Message ID: @.***>

awright424 commented 1 year ago

I know you have been busy, did you get a chance to add testing of motor outputs? I also had the pcb manufactured just need to add components. Is there a chance of having a bom that can be used with mouser etc? I tried the one in the pull request and tried using there bom tool but it seemed like it didnt import correctly.

dridri commented 1 year ago

Hey, sorry for the (very) late reply. I finished the image builder script, and working on a console interface directly in the flight controller allowing to access anything (including motors). Should be ready in the next 24hrs after some tweaks.

About the elrs chip, it seems to use generic UART communication bus so you should be able to directly solder it on the UART0 solder pads of the PCB.

However, I don't know what kind of data it sends via the bus, you will probably have to make your own Link class. (like what https://github.com/dridri/bcflight/blob/master/flight/links/SBUS.cpp does, the ::Read() function receives data from SBUS then returns a Packet containing at least the ControllerBase::CONTROLS command [+ some fancy math conversions and clipping])

dridri commented 1 year ago

Finally finished !

If you don't already have a working setup, you can find a prebuilt image here : https://github.com/dridri/bcflight#pre-built-images. This should be ready to use without any modifications.

The motors outputs are set to PWM-500Hz on pins 4,5,6,7 by default. You can change that in the /var/flight/config.lua file.

Once booted, SSH into the Pi using root:bcflight then go to /var/flight and start the flight controller using ./flight. This should end up on the new console interface after loading.

From this console, you should be able to spin any motor simply by using the following prompt :

flight> frame.motors[1].speed = 0 -- Set to 0 on the first time, this will arm the ESC
flight> frame.motors[1].speed = 0.25 -- any value between 0.00 and 1.00

This new console interface is all-new, so be sure to remove the propellers and/or secure the drone/motor on your desk

awright424 commented 1 year ago

Finally finished !

If you don't already have a working setup, you can find a prebuilt image here : https://github.com/dridri/bcflight#pre-built-images. This should be ready to use without any modifications.

The motors outputs are set to PWM-500Hz on pins 4,5,6,7 by default. You can change that in the /var/flight/config.lua file.

Once booted, SSH into the Pi using root:bcflight then go to /var/flight and start the flight controller using ./flight. This should end up on the new console interface after loading.

From this console, you should be able to spin any motor simply by using the following prompt :

flight> frame.motors[1].speed = 0 -- Set to 0 on the first time, this will arm the ESC
flight> frame.motors[1].speed = 0.25 -- any value between 0.00 and 1.00

This new console interface is all-new, so be sure to remove the propellers and/or secure the drone/motor on your desk

will do. I assume if I have a gy-91 module, mpu9250, I can use it with breakout board for the time being? I have the pcb's. the bom is the current problem I have. I would rather build the board to make sure things are as they should be. plus I have a cm4 for this reason.