How to increase gpio pins to 8

Hi ı have a ardurover and orange cube pixhawk, ı want use 4 encoder so ı need 8 gpio pins, orange cube have 6 gpio pins(aux pin) but ı need least 2 , ı can change the source code if require, could you help me

AFAIK, that is an hardware limitation.
It will need extensive SW changes on two processors.

okey, ı can add a external proccessor, how ı can do

The Cube orange already has the two processors in there:

  • the main one controls the 6 aux pins directly
  • The (I/O processor) smaller one controls the 8 main outputs

You will need to search and read the almost non existing documentation for the I/O processor. The best documentation is the source code.

okey thank you so much, ı know this will be hard but ı should experiment for my rover

Instead, you can connect something like an Arduino for sending commands to it with a serial port using a Lua script or some MAVLink command. So, it will something like a serial demux. I don’t think changing the source code is simple.

As far as I know, Ardurover does not consume wheelencoder messages over mavlink. The use of encoders is limited to the input over the GPIO pins. So no encoders for most flightcontrollers, or a limited number for the rest.

1 Like

thanks for reply ı already use arduino for bts7960 brushed motor driver, but ardurover support only 2 wheel encoder on mission planner gcs as WENC and WENC2 in parameter list, how ı can set last 2 wheel

You can’t do this natively. You are out of IO pins and the software doesn’t support more than two encoders (likely due to the fact that no typical autopilot hardware would support more than 3).

Lua and a microcontroller could work to consume the data, but inserting it into the control loops may prove difficult with existing firmware.

You could modify the firmware source to accept encoder data from a companion controller over serial, I2C, or CAN.

1 Like

Why do you want to use 4 encoders in the first place? If your rover has 4 wheels, two wheelencoders should be enough. If it has 6 wheels, two wheelencoders on the middle pair of wheels should also be enough. It will be a lot of effort to add two more encoders for a little bit of added accuracy (maybe).

2 Likes

ı work on a software develope and ı want more accurate, actually ı think 2 is enought too, but ı want know whats change between 2 and 4, now ı decided directly connect arduino to raspi, and my rover have 4 wheels

ı will run the rover with ros control and as ı look encoder data cant send via mavlink so ı cant reach that data, ı think will be best way connect encoder to arduino