LabVIEW and Propeller Robot Controller
I am on a very tight time-table and so any help is appreciated.
I am using a propeller based servo controller to control the following items:
Thanks in advance.
I am using a propeller based servo controller to control the following items:
- 4 Drive Victor Motor Controllers (PWM)
- 4 Spike Relays (2 Pin Digital)
- 2 Pilot assisted pneumatic solenoids (1 Pin Digital)
- 2 Servos
Thanks in advance.

Comments
Let the Prop do it all.
However, you are probably going to interface right through the Prop USB port using a COM on the PC so you need to allocate a data structure on the PC side and reserve similar data format in memory on the Prop. Two cogs will handle all of this using FullDuplexSerial and your data handler routine.
Just how you read and set your PWM routines for the Victors may be a little different than the Servos so be careful there.
Sounds like a lot of fun!
sm
The person I spoke with at NI said that it was simple serial, and that if I could just read in the data by knowing how many bytes to look for, that would work. That is where I hit the brick wall of not knowing how to deal with the input on the other side. For example, I know that in pbasic, I could use the serin command and just supply it with my variables, but I don't know how to do that with spin.
Thanks for the speedy reply.
The counterpart to SEROUT is FullDuplexSerial.tx
e.g.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR byte myCharArray[6] OBJ comm: "FullDuplexSerial" PUB myComm | idx comm.Start(31,30,0,115200) ' start serial communication driver repeat repeat while comm.rxcheck == -1 ' wait for a byte to be received repeat idx from 0 to 5 ' read the entire packet into my data type myCharArray[idx] := comm.rx repeat idx from 0 to 5 ' echo the entire message back comm.tx(myCharArray[idx])'Bert Field Controller'Written by: Michael Aldridge ' with much assistance from Carlos Gross Jones 'Date Modified: 4.14.12 CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR byte P1VIC1 byte P1VIC2 byte P1SERV byte P1RLY1 byte P1RLY2 byte P1PNUE byte P2VIC1 byte P2VIC2 byte P2SERV byte P2RLY1 byte P2RLY2 byte P2PNUE OBJ link : "FullDuplexSerial" PUB Main link.start(31, 30, 0, 115200) repeat link.str(string("ready to receive",13)) serWait acquireData convertVals PUB serWait repeat while 1 repeat while NOT (link.rx == 65) link.str(string("first char correct",13)) if link.rx == 65 link.str(string("second char correct",13)) return else next PUB acquireData P1VIC1:=link.rx P1VIC2:=link.rx P1SERV:=link.rx P1RLY1:=link.rx P1RLY2:=link.rx P1PNUE:=link.rx P2VIC1:=link.rx P2VIC2:=link.rx P2SERV:=link.rx P2RLY1:=link.rx P2RLY2:=link.rx P2PNUE:=link.rx link.str(String("PACKET RECIEVED",13)) PRI convertVals P1VIC1:=P1VIC1-127 P1VIC2:=P1VIC2-127 P1SERV:=P1SERV-127 P2VIC1:=P2VIC1-127 P2VIC2:=P2VIC2-127 P2SERV:=P2SERV-127now to just write the PWM code...
Here is where it gets weird, on my protoboard where I have a dip plus kit, it works fine (with LED's, the SPIKE is at school right now), but on the board I intend to use, a servo controller board, it does all kinds of weird things such as oscillating states, wrong output configuration and other things that are seemingly random.
Any ideas?
EDIT:
alright, I have tracked down the oscillating state to a bad connection, but now I have a problem where it will just turn on all pins at once, instead of the one I write the logical state to. Any ideas?