Arduino Leonardo co...
 
Notifications
Clear all

Arduino Leonardo connection to two SOLOs - analog or digital


Forum 1
(@schmelzmanufaktur)
New Member
Joined: 2 months ago
Posts: 3
Topic starter  

Hi Milad,

I need to connect  two SOLOs from Arduino Leonardo and tend to use analogue control mode via 4 channel 12-bit DAC I2C (like Adafruit MCP4728)
Unfortunately, Analog Output on Leonardo is 8 bit.

I want to use as less pins as possible and the connection should be as fast as possible and the resolution to control Torque and PowerLimit should be at least 12bit.

Why? As I understand the values sent to solo are absolute values referencing to 32A. The motor I use should take 8A as max. So I can only use 1/4 of the range to control it.

1) I could not find in specs: What resolution does the ADC for torque and power limit on SOLO have?

2) Can the absolute 32A power reference be reduced by a firmware trick or configuration during initial setup (motion terminal)?

 

I read here https://www.solomotorcontrollers.com/forum/solo-arduino-library/read-value/#post-648 that I could use a multiplexer.

2) Could I use 1 HardwareSerial and one via SoftwareSerial instead? Can the SOLO lib be adapted that way?

3) Could I use Serial1 and one I2C-UART bridge to achieve the second UART connection?

What is the best solution from your point of view?

Cheers


SOLO Team liked
Quote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 251
 

Hi @schmelzmanufaktur

Posted by: @schmelzmanufaktur

1) I could not find in specs: What resolution does the ADC for torque and power limit on SOLO have?

SOLO UNO and MINI are having 12bits resolution on the Analogue inputs.

Posted by: @schmelzmanufaktur

2) Can the absolute 32A power reference be reduced by a firmware trick or configuration during initial setup (motion terminal)?

In analogue Mode, unfortunately, it's not possible and it's a fixed value, the Current limit in the Motion terminal is only useful for digital mode control.

Posted by: @schmelzmanufaktur

2) Could I use 1 HardwareSerial and one via SoftwareSerial instead? Can the SOLO lib be adapted that way?

The library written for SOLO is pretty flexible as it is only using 1 function from Arduino libraries which is the serial send and receive, everything else is implemented from the ground up thus adding other features are of course possible for each user.

Posted by: @schmelzmanufaktur

3) Could I use Serial1 and one I2C-UART bridge to achieve the second UART connection?

This can be an option, but since Arduino Leonardo has only 1 UART line, you need to figure out how to proceed with the wirings.

In general, to network, multiple SOLO's with a UART connection you have two main options:

  1. Adding Analogue multiplexer on the TX lines of SOLO's to Arduino as shown in this image, this option is the simplest in terms of coding, as it only requires 1 UART line and by just selection of propper GPIOs to select the channels it's very easy to implement
  2. Using Arduino modules with multiple UART lines, so you can make a SOLO object in the code with their special UART line assigned, to do that you need to add a constructor like below into the solomotorcontroller.cpp file of the library, adding this feature is in progress in the library, and hopefully in next weeks, we will release an example for it ( below is just a pseudo code just to give you an idea, we will publish the final version soon)
SOLOMotorController::SOLOMotorController(unsigned char _addr , HardwareSerial& _serial){
    addr = _addr;
    serialPort = -serial;
}

In general, if you want to use the UART line connection you can fully bypass the analogue control and switch to digital control and send and receive all the commands with UART data packets, this can save you a lot of wirings...

in any case, please share here the wiring you have in mind for your implementation and we will discuss it.

Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Forum 1
(@schmelzmanufaktur)
New Member
Joined: 2 months ago
Posts: 3
Topic starter  

Hi Milad,

thanks for your answers. Building on your answers I will switch to an arduino pro mega to control the motor digitally.

Regarding 2) The functions  

SOLOMotorController::SetCurrentLimit(float A) and

SOLOMotorController::SetTorqueReference(float A)   will always set the limit in Amps.

In case SetTorqueReference() is set to 10A and SetCurrentLimit() was set to 8A, the motor will not go beyond 8A, right?

 

What I have to call to stop the motor completely? In both methods the implementation will not send less than 0.2A to the controller!? 

 

In Solo Mini Documentation I read about RxTx lines. Tx is 3.3V but both pins can be connected directly to 5V arduino, right?

You need only to take care to not mix up the connection pins, right? 

 

Kind regards


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 251
 

Hi @schmelzmanufaktur,

Posted by: @schmelzmanufaktur

In case SetTorqueReference() is set to 10A and SetCurrentLimit() was set to 8A, the motor will not go beyond 8A, right?

 

Yes, exactly, the current Limit will act like a saturation unit, and it won't allow the torque reference ( in Amps) to surpass the current limit value, so if you send a 10A torque reference with a current limit of 8A, the torque will be kept at 8A. ( As Iq or quadrature current in brushless motors has a linear relation with Torque to simplify we mentioned the torque in Amps, but as a matter of fact the torque is the result of Iq multiplied to Motor's torque constant)

Posted by: @schmelzmanufaktur

What I have to call to stop the motor completely? In both methods the implementation will not send less than 0.2A to the controller!? 

You can just set the Torque reference at 0A, you can also use emergency stop in emergency cases which will cut the current fully from floating into the motor ( after Emergency stop a power recycle is required)

Posted by: @schmelzmanufaktur

In Solo Mini Documentation I read about RxTx lines. Tx is 3.3V but both pins can be connected directly to 5V arduino, right?

The RX line which is the receiving end on SOLO UNO and MINI is actually accepting both 3.3V and 5V, so it's 5V tolerant, and you can connect it to any Arduino or raspberry pi modules, However, the TX line is only 3.3V and it's not +5V tolerant, but as a matter of fact TX is the output of the UART line of the SOLO going to other receiving ends of other modules, this 3.3V is acceptable as a high logic signal for all Arduino and raspberry Pi models, So as long as you connect the TX and RX lines on SOLOs correctly to any Arduino Model, you will be safe.

The simplified wiring of SOLO MINI to Arduino UNO is shown as below ( Arduino UNO's TX and RX are both 5V but like below SOLO MINI is easily interfacing it)

Forum 5

if you are using SOLO MINI and Arduino alongside a Brushless motor with Hall sensors to control the Torque, the wiring will be as below:

Forum 6

Posted by: @schmelzmanufaktur

You need only to take care to not mix up the connection pins, right? 

 

The wirings are pretty clear, the TX line is only acting as output and must be always connected to the receiving ends of other modules ( RX of other modules with high impedance ), and the RX on SOLO is only for receiving the data coming from UART from other module's TX, we put these notes, as we observed some of the users tried to swap the RX and TX whenever they saw something not working ( always irrelevant to UART's connection), so if you keep the connection as these schematics, you'll be safe and no need to worry about anything, of course for a good connection you always need to keep the GND or the Ground of the modules connected to each other at least in a single point.

Let me know if you have any other questions. ( we are putting the wirings of SOLO MINI all over our website in a couple of days but as it's identical to SOLO UNO, they will be very similar)

Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Share: