Hello,
I am trying to basically set the speed of a motor through an esp32 which is connected to the motor’s ESC. According to ESC documentation, it should send a value <= 2048 to subject ID 6152 or write to service ID 256 the value<=2048 to its register ( setThrottle = 10H ).
I am trying my best to implement it without any results so far. I don’t know how to start with DSDL definitions seems nothing fit in my application.
Cyphal library examples don’t have reg/udral only Standard regulated identifiers (namespace uavcan
) GitHub - OpenCyphal/public_regulated_data_types: Regulated DSDL definitions for Cyphal (standard and third-party) .
I don’t know if other ESCs work like that, but is very important to have access to all registers of the ESC with service ID 256.
I would appreciate any help, especially with .ino code.
The described protocol has nothing to do with Cyphal or DroneCAN.
Hello Pavel ,
Thank you for your fast response.
Are you sure about that?
It mentions it clearly and I run the Heartbeat example works great with the ESC .
I believe I just need to set the PORT_ID variable either on ArduinoUAVCAN .publish or .request , and then send the msg somehow.
At one similar example at UAVCAN I saw about reg has “using namespace reg::drone::service::battery;” which classes requests to set up a PORT_ID like that “uc.subscribe<SourceTs_0_1<SOURCETS_PORT_ID>>(onSourceTs_0_1_Received);”
UAVCAN BMS example
-
256, 6152, 6153, 6154 are not a valid fixed port-ID in Cyphal or DroneCAN
-
In both Cyphal and DroneCAN, application-layer protocols are defined in terms of data structures, which in turn are defined using DSDL. The DSDL of Cyphal and DroneCAN is similar but not exactly the same.
-
The provided serialization logic as explained in the document does not match that of Cyphal or DroneCAN.
-
This is not true:
This could be true if the data types were listed in GitHub - OpenCyphal/public_regulated_data_types: Regulated DSDL definitions for Cyphal (standard and third-party), but they are not.
I recommend you request clarifications from the manufacturer. We would be happy to assist if they consulted with us.
- I have no clue, they seem to know what they are doing they have full documentation about it .
I am uploading it here .
SquareWaveESCCyphalCANCommunicationProtocol-2 (2).pdf (1.8 MB)
I understand that, but I should be able to use Non-standard regulated identifiers (namespace reg
) for those IDs.
I don’t believe that the manufacturer will help me, they will probably tell me to use ArduPilot which I think supports CyphalCAN according to their FAQ (edit: wrong it doesn’t ) . The manufacturer called MAD Motors site .
The ESC I have here .
DSDL has some definitions for actuators. Is there any example on the web / community I can try ?
I am thinking of just setting the port IDs as it says then add data and use publish function .
For example I see has some files like Scalar , Status , Vectors, could any of that possibly help me out ?
This is expressly prohibited by the Specification. If one is releasing a product for the general market, they must publish their data types to the public regulated data types repository. It doesn’t take more than a few clicks of the button to do that, so there is really no excuse not to. But even that is not the most serious deficiency of this product.
Consider switching to another supplier.
I completely understand your point and agree with you. However, as a consumer of this product, my only option is to switch to a different one, which isn’t ideal since I’ve already made the purchase.
My final question—before I stop bothering you—is whether I can create a custom frame type or something similar that might work. For example, I’d like to set a port ID and a total payload of 4 bytes, as shown in the picture above, with a request ID of 256.
You can exchange arbitrary custom messages via Cyphal/CAN using libcanard. If you need help with this, please send an email to sales@zubax.com; we can get you going with this quickly.
hello everyone, I started an internship in a company, I’m working on CyphalCAN communication with an ESC using Canalyst-ii adapter and python. I have already implemented broadcast data types(throttle control, heartbeat, and status messages by using python code)…
Now, I want to implement service data type communication,specifically:
1)Register Read/Write(Service ID:256)-Reading and writing ESC parameters.
2) Get Node information(service id: 430)- retrieving esc hardware, software details
3)Node command control(service id:435)- Sending commands like factory reset and firmware update
My Question is:
- Is my request format correct for service message(register read/write, node info, command control)?
2)Do I need to handle multi-frame responses differently for service messages?
3)Is the response ID different from the request ID for service messages?
4)Any debugging steps to check if the ESC is receiving and replying to my requests?
How to check whether my esc is responding or not
Python code:
import canalystii
import struct
import time
service_id = 0x100
dev = canalystii.CanalystDevice(bitrate=500000)
Can_id = 0xB400803
print(“CAN device initialized”)
def read_request():
operation_command = 0x00
register_index = 0x18
request = struct.pack(‘>HBB’, service_id, operation_command, register_index)
print(f" Request Payload: {request.hex().upper()}")
return request
def send_request(request):
msg = canalystii.Message(
can_id=Can_id,
extended=True,
data_len=len(request),
data=tuple(request)
)
dev.send(0, msg)
print(f" Sent CAN request: {request.hex().upper()}")
def receive_response(timeout=1.0):
start_time = time.time()
while (time.time() - start_time) < timeout:
messages = dev.receive(0)
if messages:
for msg in messages:
if msg.can_id == Can_id:
response_data = bytes(msg.data)
print(f"Received Response Data: {response_data.hex().upper()}“)
return response_data
time.sleep(0.1)
print(”[FAIL] No response received.")
return None
if name == “main”:
while True:
request_payload = read_request()
send_request(request_payload)
response = receive_response()
if response:
print("[SUCCESS] ESC responded correctly.")
else:
print("[FAIL] No response received.")
time.sleep(1)
this is code i tried for register read/ write but i didn’t get any respond from the esc…
Hello Nadana ,
I am an not an expert but I read a lot this protocol and documentation of my ESC to make it work in C / esp32 .
3) My ESC documentation specifies that the request response is on the same ID (256 , 430 , 435 ) .
4) Try to read broadcast messages (not heartbeat) if have any. For example, my ESC when you set the throttle, it broadcasts the temperatures the rpm etc. If you succeed in that , in the same way and also setting the Node ID of the ESC you will get the response in the same ID which then you need to “unpack” it accordingly. (If python works like cyphal for Arduino library .)

In my opinion, since you had some progress, try to implement it by yourself for some weeks or months because they are asking for a lot of money. If I could make it during my exams you can too.
Read DSDL messages from github. here
1 Like
Thank you for your reply sir! I had a doubt—how can I confirm whether my ESC supports the service data type (SER-ID: 256, 430, 435)?SIr, I have successfully received broadcast messages (heartbeat, throttle response, etc.), but I’m unsure if my ESC responds to service requests sir.
Did you find anything in your ESC documentation that explicitly mentioned support for service data types sir?Or did you test it directly and get a valid response?
Iam using E200 14S ESC but I’m unsure if my ESC respond or not!