Please or Register to create posts and topics.

RoboHeartBLECarControl

Page 1 of 2Next

I have connected a motor to the MotorA port. Using the motor with the RoboHeartMotorTest sketch works without any problems. However, when running the RoboHeartBLECarControl sketch I cannot get the motor running.

I have downloaded the latest version of the RoboHeartControl app from the iOS App Store. Connecting the App to the board while running RoboHeartBLECarControl works fine. The SerialMonitor correcly shows the usage of the controls. Thus the data transmission is no problem.

However, the motor does nothing. Connecting motors to ports B and/or C does not work either.

Is there something wrong with the RoboHeartBLECarControl example? Do I need to setup the motors manually in RoboHeartBLECarControl?

Hello,

please give me several dozens of minutes, going to analyze this problem.

Best regards,

Sam

I found some issue, which can cause, that motor can not run at all. Please find my ticket on https://github.com/Augmented-Robotics/roboheart-arduino-library/issues/6

Have tested it and now it does work.

You need just twice swap two lines of code.

Please let me know, if this helped you!

Best regards,

Sam

Hi Sam,

thanks for you help. Unfortunately updating the code did not solve the problem.

I have changed the code to:

// Callback for device disconnected event
void bleDisconnected() {
    bleDeviceConnected = false;
    bleNewStatusReceived = true;
    Serial.println("device disconnected.");
    heart.motorA.sleep(true);
    heart.motorB.sleep(true);
    heart.motorC.sleep(true);
}
// Callback for device connected event
void bleConnected() {
    bleDeviceConnected = true;
    bleNewStatusReceived = true;
    Serial.println("device connected.");
    heart.motorA.sleep(false);
    heart.motorB.sleep(false);
    heart.motorC.sleep(false);
}
This should be correct, shouldn't it?
However, the result is still the same: Serial Monitor shows correct received commands but no motor is turning...

Yes, your corrections are okay.

Could you please paste full serial log? Please do fw/bw and side movement.

How do you power Hercules? USB only, or do you have battery also plugged in?

Could you please make picture of your whole setup, please?

 

The board is connected and powered via USB C to my Mac Mini. No battery connected.
The same setup works without any problem when running the RoboHeartMortorTest sketch.

The Log:

*********
New value: 1 69 46 
MOTOR MESSAGE:
command: 1
speed: 207
steeringPower: 138
response: forward
*********

*********
New value: 2 62 46 
MOTOR MESSAGE:
command: 2
speed: 186
steeringPower: 138
response: reverse
*********

*********
New value: 4 46 62 
MOTOR MESSAGE:
command: 4
speed: 138
steeringPower: 186
response: left
*********

*********
New value: 3 46 86 
MOTOR MESSAGE:
command: 3
speed: 138
steeringPower: 258
response: right
*********





Uploaded files:
  • Setup.png

Hello,

motor drive A will not work. It is not bound to this demo.

Please connect motor to connector B(turn) or C (direction) and let me know!

Best regards,

Sam

While I tried this before without success, it now works... 🙂 I guess this is due to the code change to mentioned before.

However, where can I see which connector is bound to the demo?

That's great news!

If you want to see the connectors which are by default assigned for steering and forward/backward movement, go to library:

https://github.com/Augmented-Robotics/roboheart-arduino-library/blob/main/RoboHeart.cpp

Please find line 74 there:

setDirectionTurnMotors(motorC, motorB);

You can control also motorA, but using different methods included in.

https://github.com/Augmented-Robotics/roboheart-arduino-library/blob/main/RoboHeartDRV8836.cpp

If you need some hints how to control motorA separately, let me know, please.

Best regards,

Sam

Thank you very much for the insight.

What is the intended / best way to limit the movement of the direction motor (Motor C)? The current setup simply powers the motor and turns it as long as the control is activated. However the motor should only turn a few revolutions in each direction in order to steer the car.

Additionally: Only the direction motor port works. When connecting the same motor to MotorB, the motor only turns a minimal amount when first activating the control. Than the control does not respond any more (motor does not turn when control is used). In the Serial Monitor it seem as if the board looses BLE connection when using the turn control:

*********
New value: 2 65 46 
MOTOR MESSAGE:
command: 2
speed: 195
steeringPower: 138
response: reverse
*********
�T��}�[BLE_DBG] Service UUID: 000000ff-0000-1000-8000-00805f9b34fb
[BLE_DBG] Characteristic1 UUID: 0000ff01-0000-1000-8000-00805f9b34fb
[BLE_DBG] Characteristic2 UUID: 0000ff02-0000-1000-8000-00805f9b34fb
[BLE_DBG] Characteristic3 UUID: 0000ff03-0000-1000-8000-00805f9b34fb
RoboHeart BLE Demo
Page 1 of 2Next
Shopping Basket