k fuku Posted February 15 Report Share Posted February 15 Electric power steering control with LINK ECU using h-bridge devices I know this is a very silly, almost delusional idea, but do you have any actual examples? I tested it by connecting LINK to ECU master's h-bridge. The motor is a two-phase control type. I was able to control the drive motor PWM based on the torque sensor value only in one direction. The problem is reversing operation. Can I connect 2 channels to one motor and control left and right separately? Does anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
Adamw Posted February 15 Report Share Posted February 15 I have had no experience driving a EPS motor directly, but the ECU master device should be able to do the direction change. If using PWM input for example you can set the PWM offset to "middle offset" then, 0% input = 100% reverse. 50%DC input = 0% (stop). 100%input = 100% forwards. A similar setup can be done for CAN input. k fuku 1 Quote Link to comment Share on other sites More sharing options...
k fuku Posted February 16 Author Report Share Posted February 16 I have tried it, but it seems that "middle offset" can only be used for inputs 1-4. The selection does not appear on CAN. So I'm thinking of setting input 1, mode digital DC, and using GP PWM from LINK to output via AUX. Is the PWM output table DC correct? Is the frequency fixed at 100%? Analog voltage 2.5V of torque sensor is no-load state 2.6 to 5V when load is applied during right rotation 2.4 to 0V when load is applied during left rotation When the load is applied during left rotation, it changes from 2.4 to 0V. Quote Link to comment Share on other sites More sharing options...
Adamw Posted February 17 Report Share Posted February 17 23 hours ago, k fuku said: Is the PWM output table DC correct? Is the frequency fixed at 100%? Yes that looks like it would work to me. A fixed frequency of 100Hz would be fine. Note this setup would give some motor power as soon as the torque sensor voltage moved away from 2.5V - so at 2.49V for example the H-bridge will be outputting a small voltage. Is that ok or do you need a deadband between 2.4-2.6V? 23 hours ago, k fuku said: The selection does not appear on CAN. It should be possible to do it with CAN using the "CAN Word W1" for direction and PWM. -4095 to 0 would give 100-0% left, 0 to 4095 would give 0-100% right. k fuku 1 Quote Link to comment Share on other sites More sharing options...
k fuku Posted February 17 Author Report Share Posted February 17 thank you I will try it and report back. Quote Link to comment Share on other sites More sharing options...
k fuku Posted February 25 Author Report Share Posted February 25 On 2/17/2023 at 9:42 AM, Adamw said: Yes that looks like it would work to me. A fixed frequency of 100Hz would be fine. Note this setup would give some motor power as soon as the torque sensor voltage moved away from 2.5V - so at 2.49V for example the H-bridge will be outputting a small voltage. Is that ok or do you need a deadband between 2.4-2.6V? It should be possible to do it with CAN using the "CAN Word W1" for direction and PWM. -4095 to 0 would give 100-0% left, 0 to 4095 would give 0-100% right. Conversion of DUTY values The DUTY value of GPPWM is set from Do you have an equation idea to convert the DUTY value in the mass block as follows? DUTY0-49 → (-4095 to -1) 50=0 DUTY51 to 100 → (1 to 4095) Do you have any ideas on how to make the conversion in a formula? Quote Link to comment Share on other sites More sharing options...
Adamw Posted February 25 Report Share Posted February 25 So do you want 0 output between 49.1-50.9%? or only 0 output between 49.9 & 50.1%? TTP and k fuku 1 1 Quote Link to comment Share on other sites More sharing options...
k fuku Posted February 25 Author Report Share Posted February 25 10 minutes ago, Adamw said: So do you want 0 output between 49.1-50.9%? or only 0 output between 49.9 & 50.1%? Thank you, I would like to follow your advice if possible. Output between 49.1 and 50.9% 0 or higher. Quote Link to comment Share on other sites More sharing options...
k fuku Posted February 27 Author Report Share Posted February 27 On 2/25/2023 at 8:14 PM, Adamw said: So do you want 0 output between 49.1-50.9%? or only 0 output between 49.9 & 50.1%? The main and sub steering torque sensors seem to display opposite voltages respectively. I wrote them out as duty values in a 3D table. I also wrote down the duty values from 0 to 100 in a mass block. -4095 to 0 to 4095 I need to convert the duty values from 0 to 100 to -4095 to 0 to 4095 in the mass block. Quote Link to comment Share on other sites More sharing options...
k fuku Posted February 27 Author Report Share Posted February 27 54 minutes ago, k fuku said: The main and sub steering torque sensors seem to display opposite voltages respectively. I wrote them out as duty values in a 3D table. I also wrote down the duty values from 0 to 100 in a mass block. -4095 to 0 to 4095 I need to convert the duty values from 0 to 100 to -4095 to 0 to 4095 in the mass block. Left rotation when analog voltage2(a) is greater than 2.6 a<2.6(41*c) Analog voltage 1 (b) is greater than 2.6 and rotates right b<2.6(-41*c) c=PWM duty a<2.6(41*c) b<2.6(-41*c) I'm not sure if this is an equation that works correctly, but I can't enter it into the equation due to the number of characters. Quote Link to comment Share on other sites More sharing options...
Adamw Posted February 27 Report Share Posted February 27 If I understand what you want correctly, you dont need a math block. You can scale the DC directly to -4095 to 4095 with the CAN multi/div/offset. k fuku 1 Quote Link to comment Share on other sites More sharing options...
k fuku Posted February 27 Author Report Share Posted February 27 21 minutes ago, Adamw said: If I understand what you want correctly, you dont need a math block. You can scale the DC directly to -4095 to 4095 with the CAN multi/div/offset. Very helpful! I will try it as soon as possible. Thank you very much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.