Motor only turns when disconnecting ecs from board

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
mattyang
Posts: 1
Joined: Wed Oct 14, 2015 7:10 pm

Motor only turns when disconnecting ecs from board

Post by mattyang »

Hi I just got a AIOP V2.0 ALL IN ONE PRO Flight Controller from rc timer and uploaded multiiwii with #defineCRIUS_AIO_PRO

I hope to control the board via serial USB (which appears to be an UART) from a raspberry pi, so as a first step I grabbed some python code that talks to multiiwii over usb from github, put everything together, connected the board to my mac over micro usb, and try to control the motors via a small python program running on my mac.

I've been trying this for quite a while, but for some reason when I send throttle data over USB via MSP_SET_RAW_RC, the props dont respond, however, when I unplug the esc's control cable, the motor turns for an instant moment. It is consistently reproducible: the motor only turns for a very brief moment (1s ~ 2s) when I connect or disconnect ecs control wires from the board's pins, but if I leave it connected, nothing happens. If I leave it disconnected, the ecs beeps every 2 sec which I assume means its not receiving control signal. Any idea on why it only works the moment I connect or disconnect the esc's control cable?

the code I use to read and send data are proven to work by other people, here is the code snippet for sending data to the board:
def sendData(self, data_length, code, data):
checksum = 0
total_data = ['$', 'M', '<', data_length, code] + data
for i in struct.pack('<2B%dh' % len(data), *total_data[3:len(total_data)]):
checksum = checksum ^ ord(i)

total_data.append(checksum)

try:
self.ser.write(struct.pack('<3c2B%dhB' % len(data), *total_data))
except Exception, ex:
print 'send data error'
print(ex)

I made sure all the numbers in data are between 1000 to 2000, and I send new data every ~100ms so it is within the required 1s refresh threshold.
I have been able to read the board's MSP_RC data from usb too, and the numbers seem to match the numbers I set via USB

Anyone help..Getting so confused by this

Post Reply