RS232 and RC Control
- sww
- Topic Author
19 years 3 months ago #864702
by sww
RS232 and RC Control was created by sww
Is it possible to control the motor controller with the RS-232 and the RC mode with a single cable?
I would like to switch back a forth between RC and RS-232
control mode. I customized the RC cable to add the Rs232 data lines. I have the code working to do this, but when I am in RC mode the motor controller reports NO CNTRL.
The RS232 control works as expected and the data logging work when in RC mode, but I have not control input.
If I unplugged the Rs232 cable from the computer the RC starts working.
I would like to switch back a forth between RC and RS-232
control mode. I customized the RC cable to add the Rs232 data lines. I have the code working to do this, but when I am in RC mode the motor controller reports NO CNTRL.
The RS232 control works as expected and the data logging work when in RC mode, but I have not control input.
If I unplugged the Rs232 cable from the computer the RC starts working.
Please Log in or Create an account to join the conversation.
- cosma
19 years 3 months ago #877463
by cosma
Replied by cosma on topic Re:RS232 and RC Control
It is possible to do this but extra hardware is required as one of the input pins is shared between the RC and RS232. Also, several of the MCU resources (RAM area, GPIO) are shared internally.
See schematics and operation at dev.roboteq.com/dev1/download/RS232-RCSwitchoperation.pdf
In summary:
- A dual throw relay is used to route the input pin to either the RC radio or RS232 port.
- When the relay is activated, a capacitor is used to cause a controller reset.
- Relay is activated by a 3rd RC channel.
Cosma
See schematics and operation at dev.roboteq.com/dev1/download/RS232-RCSwitchoperation.pdf
In summary:
- A dual throw relay is used to route the input pin to either the RC radio or RS232 port.
- When the relay is activated, a capacitor is used to cause a controller reset.
- Relay is activated by a 3rd RC channel.
Cosma
Please Log in or Create an account to join the conversation.
- sww
- Topic Author
18 years 9 months ago #2673783
by sww
Replied by sww on topic Re:RS232 and RC Control
I ended up using a third channel on to flip a double pole double throw relay. Instead of using the circuit to reset the controller, I use the RS-232 mode to switch between modes.
NOTE: You can not switch from RC mode to RS232 mode unless all the RC inputs are disconnected. This means you have to disconnect all RC inputs into the Motor Controller not just channel 1.
Unfortunately, I could not find a RC switched DPDT-relay. I modified a "R/C Dual Ended Switch" from www.teamdelta.com/products/prod2.htm
Roboteq should consider selling a box/adapter that adds this functionality to the controller.
NOTE: You can not switch from RC mode to RS232 mode unless all the RC inputs are disconnected. This means you have to disconnect all RC inputs into the Motor Controller not just channel 1.
Unfortunately, I could not find a RC switched DPDT-relay. I modified a "R/C Dual Ended Switch" from www.teamdelta.com/products/prod2.htm
Roboteq should consider selling a box/adapter that adds this functionality to the controller.
Please Log in or Create an account to join the conversation.
- cosma
18 years 9 months ago #2679469
by cosma
Replied by cosma on topic Re:RS232 and RC Control
You shouldn't need to have all RC inputs disconnected. Please explain how you reached that conclusion.
Please Log in or Create an account to join the conversation.
- sww
- Topic Author
18 years 9 months ago #2681915
by sww
Replied by sww on topic Re:RS232 and RC Control
Here is our normal operating procedure. The default mode is RS232 mode. At first we had this setup:
MC.CH1 = RS232
MC.CH2 = RC.CH2
Then the relay would switch MC.CH1 = RC.CH1.
The software would have the following procedure:
(Already in RS232 mode running normally)So, now the relay looks like this:
RS232:
MC.CH1 = RS232
MC.CH2 = N/C
RC:
MC.CH1 = RC.CH1
MC.CH2 = RC.CH2
The relay is controlled with a third RC channel. I am using a Fubata PCM RC control system.
MC.CH1 = RS232
MC.CH2 = RC.CH2
Then the relay would switch MC.CH1 = RC.CH1.
The software would have the following procedure:
(Already in RS232 mode running normally)
1. Set the mode to R/C:
write ^00 00
2. Reset the controller
write %rrrrrr
3. Now in RC mode, drive about... everything above would work fine.
4. Re-enter RS232 mode.
Send 10 'Returns' w/ 16 ms delay
This would not work. In debugging, I noticed if I disconnected RC2 and RC3 completely from the MC it would work as expected. I am assumed this was because the RC was still outputting pulses on those channels (PCM RC control).
RS232:
MC.CH1 = RS232
MC.CH2 = N/C
RC:
MC.CH1 = RC.CH1
MC.CH2 = RC.CH2
The relay is controlled with a third RC channel. I am using a Fubata PCM RC control system.
Please Log in or Create an account to join the conversation.
- cosma
18 years 9 months ago #2688710
by cosma
Replied by cosma on topic Re:RS232 and RC Control
There is no reasons why a signal on CH2 would prevent "returns" to be recongnized on CH1. We will look into this.
One potential problem with your scheme is that you are using the radio to flip the relay and the RS232 to send the command for switching mode.
If you are in RS232 and flip the relay before the reset command is sent, then the controller will be stuck in RS232.
The scheme we published puts the switching command entirely in the hands of the radio. This allows you to force an RC override in case of emergency.
We'll try to look at ways that we could modify the controller software to make the switching possible with even less hardware. One possibility would be - while in RS232 mode - to detect RC pulses on CH2 and if they are present activate output C to drive a small relay.
One potential problem with your scheme is that you are using the radio to flip the relay and the RS232 to send the command for switching mode.
If you are in RS232 and flip the relay before the reset command is sent, then the controller will be stuck in RS232.
The scheme we published puts the switching command entirely in the hands of the radio. This allows you to force an RC override in case of emergency.
We'll try to look at ways that we could modify the controller software to make the switching possible with even less hardware. One possibility would be - while in RS232 mode - to detect RC pulses on CH2 and if they are present activate output C to drive a small relay.
Please Log in or Create an account to join the conversation.
Moderators: tonysantoni
Time to create page: 0.057 seconds