Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWM speed channel not working #244

Closed
villamany opened this issue Dec 13, 2021 · 30 comments
Closed

PWM speed channel not working #244

villamany opened this issue Dec 13, 2021 · 30 comments
Labels
bug Something isn't working

Comments

@villamany
Copy link

villamany commented Dec 13, 2021

Hi everyone. New to this project.
I'm testing the PWM variant but while the steering works, the speed dind't it. Tested the ADC variant and works as expected with the two potis.
In the PWM variant the "in2" always reads 0 when serial debug. The output train of the RC receiver is ok on both channels.

Thanks

@villamany villamany added the bug Something isn't working label Dec 13, 2021
@Candas1
Copy link
Collaborator

Candas1 commented Dec 13, 2021

Have you wrongly done the auto calibration maybe?
https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Input-Calibration#auto-calibration

You can check debug output when executing this procedure.

@villamany
Copy link
Author

villamany commented Dec 13, 2021

yes, but also seems to read always 0.

Input calibration started...
Input1 is a mid-resting pot..OK
Input2 is ignored..OK
Limits Input1: TYP:2 MIN:-999 MID:2 MAX:998
Limits Input2: TYP:0 MIN:0 MID:0 MAX:0
-- Motors enabled --

If i force PRI_INPUT1 and PRI_INPUT2 to type 2 instead 3(auto) i get;

Input calibration started...
Input1 is a mid-resting pot..OK
Input2 is ignored..NOK
Limits Input1: TYP:2 MIN:-975 MID:6 MAX:970
Limits Input2: TYP:0 MIN:-1000 MID:0 MAX:1000
-- Motors enabled --

but Speed still not working. Note the TYP:0 for input 2 and the "NOK" (i set both input type to 2)

@Candas1
Copy link
Collaborator

Candas1 commented Dec 13, 2021

The firmware works for sure, I have tested pwm myself.
Calibration doesn't seem to detect anything.
So there could be an issue with your receiver, wiring, or mainboard.

You are saying ADC works but ADC variant is using left cable, and PWM variant is using right cable by default (shorter). Have you tried pwm on left cable to make sure you don't have a problem on the right cable?

@villamany
Copy link
Author

villamany commented Dec 13, 2021

Yes, tested on both right and left cable by "#define CONTROL_PWM_LEFT/RIGHT", same result.
Receiver CHs are ok (tested with oscilloscope), and if i swap the CH1-CH2 wires steering works with CH2 instead CH1, wires also are ok.

I don´t know why the debug shows always Input2 as TYP:0, although I defined it as type 2 .

Also tried to erase flash before upload.

@Candas1
Copy link
Collaborator

Candas1 commented Dec 13, 2021

You don't have to change the type.
It will become 0 if you do the auto calibration and no input is detected.
To be on the safer side erase the chip, flash the firmware, and try without entering the Auto-calibration

@villamany
Copy link
Author

Same result, full chip erase, redownload the sources, set to PWM mode, and upload.
Input 2 still reads always 0.

@Candas1
Copy link
Collaborator

Candas1 commented Dec 13, 2021

It's weird.
How is your board looking like ?
Is their a chance different pins are mapped to the green wires on both cables than the ones mentioned here ?
But then ADC variant wouldn't work.

@villamany
Copy link
Author

IMG_20211213_205709

IMG_20211213_205621

@Candas1
Copy link
Collaborator

Candas1 commented Dec 13, 2021

The board looks similar.
When you say that you see a signal for CH2 on the oscilloscope, you see the duty cycle changing when moving the throttle ?

@villamany
Copy link
Author

villamany commented Dec 13, 2021

The board looks similar. When you say that you see a signal for CH2 on the oscilloscope, you see the duty cycle changing when moving the throttle ?

Yes
Also if i swap the CH wires i got signal from throtte in INPUT1

@villamany
Copy link
Author

But If the latest firmware is working on other boards i will assume a faulty board

@Candas1
Copy link
Collaborator

Candas1 commented Dec 13, 2021

The code hasn't changed for a while, and other community members shared videos of their setup with pwm.
But would be weird that's it's not working on both sides.
Is you receiver only handling PWM ?

@villamany
Copy link
Author

this one yes, but in will try another one PPM capable

@villamany
Copy link
Author

Tested the PPM variant with a PPM receiver (used the IN2 wire acording to wiki -green wire-), no any signal detected, always shows IN1=0 and IN2=0, so i assume a faulty board in both left/right ports with the same issue!?

@Candas1
Copy link
Collaborator

Candas1 commented Dec 13, 2021

Are you sure you use the right number of channels?

@villamany
Copy link
Author

In PPM i tried first with16 channels and second select only 4 channels in the Taranis TX configuration.
Of couse im using Ail and Elev sticks remaped to CH1 and CH2

@Candas1
Copy link
Collaborator

Candas1 commented Dec 14, 2021

No beeps ? You should get beeps if the number of channel is incorrect.
Same on left and right ?
What receiver are you using ?

@villamany
Copy link
Author

villamany commented Dec 14, 2021

I got 4 low beps (no PPM input), i matched the PPM CHs with my PPM RC receiver by #define PPM_NUM_CHANNELS 8
Checked with oscilloscope my RC PPM train, all seems ok, but still no inputs (the two inputs reads 0)

Here is my PPM signal with the CH1 at minimun (1000us) and the CH2 at maximun (2000us), CH3-8 are not used (1500us)
pic_32_1

@Candas1
Copy link
Collaborator

Candas1 commented Dec 14, 2021

So even after matching the channels, you get beeps, and from both sides ?

@villamany
Copy link
Author

yes, tried both sides and both wires on each side.
At power On i got first two low beeps (no ADC) and then start to sound four low beeps forever (no PPM). Of course i got //#define DUAL_INPUTS commemted and using the UART for debug

@villamany
Copy link
Author

However if i enable DEBUG_SERIAL_USART i should be able to send commands is correct?

I can read data like the calibration result, but if i send a command don't get any reply. IE i send HELP and no any reply

@Candas1
Copy link
Collaborator

Candas1 commented Dec 14, 2021

No it's not enough for sending commands, this should be also enabled.
https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Debug-Serial#debug-protocol

@villamany
Copy link
Author

Sorry, i mean enable DEBUG_SERIAL_PROTOCOL and no get any reply

@Candas1
Copy link
Collaborator

Candas1 commented Dec 14, 2021

Yes then it should work.
It could be both your green wires are not working.

@villamany
Copy link
Author

is there any way for using as PPM input the blue wire instead the green one?

@villamany
Copy link
Author

villamany commented Dec 14, 2021

Modified this line in the defines.h file and got a fine PPM input in the Right side-blue wire.

#define PPM_PIN GPIO_PIN_10 //GPIO_PIN_11

@Candas1
Copy link
Collaborator

Candas1 commented Dec 14, 2021

👍👍👍

@villamany
Copy link
Author

Many thanks!. I will try to get another board for testing.
One more question, is there any easy way for control each motor with a single channel? I would like to test ardurover controling a skid-steer like vehicle

@Candas1
Copy link
Collaborator

Candas1 commented Dec 14, 2021

Please check USART variant in the wiki.
I saw this by chance recently

@villamany
Copy link
Author

villamany commented Dec 17, 2021

Hi, after some tests, R23 and R26 are faulty, some resistance but much more than 100ohm, so its a faulty board. I think probably some time ago in early tests i used the red wire of the port (15v) by mistake instead the 3v3 and fried resistors, with the pots i get reads but very noisily.

The left channel survived after replace resistor but the right one didn't.

Thanks for all the help!
pcb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants