Starting with this series of tests Alfa3,I added some new features that move the project to the final setup.In particular I add the following modification that allow the system to work wireless:
- I added a second ESC and a second motor.
- I modified the connector board adding a new 3 pin connector (C in the photo) where there is the zero volt (black wire), the signal (white wire) that is bridged with the 4th signal (green wire), and also added the 5 volt (red wire) . In this way I can choose if rpi is powered by the ESC (C connection) or not (B connection).
- So the schema for this test consist of the connection of motor M in A and motor M in C.
- I connected also my wifi dongle in the rpi usb port. I discovered that neither the pc nor the wifi dongle can act as access point. You can verify this using the comand:
So I used my smartphone activating the router wifi function,building up a network including the PC and the rpi.
Below the references used in the test:
- M turns counterclockwise, the red wire is connected to the “T” wire of the esc (the one that is closer to the T of the Turnigy logo),and the yellow wire to the “Y” wire , the black wire with the center wire of the esc.
- M mounts a standard left prop.
- M turns clockwise, the yellow wire is connected to the “T” wire of the esc ,and the red wire to the “Y” wire ,the black wire with the center wire of the esc.
- M mounts a right prop. (marked R).
- According to the position of the IMU,I have a negative roll rotation if M moves down.
I did already some tests with this configuration. In the next post the first results and the description of th enew sw module rc.py that is the remote control module.
UPDATED 2014.06.15 Important Note: I discovered that the usage of the function pwm.setservo() it is not adeguate to control the motor in a loop. Everytime it is called, it sets the pwm to zero than it sets the new value. the result is a loss of speed (and so power ) of the motor. I just start to use the pwm.add_channel_pulse() instead and it solve the problem.See motor.py for the last version of code.
Last Saturday it was the great day: first brushless moved! And moved with rpi!!!
Right now I prefer not to mix up too much things, so the rpi is powered via usb and the connection is done by ethernet cable.
Those the details for the necessary steps.
- Mount the motor firmly. IMPORTANT: Remember it will move,so fix it well!
- Connect the motor wires to the esc.my motor has got 3 cables:red,black and yellow.I decided always to connect the black on the middle, and i can invert yellow and red to change rotation side.
- Do NOT connect yet the esc power cable to the battery
- Connect esc 0v signal (black) to th rpi ground (for example pin 25)
- Connent PWM signal(white) on a rpi output.In my example i connect on pin 11 called GPIO17. This value(17) is used in the program.
- Connect Ethernet cable
- Connect USB to power on rpi
Let’s see now the software. It is necessary to install on rpi the RPIO library.You an find how to do it in the SW installation post.
- Donwload the motor_test folder tha includes motor_test.py and motor.py and copy in home/python/motor_test on your pc.
- On the pc terminal copy the folder on rpi: (it is requred the rpi password):
scp -r python/motor_test firstname.lastname@example.org:./python
password : raspberry
- On the pc terminal run the command to connect to rpi.now the terminal is the rpi terminal.
password : raspberry
- Finally run the motor_test program.Important: the startu sequence of an ESC can vary by the model.See the ESC page for details.
sudo python motor_test.py
- Follow the program instruction.
After the first ENTER , the PWM signal is set to the maximun value (a pulse width= 2000us every 20ms).Now you can connect the ESC power cables.If everything goes right (correct voltage, cell number correct) ESC is ready to pilot the motor.PWM signal goes to 1000us,the minimum value.So it is possible to play with the motor speed.My motor starts to move over 5%,it means 1050us.This value depends from motor inertia from friction and from battery charge level.
Following the suggestion of oddcopter Itoday I bought some material.
See the day by day updated material list here
Let’s wait the delivery now…