Me Encoder Motor Driver: unable to set PID parameters


#1

Hi all,

I recently bought a ME encoder motor driver together with the ME orion board and a motor/encoder combi.
The idea is to let students experiment with PID parameters.

However I’m unable to set the parameters with the Download PID tuning toolPID tuning tool from makeblock. I connected via an USB to UART cable the motor driver to the PC and I’m able to ‘connect’ to the driver over the software, but none of the commands like get/set/save/run/stop work. I just connected the RX/TX/VCC and GND. Is there something I’m doing wrong?

Second question; would I be able to set these parameters directly over the orion over usb instead of connecting to the motor driver?

Thanks,
Wouter


#2

No one?


#3

Hi all,

in the meantime I found the problem why I couldn’t use the PID tuning tool; there was an error in the configuration of the cables; I connected the RX and TX cables wrongly.

However I still have a problem: I’m able to run the motor with the “EncodeDriver-Old” from GitHub but I’m unable to do so with the “EncodeDriver-New”. I really would like to use the “EncodeDriver-New” code as this can be used to set the PID parameters with a function on the ME Orion.

Uploading the EncodeDriver-New code over UART to the Encoder PCB is no problem, but when trying to connect/run the motor with the examples from the library nothing happens. Can someone confirm at least that I can use the EncodeDriver-New code on Me Encoder Motor Driver? Or give me any hint what I could be doing wrong?

Thanks,
Wouter


#4

Hi thevanquish,

The EncodeDriver-New is for a new version encoder motor which doesn’t have extra driver to perform PID mathematical.
While the previous motor has additional driver and there is a mega328P on the driver to perform PID mathematical, please use the EncodeDriver-Old.


#5

Hi tec_support,

thanks for letting me know, however, could you let me know if I can program the PID parameters in the ME Orion code? Can they be transferred over the I²C bus instead of using the UART cable connecting with the motor driver and the PID tuning tool?

I would like to use this setup (Orion / motor driver / motor with encoder) for students so they can experiment with PID tuning. It would be much more convenient if they only have to upload the code once (maybe I could even use LATLAB to do so?)

Thanks,
Wouter.


#6

Hi thevanquish,

If you are know very well about the programming, actually, it is possible to use the EncodeDriver-New program.
Here I attach a instruction to you for reference.Me encoder motor driver.zip (1.0 MB)

If there is further problem, welcome to ask question on the our Github page.


#7

Hi tec_support,

actually I was trying to modify the encoder_old driver. I figured out that in the encoder slave program, there are functions in the PackageHandler.cpp (GET_PARAM/TEST_PARAM/SAVE_PARAM) that are used to communicate with the PID tool for PC. I thought I could use the same functions for communicating with the ME Orion.

I just tried retrieving and displaying the PID parameters using the ME Orion with no succes.

  • In the MeEncoderMotor.cpp (Orion side) I added the following function rData which is called in the main program of the arduino:

    float MeEncoderMotor::rData()
    {
    uint8_t w[10] = {0};
    uint8_t r[50] = {0};

    uint8_t data[2] = {0};
    data[0] = _slot;
    data[1] = ENCODER_MOTOR_GET_PARAM;

    MeHost_Pack(w, 10, 0x01, data, 2);
    request(w, r, 10, 50);
    encoderParser.pushStr(r, 50);
    encoderParser.run();

    uint8_t temp[50] = {0};
    encoderParser.getData(temp, 50);
    float par = ((float )(temp + 2));
    int i;
    for (i = 0; i < 8; i++) {
    float
    x = (float
    ) temp + i;
    Serial.println(*x);
    }
    return par;

    }

  • In the PackageHandler.cpp (slave side) I also added behind the “Serial.write” cmd in the SendParam function, so the data is not only send over the Serial connection, but also back to the Orion:

    Wire.write(sendBuf, 50);

The only thing displayed in the serial monitor are all floats of 0.00, while I was expecting to see the parameters? Could you indicate what I’m doing wrong?

thanks,
Wouter


#8

Hi thevanquish,

Please send this issue to tec-support@makeblock.com for personal communication.


#9

Hi,

I have the same problem.
I’m teacher and I would like use this product with my student.
Have you the solution to program the PID parameters in the ME Orion code?
If you have got the solution thank to send the new librairy.

Thanks

Serge


#10